HearthSim / UnityPack

Python deserialization library for Unity3D Asset format
https://hearthsim.info/
MIT License
720 stars 153 forks source link

Wrong shebang in current Wheel on PyPI #33

Closed muellermartin closed 7 years ago

muellermartin commented 7 years ago

The current Wheel unitypack-0.7.1-py3-none-any.whl (MD5 70360240ba647c0353a0711f9cabb82e) on https://pypi.python.org/pypi/unitypack/0.7.1 uses #!/home/adys/.local/share/virtualenvs/hs/bin/python3 as shebang instead of the one used in the repository. This causes errors on UNIX-like systems (as Linux and macOS):

-bash: /usr/local/bin/unityextract: /home/adys/.local/share/virtualenvs/hs/bin/python3: bad interpreter: No such file or directory

Additionally I would also suggest to use #!/usr/bin/env python3 in the shebang (currently it is #!/usr/bin/env python).

Mactastic1-5 commented 7 years ago

It sounds like you're using a different version of Python.

muellermartin commented 7 years ago

@Stellarspace I think you misunderstood the issue or maybe I was not clear enough: On UNIX-like systems the first line is important as the kernel checks it for #! (the shebang) and the path to the interpreter to be used when it is executed and the executable bit is set (chmod +x). There are two tools supplied with UnityPack (bin/unity2yaml and bin/unityextract) for which this is important. In the repository the shebang is okay (#!/usr/bin/env python) but if you download the Wheel supplied on PyPI and extract it to look at the shebangs of the tools, you will see that they are set to #!/home/adys/.local/share/virtualenvs/hs/bin/python3. This is likely a path which a developer uses, but it does not generally work on other hosts as this clearly is not a standard path.

Edit: Maybe my additional request to use python3 instead just python in the shebang was confusing. I was asking this because on some Linux and macOS installations both python2 and python3 are installed and python commonly is linked to python2. Therefore I was also suggesting to use a more specific version in the shebang ;)

jleclanche commented 7 years ago

Weird setuptools behaviour... no idea why this happened.

jleclanche commented 7 years ago

Should be fixed in 0.7.2, reopen if it's still an issue.

muellermartin commented 7 years ago

Thanks for fixing this so fast! The tools now work for me but the shebang still differs from the one used in the repository (now it is #!/usr/local/opt/python3/bin/python3.6).

jleclanche commented 7 years ago

Yes, they get rewritten accordingly by your pip install, that's intended behaviour.

muellermartin commented 7 years ago

Ah okay, good to know!