@@ -1331,6 +1331,9 @@ pub struct CachedFile {
13311331 filename : Option < Box < SmallString > > ,
13321332 #[ rkyv( with = rkyv:: with:: Niche ) ]
13331333 yanked : Option < Box < Yanked > > ,
1334+ /// Deprecated pyx-specific zstd wheel metadata, retained only for compatibility with the
1335+ /// Simple API cache layout.
1336+ // TODO: Remove this field when the Simple API cache format is next bumped.
13341337 #[ rkyv( with = rkyv:: with:: Niche ) ]
13351338 zstd : Option < Box < Zstd > > ,
13361339 dist_info_metadata : bool ,
@@ -1377,7 +1380,7 @@ impl From<File> for CachedFile {
13771380 has_upload_time,
13781381 url : file. url ,
13791382 yanked : file. yanked . filter ( |yanked| yanked. is_yanked ( ) ) ,
1380- zstd : file . zstd ,
1383+ zstd : None ,
13811384 }
13821385 }
13831386}
@@ -1394,7 +1397,7 @@ impl From<CachedFile> for File {
13941397 upload_time_utc_ms : file. has_upload_time . then_some ( file. upload_time_utc_ms ) ,
13951398 url : file. url ,
13961399 yanked : file. yanked ,
1397- zstd : file . zstd ,
1400+ zstd : None ,
13981401 }
13991402 }
14001403}
@@ -1754,7 +1757,7 @@ mod tests {
17541757 use tokio:: sync:: Semaphore ;
17551758 use url:: Url ;
17561759 use uv_normalize:: PackageName ;
1757- use uv_pypi_types:: PypiSimpleDetail ;
1760+ use uv_pypi_types:: { HashDigests , PypiSimpleDetail } ;
17581761 use uv_redacted:: DisplaySafeUrl ;
17591762 use uv_torch:: { TorchBackend , TorchStrategy } ;
17601763
@@ -1764,8 +1767,8 @@ mod tests {
17641767 } ;
17651768 use uv_cache:: Cache ;
17661769 use uv_distribution_types:: {
1767- FileLocation , Index , IndexCapabilities , IndexFormat , IndexLocations , IndexMetadataRef ,
1768- IndexUrl , ToUrlError ,
1770+ File , FileLocation , Index , IndexCapabilities , IndexFormat , IndexLocations ,
1771+ IndexMetadataRef , IndexUrl , ToUrlError , Zstd ,
17691772 } ;
17701773 use uv_small_str:: SmallString ;
17711774 use wiremock:: matchers:: { basic_auth, method, path_regex} ;
@@ -2128,20 +2131,38 @@ mod tests {
21282131 let package_name = PackageName :: from_str ( "example-1" ) ?;
21292132 let data: PypiSimpleDetail = serde_json:: from_str ( response) ?;
21302133 let base = DisplaySafeUrl :: parse ( "https://pypi.org/simple/example-1/" ) ?;
2131- let simple_metadata = SimpleDetailMetadata :: from_pypi_files (
2134+ let mut simple_metadata = SimpleDetailMetadata :: from_pypi_files (
21322135 data. files ,
21332136 & package_name,
21342137 data. project_status ,
21352138 & base,
21362139 ) ;
2140+ let cached_wheel = & mut simple_metadata. versions [ 0 ] . files . wheels [ 0 ] ;
2141+ assert ! ( cached_wheel. zstd. is_none( ) ) ;
2142+ // An entry written by an older uv may still contain pyx-specific zstd wheel metadata.
2143+ cached_wheel. zstd = Some ( Box :: new ( Zstd {
2144+ hashes : HashDigests :: empty ( ) ,
2145+ size : Some ( 42 ) ,
2146+ } ) ) ;
21372147 let archived = super :: OwnedArchive :: from_unarchived ( & simple_metadata) ?;
21382148 let simple_metadata = super :: OwnedArchive :: deserialize ( & archived) ;
21392149
21402150 let filenames: Vec < _ > = simple_metadata
21412151 . versions
21422152 . into_iter ( )
21432153 . flat_map ( |datum| datum. files . all ( & package_name) )
2144- . map ( |( filename, _) | filename. to_string ( ) )
2154+ . map ( |( filename, mut file) | {
2155+ assert ! ( file. zstd. is_none( ) ) ;
2156+ // New cache entries must not preserve pyx-specific zstd wheel metadata either.
2157+ file. zstd = Some ( Box :: new ( Zstd {
2158+ hashes : HashDigests :: empty ( ) ,
2159+ size : Some ( 42 ) ,
2160+ } ) ) ;
2161+ let cached = super :: CachedFile :: from ( file) ;
2162+ assert ! ( cached. zstd. is_none( ) ) ;
2163+ assert ! ( File :: from( cached) . zstd. is_none( ) ) ;
2164+ filename. to_string ( )
2165+ } )
21452166 . collect ( ) ;
21462167 assert_eq ! (
21472168 filenames,
0 commit comments