uv/crates
Charlie Marsh e3f345ce09
Validate lockfile (rather than re-resolve) in uv lock (#6091)
## Summary

Historically, in order to "resolve from a lockfile", we've taken the
lockfile, used it to pre-populate the in-memory metadata index, then run
a resolution. If the resolution didn't match our existing resolution, we
re-resolved from scratch.

This was an appealing approach because (in theory) it didn't require any
dedicated logic beyond pre-populating the index. However, it's proven to
be _really_ hard to get right, because it's a stricter requirement than
we need. We just need the current lockfile to _satisfy_ the requirements
provided by the user. We don't actually need a second resolution to
produce the exact same result. And it's not uncommon that this second
resolution differs, because we seed it with preferences, which
fundamentally changes its course. We've worked hard to minimize those
"instabilities", but they're still present.

The approach here is intended to be much simpler. Instead of resolving
from the lockfile, we just check if the current resolution satisfies the
state of the workspace. Specifically, we check if the lockfile (1)
contains all the relevant members, and (2) matches the metadata for all
dependencies, recursively. (We skip registry dependencies, assuming that
they're immutable.)

This may actually be too conservative, since we can have resolutions
that satisfy the requirements, even if the requirements have changed
slightly. But we want to bias towards correctness for now.

My hope is that this scheme will be more performant, simpler, and more
robust.

Closes https://github.com/astral-sh/uv/issues/6063.
2024-08-14 20:00:15 -04:00
..
bench Store environment-markers in solve order (#6078) 2024-08-14 09:20:12 -04:00
cache-key Use hasher to compute resolution hash (#5495) 2024-07-26 23:24:09 +00:00
distribution-filename Enforce extension validity at parse time (#5888) 2024-08-08 21:39:47 -04:00
distribution-types Invalidate uv.lock if registry sources are removed (#6026) 2024-08-13 23:42:04 +00:00
install-wheel-rs Retain and respect settings in tool upgrades (#5937) 2024-08-09 18:21:49 +00:00
once-map Use lockfile to prefill resolver index (#4495) 2024-07-12 18:49:28 -04:00
pep440-rs Warn when there are missing bounds on transitive deps in lowest (#5953) 2024-08-09 17:55:17 +00:00
pep508-rs Remove uses of Option<MarkerTree> in ResolutionGraph (#6035) 2024-08-12 10:31:07 -04:00
platform-tags Process completed Python installs and uninstalls as a stream (#5203) 2024-07-19 12:50:38 +00:00
pypi-types Validate lockfile (rather than re-resolve) in uv lock (#6091) 2024-08-14 20:00:15 -04:00
requirements-txt Remove uses of Option<MarkerTree> (#5978) 2024-08-10 13:23:29 -04:00
uv Validate lockfile (rather than re-resolve) in uv lock (#6091) 2024-08-14 20:00:15 -04:00
uv-auth Redact Git credentials from pyproject.toml (#6074) 2024-08-14 01:30:02 +00:00
uv-build Support no-build-isolation-package (#5894) 2024-08-08 01:35:56 +00:00
uv-cache Enforce extension validity at parse time (#5888) 2024-08-08 21:39:47 -04:00
uv-cli Hide python options in uv tool list help (#6003) 2024-08-13 11:21:44 -05:00
uv-client Support relative path wheels (#5969) 2024-08-09 21:57:16 +00:00
uv-configuration Remove uses of Option<MarkerTree> (#5978) 2024-08-10 13:23:29 -04:00
uv-dev Add CLI flags to reference documentation (#5926) 2024-08-08 18:51:27 +00:00
uv-dispatch Allow downloading wheels for metadata with --no-binary (#5707) 2024-08-06 18:14:12 +00:00
uv-distribution Avoid displaying "failed to download" on build failures for local source distributions (#6075) 2024-08-14 17:27:55 -05:00
uv-extract Enforce extension validity at parse time (#5888) 2024-08-08 21:39:47 -04:00
uv-fs Capture portable path serialization in a struct (#5652) 2024-07-31 16:00:37 +00:00
uv-git Redact Git credentials from pyproject.toml (#6074) 2024-08-14 01:30:02 +00:00
uv-installer Use consistent canonicalization for URLs (#5980) 2024-08-09 21:43:36 -04:00
uv-macros Autogenerate possible values for enums in reference documentation (#5137) 2024-07-17 12:37:33 -04:00
uv-normalize Support dev dependencies in virtual workspace roots (#5709) 2024-08-01 21:04:30 +00:00
uv-options-metadata Autogenerate possible values for enums in reference documentation (#5137) 2024-07-17 12:37:33 -04:00
uv-pubgrub Implement marker trees using algebraic decision diagrams (#5898) 2024-08-09 13:40:02 -04:00
uv-python Update Pythons to include Python 3.12.5 (#6087) 2024-08-14 15:18:01 +00:00
uv-requirements Avoid displaying "failed to download" on build failures for local source distributions (#6075) 2024-08-14 17:27:55 -05:00
uv-resolver Validate lockfile (rather than re-resolve) in uv lock (#6091) 2024-08-14 20:00:15 -04:00
uv-scripts Misc. edits to script parsing (#5999) 2024-08-10 22:07:05 -04:00
uv-settings Make more informative warning message when failed to parse pyproject.toml (#6009) 2024-08-11 21:13:14 +00:00
uv-shell fix(venv): make relocatable activation scripts support ksh (#5640) 2024-07-31 12:18:11 -04:00
uv-state Cache tool environments in uv tool run (#4784) 2024-07-03 19:25:39 -04:00
uv-tool Retain and respect settings in tool upgrades (#5937) 2024-08-09 18:21:49 +00:00
uv-trampoline Update Rust crate dunce to v1.0.5 (#6019) 2024-08-12 01:25:55 +00:00
uv-types Support no-build-isolation-package (#5894) 2024-08-08 01:35:56 +00:00
uv-version Bump version to 0.2.36 (#6060) 2024-08-13 12:05:11 -05:00
uv-virtualenv fix(venv): make relocatable activation scripts support ksh (#5640) 2024-07-31 12:18:11 -04:00
uv-warnings Upgrade to Rust 1.80.0 (#5472) 2024-07-27 01:49:47 +00:00
uv-workspace Support PEP 723 scripts in uv add and uv remove (#5995) 2024-08-11 01:40:59 +00:00
README.md Use prettier to format the documentation (#5708) 2024-08-02 08:58:31 -05:00

Crates

bench

Functionality for benchmarking uv.

cache-key

Generic functionality for caching paths, URLs, and other resources across platforms.

distribution-filename

Parse built distribution (wheel) and source distribution (sdist) filenames to extract structured metadata.

distribution-types

Abstractions for representing built distributions (wheels) and source distributions (sdists), and the sources from which they can be downloaded.

install-wheel-rs

Install built distributions (wheels) into a virtual environment.]

once-map

A waitmap-like concurrent hash map for executing tasks exactly once.

pep440-rs

Utilities for interacting with Python version numbers and specifiers.

pep508-rs

Utilities for interacting with PEP 508 dependency specifiers.

platform-host

Functionality for detecting the current platform (operating system, architecture, etc.).

platform-tags

Functionality for parsing and inferring Python platform tags as per PEP 425.

uv

Command-line interface for the uv package manager.

uv-build

A PEP 517-compatible build frontend for uv.

uv-cache

Functionality for caching Python packages and associated metadata.

uv-client

Client for interacting with PyPI-compatible HTTP APIs.

uv-dev

Development utilities for uv.

uv-dispatch

A centralized struct for resolving and building source distributions in isolated environments. Implements the traits defined in uv-types.

uv-distribution

Client for interacting with built distributions (wheels) and source distributions (sdists). Capable of fetching metadata, distribution contents, etc.

uv-extract

Utilities for extracting files from archives.

uv-fs

Utilities for interacting with the filesystem.

uv-git

Functionality for interacting with Git repositories.

uv-installer

Functionality for installing Python packages into a virtual environment.

uv-python

Functionality for detecting and leveraging the current Python interpreter.

uv-normalize

Normalize package and extra names as per Python specifications.

uv-package

Types and functionality for working with Python packages, e.g., parsing wheel files.

uv-requirements

Utilities for reading package requirements from pyproject.toml and requirements.txt files.

uv-resolver

Functionality for resolving Python packages and their dependencies.

uv-shell

Utilities for detecting and manipulating shell environments.

uv-types

Shared traits for uv, to avoid circular dependencies.

pypi-types

General-purpose type definitions for types used in PyPI-compatible APIs.

uv-virtualenv

A venv replacement to create virtual environments in Rust.

uv-warnings

User-facing warnings for uv.

uv-workspace

Workspace abstractions for uv.

requirements-txt

Functionality for parsing requirements.txt files.