If I have a python package that contains an executable script and setup.py mentions it in its scripts field, it gets installed into the bin directory.
When it does that, however, it rewrites any #! line in that script to point to the path of the python being used. I would like to specify my own #! line.
When I was using setup.py on its own, I had a workaround. The build command has an --executable option that does exactly what I need. Unfortunately, the install command doesn't recognize it, but I could break the install into two steps:
python3 setup.py build --executable=...
python3 setup.py install --skip-build
Is there a way to do the equivalent of --executable with pip?
The intention is to have executable scripts begin with '#!/usr/bin/env python3', which will invoke python from the path. I realize that this is not a good idea in most cases, but I'm installing an environment (which contains more than just python) that needs to function no matter where it exists in the file system (i.e., you can mount it somewhere else, and it still works), so I don't want any absolute paths except for things like /usr/bin/env which are always going to be present. The system already works, but I'm trying to move my python package installation from raw setup.py to pip and ran into this snag.
virtualenvwith the path of the Python being used, and then install the package normally?