If I build a package with python setup.py bdist_wheel
, the resulting package expands the shebangs in the scripts listed in setup.py via setup(scripts=["script/path"])
to use the absolute path to my python executable #!/home/f483/dev/storj/storjnode/env/bin/python
.
This is obviously a problem as anyone using the wheel will not have that setup. It does not seem to make a difference what kind of shebang I am using.
I finally narrowed it down and found the problem.
Here the exact steps to reproduce the problem and the solution.
Use a valid shebang in a script thats added in setup.py. In my case #!/usr/bin/env python
Create a virtualenv with virtualenv -p /usr/bin/python2 env
and activate with source env/bin/activate
.
Install the package with python setup.py install
to the virtualenv.
Build the wheel with python setup.py bdist_wheel
.
The problem is installing the package to the virtualenv in step 3. If this is not done the shebang is not expanded.