-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support running local scripts with pipenv run
#2921
Comments
pipenv run
pipenv run
I was thinking about this for a while (in a more general sense). Maybe we can add a fallback that when the first argument looks like a path, or starts with
(The path case has This would, however, requires a PEEP, and I just don’t currently have the time and capacity to draft it. I would be interested in assisting if you are interested in submitting a PEEP request. https://github.com/pypa/pipenv/blob/master/peeps/PEEP-000.md |
I don't think we should assume that the script is a python script. For example, what if someone make a bash script that uses the pipenv python, but itself runs using the bash interpreter? If someone wants to run a local python script I think adding a shebang line
I'd be happy to do this. Do I just PR a markdown document into the peep folder? What else should I add on top of what I have already written? |
Personally I feel it is more productive to assume Yes, just send a PR to add a Markdown document to the See #2819 for an example of discussions for PEEP-002. Also you might be interested in reasing some of Python’s PEP to get a feeling how this kind of documents can be structured. PEP 517 is a good example IMO. |
Currently
pipenv run
will run either:$PATH
[scripts]
However, it is quite a common occurrence that users will want to run a local script, e.g.
./app.py
. Currently there are a few ways to do this, but each has their downsides[scripts]
section - this works but assumes the user knows beforehand which scripts they may want to execute. Not good for ad-hoc running of scriptspipenv run python app.py
- this forces the user to specify the interpreter. This means the shebang line is ignored, and requires the user to know which interpreter they want (if it's a shell script it shouldn't be run withpython
). Unix philosophy dictates that we leave the choice of interpreter up to the script itself (hence the existance of the shebang)pipenv shell
, and then run./app.py
. This is (imo) too much of a heavyweight solution. Starting a new shell shouldn't be required to run a single script.Thus, could we implement the ability for
pipenv run
to execute arbitrary local scripts? Or is there some philosophical reason why we aren't allowing this?The text was updated successfully, but these errors were encountered: