Make missing METADATA file a recoverable error (#4247)

## Summary

I don't have a great way to test it, but this makes the error described
in https://github.com/astral-sh/uv/issues/4246 an incompatibility rather
than a fatal error.

Closes https://github.com/astral-sh/uv/issues/4246.
This commit is contained in:
Charlie Marsh 2024-06-11 12:49:38 -07:00 committed by GitHub
parent 8cfe202e4e
commit 6dae1920af
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 67 additions and 13 deletions

View file

@ -162,10 +162,6 @@ pub enum ErrorKind {
#[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] BetterReqwestError),
/// A generic request error happened while making a request. Refer to the
/// error message for more details.
#[error(transparent)]
@ -185,9 +181,6 @@ pub enum ErrorKind {
#[error(transparent)]
AsyncHttpRangeReader(#[from] AsyncHttpRangeReaderError),
#[error("Expected a single .dist-info directory in {0}, found {1}")]
InvalidDistInfo(WheelFilename, String),
#[error("{0} is not a valid wheel filename")]
WheelFilename(#[source] WheelFilenameError),
@ -212,10 +205,6 @@ pub enum ErrorKind {
#[error("Cache serialization failed")]
Encode(#[source] rmp_serde::encode::Error),
/// An [`io::Error`] with a filename attached
#[error(transparent)]
Persist(#[from] tempfile::PersistError),
#[error("Missing `Content-Type` header for {0}")]
MissingContentType(Url),