From 533c7e3bfd4974e081710e0023cf1b1a5147061a Mon Sep 17 00:00:00 2001 From: Zanie Blue Date: Tue, 10 Sep 2024 13:34:18 -0500 Subject: [PATCH] Drop Python version range enforcement from `PythonVersion::from_str` (#7264) This caused some problems earlier, as it prevented us from _listing_ Python versions <3.7 which seems weird (see https://github.com/astral-sh/uv/pull/7131#issuecomment-2334929000) I'm worried that without this the changes to installation key parsing in https://github.com/astral-sh/uv/pull/7263 would otherwise be too restrictive. I think if we want to enforce these ranges, we should do so separately from the parse step. --- crates/uv-python/src/python_version.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/uv-python/src/python_version.rs b/crates/uv-python/src/python_version.rs index 07ee3edac..6c4a99487 100644 --- a/crates/uv-python/src/python_version.rs +++ b/crates/uv-python/src/python_version.rs @@ -31,12 +31,6 @@ impl FromStr for PythonVersion { if version.epoch() != 0 { return Err(format!("Python version `{s}` has a non-zero epoch")); } - if version.version < Version::new([3, 7]) { - return Err(format!("Python version `{s}` must be >= 3.7")); - } - if version.version >= Version::new([4, 0]) { - return Err(format!("Python version `{s}` must be < 4.0")); - } Ok(Self(version)) }