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
==0.1.* doesn't match 0.1+upstream.2 #41
Comments
Some notes from when I was testing this: >> import packaging.specifiers
>>> packaging.specifiers.SpecifierSet("~=0.1.0").contains("0.1+upstream.2")
False
>>> packaging.specifiers.SpecifierSet(">=0.1.0,==0.1.*").contains("0.1+upstream.2")
False
>>> packaging.specifiers.SpecifierSet(">=0.1.0").contains("0.1+upstream.2")
True
>>> packaging.specifiers.SpecifierSet("==0.1.*").contains("0.1+upstream.2")
False
>>> packaging.specifiers.SpecifierSet("==0.*").contains("0.1+upstream.2")
True
>>> packaging.specifiers.SpecifierSet("==0.1.*").contains("0.1+upstream.2")
False
>>> packaging.specifiers.SpecifierSet("==0.1.0.*").contains("0.1+upstream.2")
False It appears as if we do this correctly when We might also want to double check PEP 440 to make sure that this particular use case is clearly defined. |
Oh, and for completeness sake: >>> packaging.specifiers.SpecifierSet("==0.1.*").contains("0.1")
True |
While I'm thinking about this, it would also be nice to be able to have requirements be able to match against upstream versions. |
Double checking PEP 440, I see why that doesn't work:
I don't recall exactly why we did that, I think it was likely to prevent (or discourage) people from uploading things to PyPI that had a dependency on a particular local version. In fact, the PEP disallows local versions like that in all specifiers except for |
Oh, to be clear, changing the behavior of |
The |
As in the title,
==0.1.*
doesn't match the version0.1+upstream.2
. I discovered this as a result of specifying a requirement~=0.1.0
, and getting0.1
instead of0.1+upstream.2
. I can produce a reproducing example if necessary.The text was updated successfully, but these errors were encountered: