pypa / python-manylinux-demo

Demo project for building Python wheels for Linux with Travis-CI
Creative Commons Zero v1.0 Universal
226 stars 90 forks source link

scripts are set to "funny" paths #18

Open vanrein opened 5 years ago

vanrein commented 5 years ago

After building a few wheels with python setup.py and again with pip wheel as in these demo scripts, I found that executable scripts are "cleverly" manipulated on their first line which is set to things like

#!/opt/python/cp27-cp27m/bin/python

This is indeed documented, but the proposed work-around with --executable is not. The original actually said #!/usr/bin/env python which is more portable than what is put in this line...

It is wrong, anyway. If the first line is replaced, then this should not be done with the building platform's hash-bang, but with the target platform's. When I installed one of the wheels from PyPi on another system, this path was indeed still being used (but Python not found there, of course).

Not sure if this is a problem in your code or in setuptools, because the latter lacks in documentation. I'm effectively stuck publishing my packages due to this, so any advise is welcome.

You can see my setup.py if you want.

njsmith commented 5 years ago

IIUC there are supposed to be two options for putting scripts in wheels:

I'd suggest asking in either the setuptools or the packaging-problems trackers, a lot more people look at those than this one.

vanrein commented 5 years ago

Thank you kindly, Nathaniel!

It's difficult to get into as setuptools only covers basic uses in its documentation, but you're pointing me to some corners I thought wouldn't work. If needed, I will happily follow the alternative pointers you gave.

It sounds like this is not a manylinux1-specific problem then.

Cheers, -Rick