From 33a77a16286a313f92e5975d7f5d099018c54daf Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 29 Aug 2024 10:17:55 -0400 Subject: [PATCH] Ignore pre-release segments when discovering via requires-python --- crates/uv-python/src/discovery.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/uv-python/src/discovery.rs b/crates/uv-python/src/discovery.rs index f0b4876ac5d7..9158d9837ab2 100644 --- a/crates/uv-python/src/discovery.rs +++ b/crates/uv-python/src/discovery.rs @@ -1441,7 +1441,10 @@ impl VersionRequest { interpreter.python_patch(), ) == (*major, *minor, *patch) } - Self::Range(specifiers) => specifiers.contains(interpreter.python_version()), + Self::Range(specifiers) => { + let version = interpreter.python_version().only_release(); + specifiers.contains(&version) + } } }