Skip to content

Support for environment variables in requirement specifiers #3516

@gioele

Description

@gioele

Pipenv should accept bash-like enviroment variables in requirement specifiers and substitute them on the fly when pipev is run.

Is your feature request related to a problem? Please describe.

One possible use of this feature is installing packages from private GitHub repositories via OAuth. Right now this is not possible without storing the OAuth token in plain text in Pipenv like, for example:

[packages]
private-package = {editable = true,
    git = "https://1234abcdef56789:x-oauth-basic@github.com/myorg/private-package.git",
    ref = "v2.1"}

Describe the solution you'd like

It would be nice if bash-like enviroment variables where accepted and substituted on the fly when pipenv is run. For example:

pipenv install 'git+https://${GIT_TOKEN}:x-oauth-basic@github.com/myorg/private-package.git@v2.1#egg=private-package'

(Please note the single quotes.)

Describe alternatives you've considered

In plain pip it is possible to use pip install -r <(envsubst < requirements.txt). This solution, however, is not possible with pipenv.

Additional context

See also pypa/pip#6244.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions