Extract METADATA reading into a crate (#7231)

This is preparatory work for the upload functionality, which needs to
read the METADATA file and attach its parsed contents to the POST
request: We move finding the `.dist-info` from `install-wheel-rs` and
`uv-client` to a new `uv-metadata` crate, so it can be shared with the
publish crate.

I don't properly know if its the right place since the upload code isn't
ready, but i'm PR-ing it now because it already had merge conflicts.
This commit is contained in:
konsti 2024-09-10 15:31:01 +02:00 committed by GitHub
parent 95a4beeed3
commit 2b3890f2b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 254 additions and 185 deletions

View file

@ -148,8 +148,8 @@ pub enum ErrorKind {
#[error("Expected an index URL, but received non-base URL: {0}")]
CannotBeABase(Url),
#[error(transparent)]
DistInfo(#[from] install_wheel_rs::Error),
#[error("Failed to read metadata: `{0}`")]
Metadata(String, #[source] uv_metadata::Error),
#[error("{0} isn't available locally, but making network requests to registries was banned")]
NoIndex(String),