Join GitHub today
Eggs/Wheels have broken shebangs #168
For distribution on Pypi, I wanted to create both Eggs and Wheels with
project.set_property("distutils_commands", ["sdist", "bdist_egg", "bdist_wheel"])
The project includes a script in src/main/scripts with a shebang of #!/usr/bin/env python. In the "sdist", this shebang remains intact and it works fine when installed from Pypi.
In the Egg and the Wheel, there is a modified shebang that points to the Python interpreter in the virtual environment that I use for building. Consequently, these files do not work when installed via Pypi. The same thing happens when I call the auto-generated setup.py myself.
I was able to work around this issue (after some inspiration) by manually adding
into the setup.py, deleting the temporary files and then calling setup.py myself.
Hi, thanks for opening an issue. I actually already ran into the same problem, investigated, and decided that I will not use wheels for the time being.
In my opinion this is a bug in distutils. The PEP recommends to write
I guess we can hardcode the executable in the setup script but I'm not sure how this might affect existing users.
Sorry for the rant... but what do you think? Did you know about the
Also I'm not able to find documentation on
@mriehl question for you based on this:
It does assume the use of pip or a similar installer but here's the deal - you can't install a wheel without pip or a similar tool to begin with. And pip already does a proper rewrite, I believe.
Setuptools, however, does rewrite the shebang for wheel only.
We have a bug how we package as the order of invocation of setup tools matters.
However if you clean again and run
referenced this issue
Nov 13, 2015
That's true, but my point is that if I get the project sources and try to run the file (which should always work, IMHO) it won't run because the shebang is broken. So the app is broken unless I actually install it.