mirror of
https://github.com/astral-sh/uv.git
synced 2025-10-24 17:16:02 +00:00
Remove redirects from the resolver (#2792)
## Summary Rather than storing the `redirects` on the resolver, this PR just re-uses the "convert this URL to precise" logic when we convert to a `Resolution` after-the-fact. I think this is a lot simpler: it removes state from the resolver, and simplifies a lot of the hooks around distribution fetching (e.g., `get_or_build_wheel_metadata` no longer returns `(Metadata23, Option<Url>)`).
This commit is contained in:
parent
ffd4b6fcac
commit
189d0d41d0
12 changed files with 80 additions and 182 deletions
|
|
@ -6,7 +6,6 @@ use anyhow::{Context, Result};
|
|||
use futures::{StreamExt, TryStreamExt};
|
||||
use url::Url;
|
||||
|
||||
use cache_key::CanonicalUrl;
|
||||
use distribution_types::{BuildableSource, PackageId, PathSourceUrl, SourceUrl};
|
||||
use pep508_rs::Requirement;
|
||||
use uv_client::RegistryClient;
|
||||
|
|
@ -94,16 +93,11 @@ impl<'a, Context: BuildContext + Send + Sync> SourceTreeResolver<'a, Context> {
|
|||
} else {
|
||||
// Run the PEP 517 build process to extract metadata from the source distribution.
|
||||
let source = BuildableSource::Url(source);
|
||||
let (metadata, precise) = self.database.build_wheel_metadata(&source).await?;
|
||||
let metadata = self.database.build_wheel_metadata(&source).await?;
|
||||
|
||||
// Insert the metadata into the index.
|
||||
self.index.insert_metadata(id, metadata.clone());
|
||||
|
||||
// Insert the redirect into the index.
|
||||
if let Some(precise) = precise {
|
||||
self.index.insert_redirect(CanonicalUrl::new(&url), precise);
|
||||
}
|
||||
|
||||
metadata
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue