LibraryOfCongress / bagit-python

Work with BagIt packages from Python.
http://libraryofcongress.github.io/bagit-python
216 stars 85 forks source link

Homebrew shebang in the package on PyPI #116

Closed jonassvatos closed 5 years ago

jonassvatos commented 5 years ago

Hi, there is a shebang from Homebrew in the script in the bagit.py package downloaded from PyPI. This effectivelly breaks the functionality if not run from within Homebrew, like other POSIX systems, Windows, non-homebrew OSX etc..

$ diff bagit.py bagit-1.7.0.data/scripts/bagit.py 
1c1
< #!/usr/bin/env python
---
> #!/usr/local/opt/python@2/bin/python2.7
cat bagit-1.7.0.dist-info/RECORD 
bagit.py,sha256=MvoFUMBP7sS4AjIT5hR9ktF7bKfHqvQdbsqDfXKn_zQ,54756
bagit-1.7.0.data/data/locale/en/LC_MESSAGES/bagit-python.mo,sha256=sLgIsf2Q1e6b4zTOHgfaC5zlZLGp4mTfYRb8PkUco2k,2849
bagit-1.7.0.data/scripts/bagit.py,sha256=x51j6TtA2AFzJOhghKQW5sxTot-lRAreOjOd72YkqKs,54774
bagit-1.7.0.dist-info/METADATA,sha256=qhxnDsxtmVTjSp5VO9xLAcVNTIXjewaK0OtlKj5zkBA,8077
bagit-1.7.0.dist-info/RECORD,,
bagit-1.7.0.dist-info/WHEEL,sha256=gduuPyBvFJQSQ0zdyxF7k0zynDXbIbvg5ZBHoXum5uk,110
bagit-1.7.0.dist-info/top_level.txt,sha256=f288ippe7ERSzETsEftza1dXq61Z4zFSXDgaTF6djpE,6

Even the hashes and filesizes are different..perhaps a manual PyPI push from the Homebrew environment? I would suggest to create an os-independent Wheel..that's why we write tools in Python, right? :)

But other than this, thanks for all the great work!

acdha commented 5 years ago

Looks like something changed to cause bdist_wheel to include the shebang. I've deleted the wheel entirely since the source install is almost as fast.

acdha commented 5 years ago

That's really odd: bdist_wheel does not generate an archive including a shebang when rerun from the same source folder using the same version. I'm not sure what caused that last time but I'll have to check it next time we do a release.

jonassvatos commented 5 years ago

Right, now it works well without the wheel. Let's hope it was just once-in-a-lifetime glitch in the release process.. :)

Closing this now..