mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-23 12:56:47 +00:00
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:
parent
31752bf4be
commit
5d53040465
3 changed files with 102 additions and 32 deletions
|
|
@ -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),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue