uv/crates/uv-distribution/src
Ibraheem Ahmed ba217f1059
Use lockfile to prefill resolver index (#4495)
## Summary

Use the lockfile to prefill the `InMemoryIndex` used by the resolver.
This enables us to resolve completely from the lockfile without making
any network requests/builds if the requirements are unchanged. It also
means that if new requirements are added we can still avoid most I/O
during resolution, partially addressing
https://github.com/astral-sh/uv/issues/3925.

The main limitation of this PR is that resolution from the lockfile can
fail if new versions are requested that are not present in the lockfile,
in which case we have to perform a fresh resolution. Fixing this would
likely require lazy version/metadata requests by `VersionMap` (this is
different from the lazy parsing we do, the list of versions in a
`VersionMap` is currently immutable).

Resolves https://github.com/astral-sh/uv/issues/3892.

## Test Plan

Added a `deterministic!` macro that ensures that a resolve from the
lockfile and a clean resolve result in the same lockfile output for all
our current tests.
2024-07-12 18:49:28 -04:00
..
index Preserve verbatim URLs for --find-links (#4838) 2024-07-05 16:57:40 -05:00
metadata Use lockfile to prefill resolver index (#4495) 2024-07-12 18:49:28 -04:00
source Avoid reparsing wheel URLs (#4947) 2024-07-10 05:16:30 -04:00
archive.rs Store IDs rather than paths in the cache (#2985) 2024-04-10 21:07:51 -04:00
distribution_database.rs Avoid reparsing wheel URLs (#4947) 2024-07-10 05:16:30 -04:00
download.rs Add hash-checking support to install and sync (#2945) 2024-04-10 19:09:03 +00:00
error.rs Show when we retried requests (#4725) 2024-07-02 19:04:11 +02:00
lib.rs Sync all packages in a virtual workspace (#4636) 2024-06-29 12:43:59 -04:00
locks.rs Remove unnecessary uses of DashMap and Arc (#3413) 2024-05-06 22:30:43 -04:00
pyproject.rs Enable projects to opt-out of workspace management (#4565) 2024-07-01 16:17:43 -04:00
pyproject_mut.rs Allow uv add to specify optional dependency groups (#4607) 2024-06-28 01:24:21 +00:00
reporter.rs Concurrent progress bars (#3252) 2024-05-27 01:21:07 +00:00
workspace.rs Rename Workspace.root to Workspace.install_path (#4859) 2024-07-07 18:35:41 +00:00