Skip to content
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

Invalid wheel: pip OK but uv KO #2149

Closed
AntoineD opened this issue Mar 4, 2024 · 7 comments · Fixed by #2170
Closed

Invalid wheel: pip OK but uv KO #2149

AntoineD opened this issue Mar 4, 2024 · 7 comments · Fixed by #2170
Assignees
Labels
bug Something isn't working compatibility Compatibility with a specification or another tool

Comments

@AntoineD
Copy link

AntoineD commented Mar 4, 2024

Hello,

when trying to install the package openturns, which is installable with pip, I get the following error

❯ uv pip install openturns   
Resolved 3 packages in 351ms
error: Failed to install: openturns-1.22-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (openturns==1.22)
  Caused by: The wheel is invalid: Line 3 of the WHEEL file is invalid

This is the contents of WHEEL:

❯ cat openturns-1.22.dist-info/WHEEL
Wheel-Version: 1.0
Generator: custom
Root-Is-Purelib: false
Tag: 
Tag: -manylinux_2_17_x86_64
Tag: -manylinux2014_x86_64

Is this issue on uv's side?

@pfmoore
Copy link
Contributor

pfmoore commented Mar 4, 2024

Pip doesn't check the WHEEL file as far as I'm aware, so it looks like uv is being more strict here. But line three (which is what the error points to) is Root-Is-Purelib: false, which is fine. The Tag lines, though, are invalid - an empty Tag isn't valid, and the other two tags seem incomplete (should be cp312-cp312-manylinux2014_x86_64 and cp312-cp312-manylinux_2_17_x86_64).

konstin added a commit that referenced this issue Mar 4, 2024
Fixes an off-by-one from #2149. `enumerate` is zero-based, human line numbers are one based.
konstin added a commit that referenced this issue Mar 4, 2024
Fixes an off-by-one from #2149. `enumerate` is zero-based, human line numbers are one based.
@konstin
Copy link
Member

konstin commented Mar 4, 2024

Sorry that's just an off-by-one error separate from this issue, fixed in #2151.

konstin added a commit that referenced this issue Mar 4, 2024
Fixes an off-by-one from #2149. `enumerate` is zero-based, human line
numbers are one based.
@charliermarsh charliermarsh added compatibility Compatibility with a specification or another tool needs-decision Undecided if this should be done labels Mar 4, 2024
@zanieb
Copy link
Member

zanieb commented Mar 4, 2024

Is the alternative here that we ignore all invalid tag entries?

@pfmoore
Copy link
Contributor

pfmoore commented Mar 4, 2024

Pip just uses the tags from the wheel filename. The WHEEL file is1 simply duplicating that information, so we just don't bother reading it. If you're using what's in the WHEEL file rather than what's in the filename, then you're going to have to deal with the fact that there might be garbage in there that's never been noticed before, precisely because pip never cared and nobody else bothered validating the data.

Footnotes

  1. Or at least should be 🙁

@konstin
Copy link
Member

konstin commented Mar 4, 2024

Thanks for the context! I think we should only warn about invalid WHEEL files then.

@charliermarsh
Copy link
Member

Yeah I don't think we use the information, but we do seem to validate it. I actually don't think we even validate the tags, we just choke if the value is empty AFAICT.

@charliermarsh charliermarsh added bug Something isn't working and removed needs-decision Undecided if this should be done labels Mar 4, 2024
@charliermarsh charliermarsh self-assigned this Mar 4, 2024
@charliermarsh
Copy link
Member

I'll fix this real quick.

charliermarsh added a commit that referenced this issue Mar 4, 2024
## Summary

Closes #2149.

## Test Plan

`cargo run pip install "openturns==1.22"`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working compatibility Compatibility with a specification or another tool
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants