uv/docs
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
..
.overrides Use | for page separator in meta titles (#6953) 2024-09-03 00:42:59 +00:00
assets Add static assets to docs pages (#6951) 2024-09-02 20:00:30 -04:00
concepts Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
configuration Touchup to the project environment config section (#7038) 2024-09-04 15:02:35 -05:00
getting-started Document support for UV_INSTALL_DIR (#7107) 2024-09-07 15:26:37 +00:00
guides Bump version to v0.4.7 (#7150) 2024-09-07 02:18:15 +00:00
js Improve copy of console command examples (#5397) 2024-07-31 14:52:02 +00:00
pip (doc) Fix wrong examples for locking (#7120) 2024-09-06 08:21:54 -05:00
reference Add support for dynamic cache keys (#7136) 2024-09-09 20:19:15 +00:00
stylesheets Increase the size of nav entries (#6233) 2024-08-20 11:22:29 -05:00
.gitignore Add structured documentation (#4426) 2024-06-26 11:28:42 -05:00
index.md docs: add missing console highlights (#6900) 2024-08-31 19:04:19 -04:00
requirements-insiders.in Reference the root requirements from the insiders requirements file (#5105) 2024-07-16 09:51:16 -05:00
requirements-insiders.txt Reference the root requirements from the insiders requirements file (#5105) 2024-07-16 09:51:16 -05:00
requirements.in Migrate from MdBook to MkDocs (#5062) 2024-07-15 22:22:07 +00:00
requirements.txt Migrate from MdBook to MkDocs (#5062) 2024-07-15 22:22:07 +00:00