mirror of
https://github.com/astral-sh/uv.git
synced 2025-11-17 18:57:30 +00:00
Respect visitation order for proxy packages (#10833)
## Summary This PR reverts https://github.com/astral-sh/uv/pull/10441 and applies a different fix for https://github.com/astral-sh/uv/issues/10425. In #10441, I changed prioritization to visit proxies eagerly. I think this is actually wrong, since it means we prioritize proxy packages above _everything_ else. And while a proxy only depends on itself, it does mean we're selecting a _version_ for the proxy package earlier than anything else. So, if you look at #10828, we end up choosing a version for `async-timeout` before we choose a version for `langchain`, despite the latter being a first-party dependency. (`async-timeout` has a marker on it, so it has a proxy package, so we solve for it first.) To fix #10425, we instead need to make sure we visit proxies in the order we see them. I think the virtual tiebreaker for proxies is reversed? We want to visit the package we see first, first. So, in short: this reverts #10441, then corrects the ordering for visiting proxies. Closes https://github.com/astral-sh/uv/issues/10828.
This commit is contained in:
parent
e02f061ea9
commit
f0dc1f4dd1
9 changed files with 713 additions and 178 deletions
|
|
@ -2301,16 +2301,16 @@ impl<InstalledPackages: InstalledPackagesProvider> ResolverState<InstalledPackag
|
|||
}
|
||||
}
|
||||
|
||||
// Verify that the package is allowed under the hash-checking policy.
|
||||
if !self
|
||||
.hasher
|
||||
.allows_package(candidate.name(), candidate.version())
|
||||
{
|
||||
return Ok(None);
|
||||
}
|
||||
|
||||
// Emit a request to fetch the metadata for this version.
|
||||
if self.index.distributions().register(candidate.version_id()) {
|
||||
// Verify that the package is allowed under the hash-checking policy.
|
||||
if !self
|
||||
.hasher
|
||||
.allows_package(candidate.name(), candidate.version())
|
||||
{
|
||||
return Err(ResolveError::UnhashedPackage(candidate.name().clone()));
|
||||
}
|
||||
|
||||
let dist = dist.for_resolution().to_owned();
|
||||
|
||||
let response = match dist {
|
||||
|
|
@ -2600,9 +2600,7 @@ impl ForkState {
|
|||
}
|
||||
}
|
||||
|
||||
let for_package = &self.pubgrub.package_store[for_package];
|
||||
|
||||
if let Some(name) = for_package
|
||||
if let Some(name) = self.pubgrub.package_store[for_package]
|
||||
.name_no_root()
|
||||
.filter(|name| !workspace_members.contains(name))
|
||||
{
|
||||
|
|
@ -2633,9 +2631,7 @@ impl ForkState {
|
|||
}
|
||||
|
||||
// Update the package priorities.
|
||||
if !for_package.is_proxy() {
|
||||
self.priorities.insert(package, version, &self.fork_urls);
|
||||
}
|
||||
self.priorities.insert(package, version, &self.fork_urls);
|
||||
}
|
||||
|
||||
let conflict = self.pubgrub.add_package_version_dependencies(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue