Prefer stable releases over pre-releases in uv python install (#12194)

e.g., `uv python install 3` should not install the 3.14 alpha

Closes #12184
This commit is contained in:
Zanie Blue
2025-04-21 16:16:07 -05:00
committed by GitHub
parent c55dd0f295
commit 9484e3663c
4 changed files with 116 additions and 9 deletions
+3 -3
View File
@@ -2294,9 +2294,9 @@ impl VersionRequest {
match self {
Self::Default => false,
Self::Any => true,
Self::Major(..) => true,
Self::MajorMinor(..) => true,
Self::MajorMinorPatch(..) => true,
Self::Major(..) => false,
Self::MajorMinor(..) => false,
Self::MajorMinorPatch(..) => false,
Self::MajorMinorPrerelease(..) => true,
Self::Range(specifiers, _) => specifiers.iter().any(VersionSpecifier::any_prerelease),
}