Document the cache directory (#6229)

This commit is contained in:
Zanie Blue 2024-08-19 15:51:45 -05:00 committed by GitHub
parent cc8fbedd37
commit c703917d99
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 45 additions and 1 deletions

View file

@ -31,6 +31,7 @@ pub struct CacheArgs {
impl Cache {
/// Prefer, in order:
///
/// 1. A temporary cache directory, if the user requested `--no-cache`.
/// 2. The specific cache directory specified by the user via `--cache-dir` or `UV_CACHE_DIR`.
/// 3. The system-appropriate cache directory.

View file

@ -405,6 +405,19 @@ pub enum CacheCommand {
/// Prune all unreachable objects from the cache.
Prune(PruneArgs),
/// Show the cache directory.
///
///
/// By default, the cache is stored in `$XDG_CACHE_HOME/uv` or `$HOME/.cache/uv` on Unix and
/// `{FOLDERID_LocalAppData}\uv\cache` on Windows.
///
/// When `--no-cache` is used, the cache is stored in a temporary directory and discarded when
/// the process exits.
///
/// An alternative cache directory may be specified via the `cache-dir` setting, the
/// `--cache-dir` option, or the `$UV_CACHE_DIR` environment variable.
///
/// Note that it is important for performance for the cache directory to be located on the same
/// file system as the Python environment uv is operating on.
Dir,
}