uv/crates/uv-resolver/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
..
pubgrub Always use release-only comparisons for requires-python (#4794) 2024-07-04 20:06:52 +00:00
resolution Filter out markers based on Python requirement (#4912) 2024-07-09 09:15:58 -07:00
resolver Use lockfile to prefill resolver index (#4495) 2024-07-12 18:49:28 -04:00
snapshots Avoid reparsing wheel URLs (#4947) 2024-07-10 05:16:30 -04:00
bare.rs Add support for parsing unnamed URL requirements (#2567) 2024-03-21 03:28:58 +00:00
candidate_selector.rs uv-distribution: include all wheels in distribution types (#3595) 2024-05-15 15:07:28 -04:00
dependency_mode.rs Rename to uv (#1302) 2024-02-15 11:19:46 -06:00
dependency_provider.rs Update pubgrub to new add_incompatibility_from_dependencies (#4062) 2024-06-05 20:46:00 +02:00
error.rs Support conflicting URL in separate forks (#4435) 2024-06-26 13:58:23 +02:00
exclude_newer.rs Improve JSON Schema and add export script (#3461) 2024-05-08 16:15:16 +00:00
exclusions.rs Allow constraints to be provided in --upgrade-package (#4952) 2024-07-09 20:09:13 -07:00
flat_index.rs Remove useless #[allow(clippy::too_many_arguments)] (#4529) 2024-06-25 19:09:59 +00:00
fork_urls.rs Support conflicting URL in separate forks (#4435) 2024-06-26 13:58:23 +02:00
lib.rs Narrow requires-python requirement in resolver forks (#4707) 2024-07-02 12:23:38 +00:00
lock.rs Use lockfile to prefill resolver index (#4495) 2024-07-12 18:49:28 -04:00
manifest.rs Apply extra to overrides and constraints (#4829) 2024-07-09 20:37:24 +02:00
marker.rs Fix substring marker expression disjointness checks (#4998) 2024-07-12 15:21:21 +00:00
options.rs Implement --index-strategy unsafe-best-match (#3138) 2024-04-27 01:24:54 +00:00
pins.rs uv-resolver: implement merging of forked resolutions 2024-05-30 14:23:14 -04:00
preferences.rs Set fork solution as preference when resolving (#4662) 2024-07-01 08:25:40 -04:00
prerelease_mode.rs Add support for tool.uv into distribution building (#3904) 2024-05-31 02:42:03 +00:00
python_requirement.rs uv-resolver: partially revert Requires-Python version narrowing 2024-07-08 09:56:59 -07:00
redirect.rs Preserve fragments when applying verbatim redirects (#4038) 2024-06-05 03:53:23 +00:00
requires_python.rs Filter out markers based on Python requirement (#4912) 2024-07-09 09:15:58 -07:00
resolution_mode.rs Apply extra to overrides and constraints (#4829) 2024-07-09 20:37:24 +02:00
version_map.rs Move Requires-Python incompatibilities out of version map (#4705) 2024-07-02 08:15:39 -04:00
yanks.rs Use Preferences struct in Manifest API (#4496) 2024-06-24 23:28:55 +00:00