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

Fix prefix version matching #562

Closed
wants to merge 2 commits into from
Closed

Conversation

mayeut
Copy link
Member

@mayeut mayeut commented Jun 18, 2022

Use a different padding depending on the specifier having a pre-release/post-release segment or not in order to get the correct shortened prospective version.

fix #559
fix #425

Draft while waiting for confirmation of the intended behavior in https://discuss.python.org/t/pep-440-clarification-on-prefix-version-matching-with-pre-release-post-release-segments/16622
Builds on top of #561

@brettcannon
Copy link
Member

I noticed this is in draft but #563 isn't. Does that mean we should close this one and review the other PR?

@mayeut
Copy link
Member Author

mayeut commented Aug 21, 2022

@brettcannon,
I kept this one opened as a draft in case there was a change of mind regarding forbidding pre/post release segments in specifiers as implemented in #563
You can disregard it for now, sorry if it added some noise. It will be closed if #563 gets merged, otherwise I'll rework it and mark it ready for review.

@brettcannon
Copy link
Member

@mayeut no need to apologize! As you can see I'm trying to go through the PR queue here and I'm needing to build context again since it's been a while since I read up on the issue being dealt with. 😅

In case of prefix version matching, normalization of the version was not applied to the specifier's version.
This resulted in `2` being rejected as a candidate for `==0!2.*`
With normalization applied, the candidate is now accepted.
Use a different padding depending on the specifier having a pre-release/post-release segment or not in order to get the correct shortened prospective version.
@mayeut mayeut deleted the prefix-match-2 branch April 10, 2023 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: Specifier("==1.0.*") does not contain Version("1a1") Possible bug with wildcard version matching
2 participants