Stream zip archive when fetching non-range-request metadata (#1792)
## Summary If a registry doesn't support range requests, then today, we download the entire wheel to disk and then read the metadata from the downloaded archive. This PR instead modifies the registry client to stream the zipfile and stop as soon as it's seen the metadata, which should be more efficient. Closes https://github.com/astral-sh/uv/issues/1596. ## Test Plan Made this the _only_ path for downloading metadata; verified that the test suite passed.
This commit is contained in:
@@ -68,6 +68,10 @@ pub enum ErrorKind {
|
||||
#[error("Couldn't parse metadata of {0} from {1}")]
|
||||
MetadataParseError(WheelFilename, String, #[source] Box<pypi_types::Error>),
|
||||
|
||||
/// The metadata file was not found in the wheel.
|
||||
#[error("Metadata file `{0}` was not found in {1}")]
|
||||
MetadataNotFound(WheelFilename, String),
|
||||
|
||||
/// The metadata file was not found in the registry.
|
||||
#[error("File `{0}` was not found in the registry at {1}.")]
|
||||
FileNotFound(String, #[source] reqwest::Error),
|
||||
|
||||
Reference in New Issue
Block a user