From 4796927c4c61b2508c850c03d24f36647513e628 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Thu, 7 Mar 2024 06:04:54 -0800 Subject: [PATCH] Prefer more recent minor versions in wheel tags (#2263) ## Summary In the list of tags produced by `Tags::from_env`, higher-priority tags are expected to come earlier in the list. Right now, though, we push tags like `py38` before `py312`. So if you run `cargo run pip install multiprocess -n --reinstall --verbose` on Python 3.12, you get the `py38` wheel rather than the `py32` wheel. Closes https://github.com/astral-sh/uv/issues/2261. --- crates/platform-tags/src/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/platform-tags/src/lib.rs b/crates/platform-tags/src/lib.rs index efc7c49944a3..19212cdcc271 100644 --- a/crates/platform-tags/src/lib.rs +++ b/crates/platform-tags/src/lib.rs @@ -113,7 +113,7 @@ impl Tags { // 2. abi3 and no abi (e.g. executable binary) if matches!(implementation, Implementation::CPython) { // For some reason 3.2 is the minimum python for the cp abi - for minor in 2..=python_version.1 { + for minor in (2..=python_version.1).rev() { for platform_tag in &platform_tags { tags.push(( implementation.language_tag((python_version.0, minor)), @@ -124,7 +124,7 @@ impl Tags { } } // 3. no abi (e.g. executable binary) - for minor in 0..=python_version.1 { + for minor in (0..=python_version.1).rev() { for platform_tag in &platform_tags { tags.push(( format!("py{}{}", python_version.0, minor), @@ -142,7 +142,7 @@ impl Tags { )); } // 5. no binary - for minor in 0..=python_version.1 { + for minor in (0..=python_version.1).rev() { tags.push(( format!("py{}{}", python_version.0, minor), "none".to_string(),