mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Add flat index urls to registry wheel index (#928)
Previously, we were missing flat index wheels in the cache.
This commit is contained in:
parent
95f3cca28d
commit
8860a9c29e
1 changed files with 13 additions and 2 deletions
|
@ -4,7 +4,9 @@ use std::path::Path;
|
|||
|
||||
use rustc_hash::FxHashMap;
|
||||
|
||||
use distribution_types::{CachedRegistryDist, CachedWheel, IndexLocations};
|
||||
use distribution_types::{
|
||||
CachedRegistryDist, CachedWheel, FlatIndexLocation, IndexLocations, IndexUrl,
|
||||
};
|
||||
use pep440_rs::Version;
|
||||
use platform_tags::Tags;
|
||||
use puffin_cache::{Cache, CacheBucket, WheelCache};
|
||||
|
@ -75,7 +77,16 @@ impl<'a> RegistryWheelIndex<'a> {
|
|||
) -> BTreeMap<Version, CachedRegistryDist> {
|
||||
let mut versions = BTreeMap::new();
|
||||
|
||||
for index_url in index_locations.indexes() {
|
||||
// Collect into owned `IndexUrl`
|
||||
let flat_index_urls: Vec<IndexUrl> = index_locations
|
||||
.flat_indexes()
|
||||
.filter_map(|flat_index| match flat_index {
|
||||
FlatIndexLocation::Path(_) => None,
|
||||
FlatIndexLocation::Url(url) => Some(IndexUrl::Url(url.clone())),
|
||||
})
|
||||
.collect();
|
||||
|
||||
for index_url in index_locations.indexes().chain(flat_index_urls.iter()) {
|
||||
// Index all the wheels that were downloaded directly from the registry.
|
||||
let wheel_dir = cache.shard(
|
||||
CacheBucket::Wheels,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue