Repository navigation
Keep direct wheels available for uv lock --check - #23326
charliermarsh wants to merge 1 commit into
Conversation
| demo = {{ path = "{filename}" }} | ||
| "#})?; | ||
|
|
||
| uv_snapshot!(context.filters(), context.lock(), @" |
There was a problem hiding this comment.
[P3] Treat a missing direct wheel as a stale lock entry
The test starts without a lockfile. If the merge base already wrote this path dependency without a wheels entry, uv lock --no-build still cannot repair it: Package::to_dist returns NoBuild, and do_lock stops before reaching the updated writer. Without --no-build, validation falls back to a fresh resolution without the old version preferences, so repairing one wheel can update unrelated packages. This recovery behavior predates the PR; a follow-up can classify the missing direct-wheel entry as a lock satisfaction mismatch before fetching metadata, retaining the other pins.
| Dist::Built(dist) | ||
| if is_wheel_unreachable_for_marker( | ||
| dist.wheel_filename(), | ||
| requires_python, | ||
| &UniversalMarker::TRUE, | ||
| None, |
There was a problem hiding this comment.
[P3] Record the selected direct wheel without rechecking reachability
ResolverState::choose_version_url already rejects incompatible Python tags and wheel variants during universal resolution. Unlike a registry wheel, a direct wheel is the selected artifact, not one candidate among several. Passing UniversalMarker::TRUE repeats those checks through a platform filter; if the resolver and writer ever disagree, the writer silently drops the only artifact validation needs. Remove this guard and let the direct URL, path, and Git-path arms record their wheel unconditionally. Installation still checks concrete tags.
Summary
uv lock --checkcan fail immediately afteruv addwrites the lockfile. For example, a project can depend on a locali686wheel on machines that reportx86_64. That combination is possible when running 32-bit Python on x86-64 Linux.We compare the wheel's
i686tag with thex86_64marker and omit the wheel from the package'swheelslist. When we validate the lockfile, we need to read the local wheel's metadata, even on macOS where the dependency is inactive. With an empty list, uv reports that the binary distribution is incompatible with the current platform.We now record a direct wheel in
uv.lockeven when its platform tag conflicts with the marker. We check the Python version when writing the lockfile and the interpreter's supported tags when installing the package.