Special-case == Python version request ranges (#9697)

Related to https://github.com/astral-sh/uv/issues/9695

Doesn't solve the reported issue with `requires-python` because that
doesn't go through the parser


https://github.com/astral-sh/uv/blob/6ed6fc108e95e742075cf1eddb09ec86c04f632e/crates/uv/src/commands/project/mod.rs#L518-L526
This commit is contained in:
Zanie Blue
2026-03-24 08:45:27 -05:00
committed by GitHub
parent f772f71b91
commit edb1744df6
2 changed files with 28 additions and 0 deletions
+5
View File
@@ -3324,6 +3324,11 @@ fn parse_version_specifiers_request(
if specifiers.is_empty() {
return Err(Error::InvalidVersionRequest(s.to_string()));
}
if let [specifier] = specifiers.iter().as_slice() {
if specifier.operator() == &uv_pep440::Operator::Equal {
return VersionRequest::from_str(&specifier.version().to_string());
}
}
Ok(VersionRequest::Range(specifiers, variant))
}