Repository navigation
Conversation
19b9fbd to
bf34f98
Compare
bf34f98 to
5443ac6
Compare
897a2bf to
1a5ba01
Compare
1a5ba01 to
9e45e69
Compare
9e45e69 to
f79a5f1
Compare
9aa3251 to
0c460cc
Compare
0c460cc to
65392a8
Compare
Merging this PR will not alter performance
|
65392a8 to
ce7b8fd
Compare
bfa77c2 to
2e853f9
Compare
6eb952c to
dd1bf06
Compare
dd1bf06 to
578f688
Compare
| .packages() | ||
| .iter() | ||
| .filter(|(name, _)| !no_sources.for_package(name)) | ||
| .map(|(_, member)| member.root().clone()) | ||
| .collect(), |
There was a problem hiding this comment.
[P3] Share workspace membership instead of copying it per package
Loading metadata for N workspace members now creates N separately owned sets of N paths, even when require-wheels is disabled. Metadata::from_workspace retains these sets, and lookahead and resolution metadata clones copy them again, although the paths are only consumed during source-tree/group input preparation. Carry shared membership from workspace discovery and collect exemption paths once at that boundary, avoiding quadratic path storage in ordinary workspace resolution.
| let lock: toml::Value = toml::from_str(&context.read("uv.lock"))?; | ||
| assert_eq!( | ||
| lock["package"] | ||
| .as_array() | ||
| .unwrap() |
There was a problem hiding this comment.
[P3] Use the existing lockfile snapshot pattern
This assertion manually parses and traverses the lockfile with unchecked field accesses, unlike lock_required_environment_python_fork and the first new required-wheel test. Snapshot context.read("uv.lock") using the context and Packse hash filters. That keeps the selected version, required markers, and persisted policy visible together, removes the custom structural lookup, and provides a useful output diff on failure.
| prioritized.has_wheel_coverage( | ||
| self.options.minimum_libc_version, | ||
| required_markers.and(fork_markers), |
There was a problem hiding this comment.
[P2] Include the target Python range in wheel coverage
ResolverEnvironment deliberately tracks requires-python separately, so this intersection can establish coverage outside the project's supported Python range. For example, with project requires-python = ">=3.13.2,<3.14" and required Python 3.13, a py3-none-any wheel declaring >=3.12,<3.13.2 passes via Python 3.13.0–3.13.1, although it supports none of the project's environments. The later is_contained_by check only compares lower bounds. Intersect the coverage markers with the effective target Python range, including on the direct-wheel path.
| .any(|required| *required == environment_marker) | ||
| { | ||
| wheel_marker.and(python_marker) |
There was a problem hiding this comment.
[P2] Intersect direct-wheel coverage with dependency applicability
The direct-wheel path checks dependency applicability and wheel coverage independently, allowing different environments to satisfy each check. With project Python >=3.12, required Linux coverage, and a direct dependency marked python_version == '3.13', a py3-none-any wheel declaring >=3.12,<3.13 passes because it covers Linux on Python 3.12. A single marked dependency does not force a resolver fork, and the later Python check ignores upper bounds. Intersect the wheel marker with find_environments(id, pubgrub) when checking coverage, matching the registry path.
58a9ece to
a07a753
Compare
a07a753 to
7a2b533
Compare
| let applicable = find_environments(id, pubgrub); | ||
| for marker in self.options.required_environments.iter().copied() { | ||
| if env.included_by_marker(applicable.and(marker)) { |
There was a problem hiding this comment.
[P2] Limit source wheel requirements to supported Python versions
With requires-python = ">=3.12,<3.13", required Python 3.13 coverage, and an unmarked external sdist URL, this branch rejects the dependency despite the required environment being outside the project's supported range. ResolverEnvironment tracks requires-python separately, and find_environments only supplies dependency applicability, so neither excludes Python 3.13 here. The registry and direct-wheel branches already intersect the target Python specifiers. Apply the same intersection before rejecting source distributions, preferably sharing the applicability calculation across these paths.
7a2b533 to
56ef965
Compare
| // Check the dependency's applicability before requesting metadata for this coverage. | ||
| let required_markers = marker.and(find_environments(id, pubgrub)); |
There was a problem hiding this comment.
[P3] Compute dependency applicability once per candidate
With multiple configured artifact environments, this reruns find_environments(id, pubgrub) for every marker, including when coverage succeeds. That helper allocates collections, traverses the reverse dependency closure, and propagates markers to a fixed point; neither input changes during this loop. Compute applicability once and reuse it across the coverage checks, while retaining the no-work path when there are no artifact environments.
required-environmentsnormally accepts source distributions, which prevents it from enforcing wheel availability for a newer Python version. Add the opt-inrequired-environments-mode = "require-wheels"setting under therequired-environments-modepreview feature, preserving existing behavior by default while requiring compatible wheels for every active dependency in each required environment when enabled. Persist the selected mode inuv.lockso changing the policy triggers a fresh resolution; known holdouts can remain supported by limiting their dependency markers to other environments.