uv/docs/reference
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
..
benchmarks.md Add link to benchmarks in documentation (#6257) 2024-08-20 12:54:46 -04:00
cli.md docs: list supported sdist formats (#7168) 2024-09-07 19:16:12 +00:00
index.md Disable collapsible navigation in the documentation (#5674) 2024-08-16 18:09:21 -05:00
platforms.md Move some documents to relevant sections (#5968) 2024-08-09 17:31:10 +00:00
resolver-internals.md Fix up reference to environment markers in resolver reference (#6773) 2024-08-28 18:00:43 -04:00
settings.md Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
versioning.md Move some documents to relevant sections (#5968) 2024-08-09 17:31:10 +00:00