Provide a way to consistently run scripts that require project root relative paths
See original GitHub issueIs 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
Issue Analytics
- State:
- Created 5 years ago
- Comments:25 (11 by maintainers)
Top GitHub Comments
With pipenv-shebang you can run your script by inserting the shebang
or you could run it with
pipenv-shebang PATH/SCRIPT
directly.This is probably simpler