Skip to content

Provide a way to consistently run scripts that require project root relative paths #2241

Open
@kristofferpeterhansel

Description

@kristofferpeterhansel

Is your feature request related to a problem? Please describe.
The pipenv run is really handy. But it requires a good deal of work to actually make it work for situations where your current directory is not the same as where the Pipenv file is located.

Just for something like using it as a shorthand for running your python application that requires setting the PYTHONPATH environment variable. It it is tricky to figure out what to actually set it to. And while it can be made easier by wrapping it in a shell script. Informing Pipenv where said script is located also becomes tricky

Describe the solution you'd like
The most simple solution I can think of would be having en environment variable (say, PIPENV_PROJECT_ROOT). And could be used in places like the scripts section of Pipfile. And in scripts run from it.

Describe alternatives you've considered
For my problem it would also have been nice with a way to have Pipenv update the PYTHONPATH environment variable to include a path relative to the project root. But just having the project root in the environment would likely solve more use cases

Metadata

Metadata

Assignees

No one assigned

    Labels

    Contributor CandidateThe issue has been identified/triaged and contributions are welcomed/encouraged.Type: Enhancement 💡This is a feature or enhancement request.hacktoberfest

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions