mirror of
https://github.com/astral-sh/uv.git
synced 2025-08-04 10:58:28 +00:00
Wait for distribution metadata with --no-deps
(#1812)
## Summary We still need to wait for the distribution metadata (for direct dependencies), even when resolving with `--no-deps`, since we rely on it to report diagnostics to the user. Closes https://github.com/astral-sh/uv/issues/1801.
This commit is contained in:
parent
19890feb77
commit
c2b75b64d2
2 changed files with 70 additions and 0 deletions
|
@ -832,6 +832,25 @@ impl<'a, Provider: ResolverProvider> Resolver<'a, Provider> {
|
|||
PubGrubPackage::Package(package_name, extra, url) => {
|
||||
// If we're excluding transitive dependencies, short-circuit.
|
||||
if self.dependency_mode.is_direct() {
|
||||
// If an extra is provided, wait for the metadata to be available, since it's
|
||||
// still required for reporting diagnostics.
|
||||
if extra.is_some() {
|
||||
// Determine the distribution to lookup.
|
||||
let dist = match url {
|
||||
Some(url) => PubGrubDistribution::from_url(package_name, url),
|
||||
None => PubGrubDistribution::from_registry(package_name, version),
|
||||
};
|
||||
let package_id = dist.package_id();
|
||||
|
||||
// Wait for the metadata to be available.
|
||||
self.index
|
||||
.distributions
|
||||
.wait(&package_id)
|
||||
.instrument(info_span!("distributions_wait", %package_id))
|
||||
.await
|
||||
.ok_or(ResolveError::Unregistered)?;
|
||||
}
|
||||
|
||||
return Ok(Dependencies::Available(DependencyConstraints::default()));
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue