You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello 🙂 First let me thank you for this awesome project !! ❤️
The issue
By using uv, I somehow managed to find a strange behaviour in wheel installations.
Indeed, on Linux, I was not able to install the ziglang package with uv.
Here is the error message:
(fixeduv) root@871e96b7ad46:/uv# uv pip install ziglangResolved 1 package in 225mserror: Failed to install: ziglang-0.13.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.http.whl (ziglang==0.13.0) Caused by: The wheel is invalid: Line 5 of the WHEEL file is invalid
Meanwhile, pip can totally install it.
We can directly see that the tag value is containing a linesep and two spaces. So we could say that the wheel is indeed invalid, and uv is not to blame here. But the fact is that pip is installing the wheel without any issue...
So I deduced that the WHEEL and METADATA files should be generated with email headers syntax.
Furthermore, by looking at the source code of uv and pip, we can also see that the Tag field is totally useless and not read, because both are fetching the tag from the wheel filename. So this issue is only a parsing file method issue.
But then I was then wondering, what could be the reason making uv maintainers not using the same parsing method ? For sure the PEP specification fo the wheels should tell that we need to use email messages formats right ?
But the PEP is in fact only talking about basic key value format
I should probably contact them in order to have their opinion! 😄
Solution
I think the solution here is pretty simple : let's use the same parsing method as pip, which is parsing these file as email messages! 🚀 uv needs to be as fast as possible, so I found the mail_parser crate
And the test runs as fast as the previous parsing method, sometimes even faster.
I will linked the pull-request #6616: waiting for your opinion! 😊
I also added a unit test for this specific use case.
Here is the result:
(fixeduv) root@871e96b7ad46:/uv# uv pip install ziglangResolved 1 package in 225mserror: Failed to install: ziglang-0.13.0-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.musllinux_1_1_aarch64.http.whl (ziglang==0.13.0) Caused by: The wheel is invalid: Line 5 of the WHEEL file is invalid(fixeduv) root@871e96b7ad46:/uv# ./target/release/uv pip install ziglangResolved 1 package in 3msInstalled 1 package in 177ms + ziglang==0.13.0(fixeduv) root@871e96b7ad46:/uv# uname -aLinux 871e96b7ad46 6.8.11-300.fc40.aarch64 #1 SMP PREEMPT_DYNAMIC Mon May 2715:22:03 UTC 2024 aarch64 GNU/Linux
Thanks !!! I am open to anything if needed, first contribution on this awesome project here 😄
The text was updated successfully, but these errors were encountered:
Coruscant11
changed the title
Some wheel can not be installed with uv contrary to pip, like ziglang
Some packages can not be installed with uv contrary to pip, like ziglangAug 25, 2024
## Summary
Fixes: #6615
Currently, some packages are not installable with `uv`, like `ziglang`
on Linux.
Everything is described in the issue! 😄
<!-- What's the purpose of the change? What does it do, and why? -->
## Test Plan
<!-- How was it tested? -->
I added a unit test for the problematic use case.
I also checked that previous unit test are still running in order to
ensure the backward compatibility.
Hello 🙂 First let me thank you for this awesome project !! ❤️
The issue
By using
uv
, I somehow managed to find a strange behaviour in wheel installations.Indeed, on Linux, I was not able to install the
ziglang
package withuv
.Here is the error message:
The cause
So I looked at the
WHEEL
file content:Meanwhile, pip can totally install it.
We can directly see that the tag value is containing a linesep and two spaces. So we could say that the wheel is indeed invalid, and
uv
is not to blame here. But the fact is that pip is installing the wheel without any issue...So i looked at the source code of
uv
andpip
. And I discovered that the parsing method was not the same.While uv is using a simple key value text file parsing method,
pip
is usingemail.message_from_file
function from the python standard library, as you can see here.But not only uv, bdist_wheel too
So I deduced that the
WHEEL
andMETADATA
files should be generated with email headers syntax.Furthermore, by looking at the source code of
uv
andpip
, we can also see that theTag
field is totally useless and not read, because both are fetching the tag from the wheel filename. So this issue is only a parsing file method issue.But then I was then wondering, what could be the reason making uv maintainers not using the same parsing method ? For sure the PEP specification fo the wheels should tell that we need to use email messages formats right ?
But the PEP is in fact only talking about basic key value format
I should probably contact them in order to have their opinion! 😄
Solution
I think the solution here is pretty simple : let's use the same parsing method as
pip
, which is parsing these file as email messages! 🚀uv
needs to be as fast as possible, so I found the mail_parser crateAnd the test runs as fast as the previous parsing method, sometimes even faster.
I will linked the pull-request #6616: waiting for your opinion! 😊
I also added a unit test for this specific use case.
Here is the result:
Thanks !!! I am open to anything if needed, first contribution on this awesome project here 😄
The text was updated successfully, but these errors were encountered: