Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Reloader using wrong python executable #1580
The change made as a result of this PR, #1242, causes inconsistent behaviour when specifying how a script should be run.
The biggest use case is running a script with a debugger, as seen with this issue: #1493
The developer shouldn't be forced to change shebangs or to change the execute permissions of the file to make it work.
In summary, if an executable is specified, then that executable should be used; regardless of the file's shebang.
Since the intention was for this to work with NixOS, I propose that if the functionality is to remain then it should be exclusive to NixOS (where it was pointed out on the PR that it seems to be a problem with the OS), similarly to Windows.
I agree that there are ways to set this up so that it works correctly.
As mentioned in this issue, #1482 , the solution to make it work on NixOS doesn't feel right over all.
The file being executed shouldn't have the final say on how it should be executed.
I'm happy to open a PR, but at this stage I don't know how to satisfy all users without adding in an additional option.
I also encountered this issue while trying to upgrade. In my case, I have a main script that starts with
source venv/bin/activate ./run.py ...
venv/bin/python run.py ...
Both were equivalent. After #1242, this is no longer possible.
About the suggested fixes, tox doesn't fit because I don't have multiple venvs, and chmod -x run.py would fix the second way but break the first way. Also, the app doesn't have a setup.py (just requirements.txt) so I can't use entry_points.