-
Notifications
You must be signed in to change notification settings - Fork 250
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
Specifier <
that contains prerelease version does not match on valid prerelease versions
#788
Comments
<
that contains prerelease version does not match on valid prerelease versions
Interestingly the spec talks about >>> Specifier('>3.0.0post1').contains("3.0.0post2")
True However, unless I am missing it, the spec fails to mention how to handle |
Personally I don’t see how those combinations should be treated differently from those explicitly mentioned in the spec. |
In that case the common theme is that packaging is violating the spec for prereleases, but not for postreleases: >>> Specifier('>3.0.0a8').contains("3.0.0a9")
False
>>> Specifier('<3.0.0post2').contains("3.0.0post1")
True |
Reading over the spec, it seems the change is a reasonable one. @pradyunsg are you good w/ making this work? #794 looks to do the right thing and I think we should merge it, but I want to give you a chance to concur/disagree. |
Let's do this. |
This relates to this part of the spec:
So, for example,
<3.0.0a8
is a prerelease specifier, and therefore falls under "unless the specified version is itself a pre-release", I would expect it to then "Allowing pre-releases that are earlier than, but not equal to a specific pre-release", for example3.0.0a7
.However that does not appear to be the case:
This came up in astral-sh/uv#2646 and I'm aware of the comment #776 (comment), but the spec seems very explicit and even gives an examples that
<
allows prereleases when the version itself is a prerelease.The text was updated successfully, but these errors were encountered: