Skip to content

Commit

Permalink
Prefer more recent minor versions in wheel tags
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Mar 7, 2024
1 parent b061db0 commit 5c6c3d1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/platform-tags/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ impl Tags {
/// Tags are prioritized based on their position in the given vector. Specifically, tags that
/// appear earlier in the vector are given higher priority than tags that appear later.
pub fn new(tags: Vec<(String, String, String)>) -> Self {
println!("{:#?}", tags);
let mut map = FxHashMap::default();
for (index, (py, abi, platform)) in tags.into_iter().rev().enumerate() {
map.entry(py.to_string())
Expand Down Expand Up @@ -113,7 +114,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)),
Expand All @@ -124,7 +125,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),
Expand All @@ -142,7 +143,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(),
Expand Down

0 comments on commit 5c6c3d1

Please sign in to comment.