Fix Python version resolution for exact patch version matches#17828
Closed
jonathan-fulton wants to merge 1 commit intoastral-sh:mainfrom
Closed
Fix Python version resolution for exact patch version matches#17828jonathan-fulton wants to merge 1 commit intoastral-sh:mainfrom
jonathan-fulton wants to merge 1 commit intoastral-sh:mainfrom
Conversation
…-sh#16175) The prerelease filtering for MajorMinorPatch version requests was inconsistent with Range version matching behavior. When a user requested a specific version like 3.14.0, the code would reject 3.14.0rc3 even if no stable release was available. This change removes the strict prerelease rejection for exact patch version matches, making behavior consistent with range matching which already handles prereleases appropriately. This allows users to get prerelease versions when requesting specific versions if no stable release is available, which is the expected behavior during Python's prerelease cycles. Fixes astral-sh#16175
Member
|
The issue you link to is already closed and I'm not sure what the motivation is for this change. We intentionally made this change in #16210 and I think the way that you've described the current behavior makes sense to me? Can you please open an issue describing the use-case as a starting point? |
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #16175
The prerelease filtering for
MajorMinorPatchversion requests was inconsistent withRangeversion matching behavior. When a user requested a specific version like3.14.0, the code would reject3.14.0rc3even if no stable release was available.Changes
Removed the strict prerelease rejection for exact patch version matches in
crates/uv-python/src/discovery.rs.Rationale
This makes behavior consistent with range matching which already handles prereleases appropriately. During Python's prerelease cycles (like Python 3.14), users should be able to request specific versions and get prerelease versions if no stable release is available yet.
The previous behavior was overly strict and inconsistent with how range specifications work:
>=3.14would match3.14.0rc3✓3.14.0would NOT match3.14.0rc3✗After this change, both behave consistently.
Test Plan