From c415251aa2cd0a45760eaeaeb61ff247df7c08f1 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Sun, 29 Sep 2024 12:05:15 -0400 Subject: [PATCH] Use file stem when parsing cached wheel names (#7773) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Summary I noticed that we were including `http` (the file extension) in the platform tags when reading from the cache: ![Screenshot 2024-09-28 at 9 40 15 PM](https://github.com/user-attachments/assets/d80ed351-1257-42b5-8292-0b11a50c767d) Probably harmless, but wrong. --- crates/uv-distribution/src/index/cached_wheel.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/uv-distribution/src/index/cached_wheel.rs b/crates/uv-distribution/src/index/cached_wheel.rs index 461df70da..6fe2cca5b 100644 --- a/crates/uv-distribution/src/index/cached_wheel.rs +++ b/crates/uv-distribution/src/index/cached_wheel.rs @@ -97,7 +97,7 @@ impl CachedWheel { let path = path.as_ref(); // Determine the wheel filename. - let filename = path.file_name()?.to_str()?; + let filename = path.file_stem()?.to_str()?; let filename = WheelFilename::from_stem(filename).ok()?; // Read the pointer. @@ -121,7 +121,7 @@ impl CachedWheel { let path = path.as_ref(); // Determine the wheel filename. - let filename = path.file_name()?.to_str()?; + let filename = path.file_stem()?.to_str()?; let filename = WheelFilename::from_stem(filename).ok()?; // Read the pointer.