@@ -227,7 +227,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
227227 archive : self
228228 . build_context
229229 . cache ( )
230- . archive ( & archive. id , archive . version )
230+ . archive ( & archive. id )
231231 . into_boxed_path ( ) ,
232232 hashes : archive. hashes ,
233233 filename : wheel. filename . clone ( ) ,
@@ -265,7 +265,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
265265 archive : self
266266 . build_context
267267 . cache ( )
268- . archive ( & archive. id , archive . version )
268+ . archive ( & archive. id )
269269 . into_boxed_path ( ) ,
270270 hashes : archive. hashes ,
271271 filename : wheel. filename . clone ( ) ,
@@ -304,7 +304,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
304304 archive : self
305305 . build_context
306306 . cache ( )
307- . archive ( & archive. id , archive . version )
307+ . archive ( & archive. id )
308308 . into_boxed_path ( ) ,
309309 hashes : archive. hashes ,
310310 filename : wheel. filename . clone ( ) ,
@@ -335,7 +335,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
335335 archive : self
336336 . build_context
337337 . cache ( )
338- . archive ( & archive. id , archive . version )
338+ . archive ( & archive. id )
339339 . into_boxed_path ( ) ,
340340 hashes : archive. hashes ,
341341 filename : wheel. filename . clone ( ) ,
@@ -421,11 +421,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
421421
422422 Ok ( LocalWheel {
423423 dist : Dist :: Source ( dist. clone ( ) ) ,
424- archive : self
425- . build_context
426- . cache ( )
427- . archive ( & id, LATEST )
428- . into_boxed_path ( ) ,
424+ archive : self . build_context . cache ( ) . archive ( & id) . into_boxed_path ( ) ,
429425 hashes : built_wheel. hashes ,
430426 filename : built_wheel. filename ,
431427 cache : built_wheel. cache_info ,
@@ -689,7 +685,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
689685 Connectivity :: Offline => CacheControl :: AllowStale ,
690686 } ;
691687
692- let archive = self
688+ let archive: Archive = self
693689 . client
694690 . managed ( |client| {
695691 client. cached_client ( ) . get_serde_with_retry (
@@ -708,7 +704,8 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
708704 // If the archive is missing the required hashes, or has since been removed, force a refresh.
709705 let archive = Some ( archive)
710706 . filter ( |archive| archive. has_digests ( hashes) )
711- . filter ( |archive| archive. exists ( self . build_context . cache ( ) ) ) ;
707+ . filter ( |archive| archive. version == LATEST )
708+ . filter ( |archive| self . build_context . cache ( ) . archive ( & archive. id ) . exists ( ) ) ;
712709
713710 let archive = if let Some ( archive) = archive {
714711 archive
@@ -875,7 +872,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
875872 Connectivity :: Offline => CacheControl :: AllowStale ,
876873 } ;
877874
878- let archive = self
875+ let archive: Archive = self
879876 . client
880877 . managed ( |client| {
881878 client. cached_client ( ) . get_serde_with_retry (
@@ -894,7 +891,8 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
894891 // If the archive is missing the required hashes, or has since been removed, force a refresh.
895892 let archive = Some ( archive)
896893 . filter ( |archive| archive. has_digests ( hashes) )
897- . filter ( |archive| archive. exists ( self . build_context . cache ( ) ) ) ;
894+ . filter ( |archive| archive. version == LATEST )
895+ . filter ( |archive| self . build_context . cache ( ) . archive ( & archive. id ) . exists ( ) ) ;
898896
899897 let archive = if let Some ( archive) = archive {
900898 archive
@@ -957,7 +955,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
957955 archive : self
958956 . build_context
959957 . cache ( )
960- . archive ( & archive. id , archive . version )
958+ . archive ( & archive. id )
961959 . into_boxed_path ( ) ,
962960 hashes : archive. hashes ,
963961 filename : filename. clone ( ) ,
@@ -1024,7 +1022,7 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
10241022 archive : self
10251023 . build_context
10261024 . cache ( )
1027- . archive ( & archive. id , archive . version )
1025+ . archive ( & archive. id )
10281026 . into_boxed_path ( ) ,
10291027 hashes : archive. hashes ,
10301028 filename : filename. clone ( ) ,
0 commit comments