uv/crates/uv-resolver
Charlie Marsh 47fb59fdab
Prefer local variants in preference selection (#11546)
## Summary

This PR fixes a subtle issue arising from our propagation of
preferences. When we resolve a fork, we take the solution from that fork
and mark all the chosen versions as "preferred" as we move on to the
next fork.

In this specific case, the resolver ended up solving a macOS-specific
fork first, which led us to pick `2.6.0` rather than `2.6.0+cpu`. This
in itself is correct; but when we moved on to the next fork, we
preferred `2.6.0` over `2.6.0+cpu`, despite the fact that `2.6.0` _only_
includes macOS wheel, and that branch was focused on Linux.

Now, in preferences, we prefer local variants (if they exist). If the
local variant ends up not working, we'll presumedly backtrack to the
base version anyway.

Closes https://github.com/astral-sh/uv/issues/11406.
2025-02-15 20:35:47 -05:00
..
src Prefer local variants in preference selection (#11546) 2025-02-15 20:35:47 -05:00
Cargo.toml Avoid narrowing requires-python marker with disjunctions (#10704) 2025-01-17 16:25:32 +00:00