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

Parens in metadata version specifiers #551

Closed
jaklaassen-affirm opened this issue Aug 4, 2023 · 4 comments · Fixed by #552
Closed

Parens in metadata version specifiers #551

jaklaassen-affirm opened this issue Aug 4, 2023 · 4 comments · Fixed by #552

Comments

@jaklaassen-affirm
Copy link

The packaging spec says that Requires-Dist specifiers should not have parens, but wheel add the parens here.

I ran into this problem because of a super edge case installing a wheel that has exact identity (===) dependencies. Pip allows any character after an the identity specifier, which means that it also captures the closing paren and so a requirement like requests (===1.2.3) won't match. The identity specifiers are used for prereleases and some other special-case version specifiers.

@henryiii
Copy link
Contributor

henryiii commented Aug 4, 2023

Looks like it says:

A version specifier. Tools parsing the format should accept optional parentheses around this, but tools generating it should not use parentheses.

So the parentheses shouldn’t be generated but should still be accepted.

@jaklaassen-affirm
Copy link
Author

jaklaassen-affirm commented Aug 4, 2023

Agreed, and this is imo both a pip and a wheel bug. The wheel bug is arguably not because it still should work according to the spec. The pip bug just looked harder to fix given the implementation, but I didn't check whether their vendored copy of packaging was out of date. And indeed it is. Packaging has switched from a regex-only to a tokenizing parser that successfully handles the identity requirements in parens. So pip just needs to update the vendored version. Although that appears to be quite complicated.

@agronholm
Copy link
Contributor

I'm ready to cut a new release once the linked PR is okayed.

@agronholm
Copy link
Contributor

Released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants