uv/crates
Charlie Marsh 4f2349119c
Add support for dynamic cache keys (#7136)
## Summary

This PR adds a more flexible cache invalidation abstraction for uv, and
uses that new abstraction to improve support for dynamic metadata.

Specifically, instead of relying solely on a timestamp, we now pass
around a `CacheInfo` struct which (as of now) contains
`Option<Timestamp>` and `Option<Commit>`. The `CacheInfo` is saved in
`dist-info` as `uv_cache.json`, so we can test already-installed
distributions for cache validity (along with testing _cached_
distributions for cache validity).

Beyond the defaults (`pyproject.toml`, `setup.py`, and `setup.cfg`
changes), users can also specify additional cache keys, and it's easy
for us to extend support in the future. Right now, cache keys can either
be instructions to include the current commit (for `setuptools_scm` and
similar) or file paths (for `hatch-requirements-txt` and similar):

```toml
[tool.uv]
cache-keys = [{ file = "requirements.txt" }, { git = true }]
```

This change should be fully backwards compatible.

Closes https://github.com/astral-sh/uv/issues/6964.

Closes https://github.com/astral-sh/uv/issues/6255.

Closes https://github.com/astral-sh/uv/issues/6860.
2024-09-09 20:19:15 +00:00
..
bench Avoid batch prefetching for un-optimized registries (#7226) 2024-09-09 15:46:19 -04:00
cache-key Use hasher to compute resolution hash (#5495) 2024-07-26 23:24:09 +00:00
distribution-filename treat .tgz the same as .tar.gz (#7201) 2024-09-08 23:09:39 +00:00
distribution-types Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
install-wheel-rs Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
once-map Use FxHash in uv-auth (#6149) 2024-08-16 13:14:51 -04:00
pep440-rs Avoid iteration for singleton selections (#7195) 2024-09-09 13:43:57 +00:00
pep508-rs pep508: implement marker simplification/complexification 2024-09-07 13:46:02 -04:00
platform-tags allow manylinux compatibility override via _manylinux module. (#6039) 2024-08-21 01:57:42 +00:00
pypi-types Respect hashes in constraints files (#7093) 2024-09-05 14:30:10 -04:00
requirements-txt Avoid using editable tag in lockfile for non-package dependencies (#6728) 2024-08-28 01:19:05 +00:00
uv Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-auth Fix typos in docs, error messages and comments (#6910) 2024-09-01 11:37:43 +00:00
uv-build Avoid extra newlines in debug logging for source builds (#7174) 2024-09-07 14:34:00 -04:00
uv-cache Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-cache-info Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-cli docs: list supported sdist formats (#7168) 2024-09-07 19:16:12 +00:00
uv-client Avoid batch prefetching for un-optimized registries (#7226) 2024-09-09 15:46:19 -04:00
uv-configuration Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-dev Avoid batch prefetching for un-optimized registries (#7226) 2024-09-09 15:46:19 -04:00
uv-dispatch Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-distribution Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-extract Enforce extension validity at parse time (#5888) 2024-08-08 21:39:47 -04:00
uv-fs Remove canonicalize calls (#6919) 2024-09-01 18:23:11 +00:00
uv-git Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-installer Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-macros Autogenerate possible values for enums in reference documentation (#5137) 2024-07-17 12:37:33 -04:00
uv-normalize Fix typo in name normalization (#7217) 2024-09-09 14:29:28 +00:00
uv-options-metadata Autogenerate possible values for enums in reference documentation (#5137) 2024-07-17 12:37:33 -04:00
uv-pubgrub Respect the user's upper-bound in requires-python (#6824) 2024-08-29 18:37:05 +00:00
uv-python Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-requirements Respect hashes in constraints files (#7093) 2024-09-05 14:30:10 -04:00
uv-resolver Avoid batch prefetching for un-optimized registries (#7226) 2024-09-09 15:46:19 -04:00
uv-scripts Avoid writing invalid PEP 723 scripts on tool.uv.sources (#6706) 2024-08-27 17:49:08 +00:00
uv-settings Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-shell Expand tildes when matching against PATH (#6829) 2024-08-29 19:50:09 +00:00
uv-state Migrate to XDG and Linux strategy for macOS directories (#5806) 2024-08-20 11:31:46 -05:00
uv-tool Avoid deadlocks when multiple uv processes lock resources (#6790) 2024-08-29 11:16:14 -05:00
uv-trampoline fix: adjust close_handles pointer offsets to match distlib cleanup_fds (#6955) 2024-09-04 13:31:57 +02:00
uv-types Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
uv-version Bump version to v0.4.7 (#7150) 2024-09-07 02:18:15 +00:00
uv-virtualenv Remove unused import. (#6996) 2024-09-04 09:40:58 -04:00
uv-warnings Upgrade to Rust 1.80.0 (#5472) 2024-07-27 01:49:47 +00:00
uv-workspace Respect exclusion when collecting workspace members (#7175) 2024-09-09 12:08:06 -04: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.