-
-
Notifications
You must be signed in to change notification settings - Fork 199
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BadZipFile error while installing via pip #534
Comments
Thanks for opening your first issue at git-cliff! Be sure to follow the issue template! ⛰️ |
Have tried 2.1.2 and 2.1.1 both Have also tried 2.0.4 |
Also got a collegue who has tried on his windows machine and he gets the same
|
Another collegue has tried on this mac (still python 3.10.6) and it installs fine, so this seems to only be a windows issue.. |
Also seems to install fine on windows under WSL (Ubuntu) but not natively |
Also, I have manually downloaded the whl from pypi this morning and tried to isntall that, same issue
|
I was able to install this globally using |
Hey, thanks for sharing your findings! I would like to ping @radusuciu who authored the PyPI workflow for installing via pip. Maybe he knows something. I'm curious about how did you get the zip file for Windows. I tried |
you rang? I can take a look. I've been using the pypi package in a few projects without issues but it's all been Linux or WSL. I would also suspect that maturin might be involved.. |
I can confirm that this happens on Windows 10 with Python 3.11.8 and will add that
I see the same CRC-32 error when attempting to install 2.1.2, 2.1.1, and 2.0.3. Together with 2.0.2 and 2.0.4 these represent all of the available releases of |
That's weird, there were no significant changes between those versions. But maybe something changed in maturin? 👀 |
Guessing this is the culprit: Line 2 in 16bea51
I was way too specific in pinning this version of maturin. There's been a 1.0 release since then so I'm going to test locally if this creates an installable wheel. |
Alright, so unfortunately it's not so simple. I installed the same version of maturin (0.14.7) on my Windows 10 workstation and was able to build ( |
I see, should we expect it to be fixed after #539? |
Glad this has helped, I would much prefer to install via the project deps than have to have people install on their mac/win using wget/brew... @orhun I just downloaded the wheel file manually via the pypi webpage and tried to install using pip add "pathtowheel" and the whl can be opened in any zip program, i used peazip, but you gett he same crc issue... glad it looks like this might go soemwehre and get fixed, thanks for your help guys.. |
I'm not 100% since I could not reproduce the failure locally, but I did verify that the wheels generated in my hacked (removed a few irrelevant jobs) fork are installable on my Windows computer. Relevant job: https://github.com/radusuciu/git-cliff/actions/runs/8182476507/job/22373882202 To avoid this problem in the future, it might be good to build wheels during CI and test whether they can be installed at least. Alternatively it could be added as another CD step during the pre-release process. |
I think it is a good idea to build wheels during CI to make sure everything works before creating a release. Are you possibly interested in making a PR? 🐻 |
yes I can give it a shot. Two questions:
|
I think duplication is fine - let's have the basic checks and then we can worry about refactoring it 🐻 Yup, we can place it in |
@radusuciu I have downloaded and tested your artifact this morning and all seems to be well... I used poetry and tried to install using that and did...get and error...
But then tried with pip in my poetry env and it worked ok.
And was able to build changelog, so def progress, I will have a play today and see if I can understand why poetry couldn't install, as I quite often install direct from wheels and it works fine.. thanks for your help/work |
I think I know the error here and can test this afternoon. Thanks for the feedback! |
@karl0ss can you please share the First attempting to add without a > poetry add .\git_cliff-2.1.6-py3-none-win_amd64.whl
Poetry could not find a pyproject.toml file in C:\Users\radu\scratch\test or its parents Then, after > poetry add .\git_cliff-2.1.6-py3-none-win_amd64.whl
Updating dependencies
Resolving dependencies... (0.1s)
Package operations: 1 install, 0 updates, 0 removals
- Installing git-cliff (2.1.6 C:/Users/radu/scratch/test/git_cliff-2.1.6-py3-none-win_amd64.whl)
Writing lock file The resultant
|
@radusuciu I spoke with the poetry team today, and i'm not sure its your issue, they stated "the issue is that the pkginfo version that is installed does not support metadata version 2.3" They gave me a command to upadte pkginfo in my pipx env to test, but I wont get around to trying that on monday, I also see they pushed the upversioned dep onto main today, so I guess it will be officially supported in coming poetry version. python-poetry/poetry#9130 |
I guess I must have a different version of pkginfo since I'm testing on 3.11? If there's something we can tweak in the |
I'm not 100% on that, but if the wheel gets published, I can try install it and see if it works, if not then it looks like updating as they said would work, or using the latest with 3.11 would work as you said..thanks for looking into all of this.. |
Yup, I can probably release a minor version pretty soon. |
I created RC release on Test PyPi - @karl0ss can you test it if you have the chance? I think I will create |
Looks like the Maturin workflow failed: https://github.com/orhun/git-cliff/actions/runs/8412795467/job/23034491981
@radusuciu can you take a look? |
Odd.. I just got back from a trip but I'll review the log after work and let you know. |
I looked into this last night but couldn't figure out what happened. FWIW we can download the artifacts from the latest |
I took a look as well and nothing stands out. I have also verified that the wheel is installable on my Windows system so that's good at least. I'll attempt to debug the publishing issue in a fork. |
Thank you! 🙏🏼 It's the only thing that's blocking the release rn. |
So my release worked. Here it is on TestPyPi. Please ignore the version number, that's just a result of me hacking at it until I could push it through. Things I chopped off include: NPM, deb, RPM, cargo, and homebrew publishing.. but perhaps most relevant given the Needs a bit more thought here. Btw, I might suggest skipping the pypi release for v2.2.0 if you just want to get the release out. We can catch up again on 2.2.1 |
Hmm, weird. Normally signing shouldn't affect the PyPI release but maybe there is some hidden magic going on somewhere. I will release another RC for testing it again and if it doesn't work then I think I will just disable PyPI releases until we figure things out. Thanks for debugging it! |
To confirm my guess, I could add back that step (setting the necessary secrets) and verify that the pypi publish step fails, and then we can go from there. |
Sounds good, let's do that |
Created @karl0ss can you test the latest version from PyPI and see if the error still happens? |
Oh no, a heisenbug! |
Sorry guys, I have been sick, but I am back now... Sadly, I seem to still be getting the same issue with 2.2.0 that is on pypi at the moment, not too sure what is going on, I have even update my python to 3.10.6 since (was running on 3.8)
|
@karl0ss can you confirm that you get the issue just with |
Corrupted Archive. $ VERSION=2.2.0
$ wget https://files.pythonhosted.org/packages/py3/g/git_cliff/git_cliff-${VERSION}-py3-none-win_amd64.whl
‘git_cliff-2.2.0-py3-none-win_amd64.whl’ saved [6614980/6614980]
$ python -m zipfile --extract git_cliff-${VERSION}-py3-none-win_amd64.whl tmp
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/usr/lib/python3.11/zipfile.py", line 2581, in <module>
main()
File "/usr/lib/python3.11/zipfile.py", line 2548, in main
zf.extractall(curdir)
File "/usr/lib/python3.11/zipfile.py", line 1693, in extractall
self._extract_member(zipinfo, path, pwd)
File "/usr/lib/python3.11/zipfile.py", line 1748, in _extract_member
shutil.copyfileobj(source, target)
File "/usr/lib/python3.11/shutil.py", line 197, in copyfileobj
buf = fsrc_read(length)
^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/zipfile.py", line 957, in read
data = self._read1(n)
^^^^^^^^^^^^^^
File "/usr/lib/python3.11/zipfile.py", line 1047, in _read1
self._update_crc(data)
File "/usr/lib/python3.11/zipfile.py", line 975, in _update_crc
raise BadZipFile("Bad CRC-32 for file %r" % self.name)
BadZipFile: Bad CRC-32 for file 'git_cliff-2.2.0.data/scripts/git-cliff-completions.exe'
$ unzip git_cliff-${VERSION}-py3-none-win_amd64.whl -d tmp2
Archive: git_cliff-2.2.0-py3-none-win_amd64.whl
inflating: tmp2/git_cliff-2.2.0.dist-info/METADATA
inflating: tmp2/git_cliff-2.2.0.dist-info/WHEEL
inflating: tmp2/git_cliff-2.2.0.data/scripts/git-cliff-completions.exe bad CRC d7dfc6e8 (should be 5bffd430)
inflating: tmp2/git_cliff-2.2.0.data/scripts/git-cliff-mangen.exe
inflating: tmp2/git_cliff-2.2.0.data/scripts/git-cliff.exe
inflating: tmp2/git_cliff-2.2.0.dist-info/RECORD
$ rg git-cliff-completions tmp2/git_cliff-${VERSION}.dist-info/RECORD
3:git_cliff-2.2.0.data/scripts/git-cliff-completions.exe,sha256=KoEd4HiAfgAKFJSRQXjHVlZB9eLsrLWL3z2MCrYL_L4,1998848
$ openssl dgst -sha256 -binary tmp2/git_cliff-${VERSION}.data/scripts/git-cliff-completions.exe | openssl base64
cR/TpY82IhyfYz47UO/fxsECvcnRUk08JXXlBdV7Ero= All $ VERSION=1.4.0
$ wget https://files.pythonhosted.org/packages/py3/g/git_cliff/git_cliff-${VERSION}-py3-none-win_amd64.whl
‘git_cliff-1.4.0-py3-none-win_amd64.whl’ saved [4159693/4159693]
$ python -m zipfile --extract git_cliff-${VERSION}-py3-none-win_amd64.whl tmp
$ unzip git_cliff-${VERSION}-py3-none-win_amd64.whl -d tmp2
Archive: git_cliff-1.4.0-py3-none-win_amd64.whl
inflating: tmp2/git_cliff-1.4.0.dist-info/METADATA
inflating: tmp2/git_cliff-1.4.0.dist-info/WHEEL
inflating: tmp2/git_cliff-1.4.0.data/scripts/git-cliff-completions.exe
inflating: tmp2/git_cliff-1.4.0.data/scripts/git-cliff-mangen.exe
inflating: tmp2/git_cliff-1.4.0.data/scripts/git-cliff.exe
inflating: tmp2/git_cliff-1.4.0.dist-info/RECORD
$ rg git-cliff-completions tmp2/git_cliff-${VERSION}.dist-info/RECORD
3:git_cliff-1.4.0.data/scripts/git-cliff-completions.exe,sha256=HzohwMyVLQQZVJng8RzDWo1orTJfl0nHAQie0K3_8-E,620544
$ openssl dgst -sha256 -binary tmp2/git_cliff-${VERSION}.data/scripts/git-cliff-completions.exe | openssl base64
HzohwMyVLQQZVJng8RzDWo1orTJfl0nHAQie0K3/8+E= |
https://github.com/orhun/git-cliff/actions/runs/8491060435 The I don't know where $ find . -type f -exec sha256sum {}
201db433a945a7502cf4f6e487044c1dae911336e55babd0d02147483851fd6a ./pypi/git_cliff-2.2.0.dist-info/METADATA
e0d67ecd3747a0f9fadeeff14da771270862326289eeb949f6772e96aea7efe6 ./pypi/git_cliff-2.2.0.dist-info/WHEEL
8f1c58ea8c9a3f5cccd171beac989de62da7e11c2137107a9ab34d2e2ac02c6c ./pypi/git_cliff-2.2.0.dist-info/RECORD
711fd3a58f36221c9f633e3b50efdfc6c102bdc9d1524d3c2575e505d57b12ba ./pypi/git_cliff-2.2.0.data/scripts/git-cliff-completions.exe
dca0f554e1010708963d3a4e0c71f196639d3376c68cda62cf8286fe3195ab45 ./pypi/git_cliff-2.2.0.data/scripts/git-cliff-mangen.exe
5fec7ed499486e433c889efd55e8d3b748301cc4a966e1501acdb5e1d05ea8ac ./pypi/git_cliff-2.2.0.data/scripts/git-cliff.exe
201db433a945a7502cf4f6e487044c1dae911336e55babd0d02147483851fd6a ./wheels-x86_64-pc-windows-msvc/git_cliff-2.2.0.dist-info/METADATA
e0d67ecd3747a0f9fadeeff14da771270862326289eeb949f6772e96aea7efe6 ./wheels-x86_64-pc-windows-msvc/git_cliff-2.2.0.dist-info/WHEEL
8f1c58ea8c9a3f5cccd171beac989de62da7e11c2137107a9ab34d2e2ac02c6c ./wheels-x86_64-pc-windows-msvc/git_cliff-2.2.0.dist-info/RECORD
2a811de078807e000a1494914178c7565641f5e2ecacb58bdf3d8c0ab60bfcbe ./wheels-x86_64-pc-windows-msvc/git_cliff-2.2.0.data/scripts/git-cliff-completions.exe
dca0f554e1010708963d3a4e0c71f196639d3376c68cda62cf8286fe3195ab45 ./wheels-x86_64-pc-windows-msvc/git_cliff-2.2.0.data/scripts/git-cliff-mangen.exe
5fec7ed499486e433c889efd55e8d3b748301cc4a966e1501acdb5e1d05ea8ac ./wheels-x86_64-pc-windows-msvc/git_cliff-2.2.0.data/scripts/git-cliff.exe
201db433a945a7502cf4f6e487044c1dae911336e55babd0d02147483851fd6a ./wheels-x86_64-pc-windows-gnu/git_cliff-2.2.0.dist-info/METADATA
e0d67ecd3747a0f9fadeeff14da771270862326289eeb949f6772e96aea7efe6 ./wheels-x86_64-pc-windows-gnu/git_cliff-2.2.0.dist-info/WHEEL
b363d8db7f68b5f65f0a63fdbe781fa6cb4a3a5cc5cbfb026df3ba6bf3f857a0 ./wheels-x86_64-pc-windows-gnu/git_cliff-2.2.0.dist-info/RECORD
e95816287d3eed917e14f1ad480edbf87a8612b5a0f5459e7e03bcd231d60d6f ./wheels-x86_64-pc-windows-gnu/git_cliff-2.2.0.data/scripts/git-cliff-completions.exe
712c5c05b72fa3b5fc996cc31b1bcf8714292cb8b50afb7a24c9da16b136485b ./wheels-x86_64-pc-windows-gnu/git_cliff-2.2.0.data/scripts/git-cliff-mangen.exe
5bdf95d64be282af3d1935fadd6687e62f6a52ed73545eb2c290484d40338895 ./wheels-x86_64-pc-windows-gnu/git_cliff-2.2.0.data/scripts/git-cliff.exe --- a/pypi
+++ b/wheels-x86_64-pc-windows-msvc
@@ -1,6 +1,6 @@
201db433a945a7502cf4f6e487044c1dae911336e55babd0d02147483851fd6a ./git_cliff-2.2.0.dist-info/METADATA
e0d67ecd3747a0f9fadeeff14da771270862326289eeb949f6772e96aea7efe6 ./git_cliff-2.2.0.dist-info/WHEEL
8f1c58ea8c9a3f5cccd171beac989de62da7e11c2137107a9ab34d2e2ac02c6c ./git_cliff-2.2.0.dist-info/RECORD
-711fd3a58f36221c9f633e3b50efdfc6c102bdc9d1524d3c2575e505d57b12ba ./git_cliff-2.2.0.data/scripts/git-cliff-completions.exe
+2a811de078807e000a1494914178c7565641f5e2ecacb58bdf3d8c0ab60bfcbe ./git_cliff-2.2.0.data/scripts/git-cliff-completions.exe
dca0f554e1010708963d3a4e0c71f196639d3376c68cda62cf8286fe3195ab45 ./git_cliff-2.2.0.data/scripts/git-cliff-mangen.exe
5fec7ed499486e433c889efd55e8d3b748301cc4a966e1501acdb5e1d05ea8ac ./git_cliff-2.2.0.data/scripts/git-cliff.exe Apparently the error is somewhere at the Publish PyPI package stage. git-cliff/.github/workflows/cd.yml Lines 321 to 338 in 9864780
I can only note that Changes to |
Great analysis @DeadNews. Is this the only such collision that you saw? Here are two proposed solutions:
@orhun, does having |
Nope, not really. Those are there for the sake of "supporting more architectures". |
.....so....is this currently dead in the water re pypi distribution? as if this isn't going to get fixed "soon" I will need to rethink how I am planning on distrubuting this to my wider audience.. Thanks |
If I understood correctly, we can move forward with @radusuciu's suggestions above, right? |
I pushed f675b0b and planning to create a release soon, let's see |
Created |
It works. |
Will have a check today and get back to you, sorry for the delay, and thanks for all the help on this one... |
🥳 Can confirm that 2.2.2 seems to be working for me 😃 |
Awesome! Thanks for your patience and help with this @karl0ss @DeadNews @radusuciu 🚀 |
Is there an existing issue for this?
Description of the bug
Unable to install git-cliff via pip
Steps To Reproduce
Brand new python venv
Expected behavior
Git-Cliff should install
Screenshots / Logs
Software information
Additional context
No response
The text was updated successfully, but these errors were encountered: