mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-03 18:38:21 +00:00
Avoid batch prefetching for un-optimized registries (#7226)
## Summary We now track the discovered `IndexCapabilities` for each `IndexUrl`. If we learn that an index doesn't support range requests, we avoid doing any batch prefetching. Closes https://github.com/astral-sh/uv/issues/7221.
This commit is contained in:
parent
970bd1aa0c
commit
9a7262c360
24 changed files with 202 additions and 95 deletions
|
@ -11,7 +11,9 @@ use itertools::Itertools;
|
|||
use rustc_hash::FxHashMap;
|
||||
use tracing::{debug, instrument};
|
||||
|
||||
use distribution_types::{CachedDist, IndexLocations, Name, Resolution, SourceDist};
|
||||
use distribution_types::{
|
||||
CachedDist, IndexCapabilities, IndexLocations, Name, Resolution, SourceDist,
|
||||
};
|
||||
use pypi_types::Requirement;
|
||||
use uv_build::{SourceBuild, SourceBuildContext};
|
||||
use uv_cache::Cache;
|
||||
|
@ -42,6 +44,7 @@ pub struct BuildDispatch<'a> {
|
|||
flat_index: &'a FlatIndex,
|
||||
index: &'a InMemoryIndex,
|
||||
git: &'a GitResolver,
|
||||
capabilities: &'a IndexCapabilities,
|
||||
in_flight: &'a InFlight,
|
||||
build_isolation: BuildIsolation<'a>,
|
||||
link_mode: install_wheel_rs::linker::LinkMode,
|
||||
|
@ -65,6 +68,7 @@ impl<'a> BuildDispatch<'a> {
|
|||
flat_index: &'a FlatIndex,
|
||||
index: &'a InMemoryIndex,
|
||||
git: &'a GitResolver,
|
||||
capabilities: &'a IndexCapabilities,
|
||||
in_flight: &'a InFlight,
|
||||
index_strategy: IndexStrategy,
|
||||
config_settings: &'a ConfigSettings,
|
||||
|
@ -85,6 +89,7 @@ impl<'a> BuildDispatch<'a> {
|
|||
flat_index,
|
||||
index,
|
||||
git,
|
||||
capabilities,
|
||||
in_flight,
|
||||
index_strategy,
|
||||
config_settings,
|
||||
|
@ -127,6 +132,10 @@ impl<'a> BuildContext for BuildDispatch<'a> {
|
|||
self.git
|
||||
}
|
||||
|
||||
fn capabilities(&self) -> &IndexCapabilities {
|
||||
self.capabilities
|
||||
}
|
||||
|
||||
fn build_options(&self) -> &BuildOptions {
|
||||
self.build_options
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue