From 7cdc1f62ee9e1dbf6b9cbb9967c3e7e75813bd99 Mon Sep 17 00:00:00 2001 From: Charlie Marsh Date: Wed, 16 Jul 2025 12:02:29 -0400 Subject: [PATCH] Suggest `uv cache clean` prior to `--reinstall` (#14659) ## Summary Closes https://github.com/astral-sh/uv/issues/14479. --- docs/concepts/cache.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/concepts/cache.md b/docs/concepts/cache.md index 6610ccb55..189465ac4 100644 --- a/docs/concepts/cache.md +++ b/docs/concepts/cache.md @@ -19,12 +19,17 @@ The specifics of uv's caching semantics vary based on the nature of the dependen If you're running into caching issues, uv includes a few escape hatches: +- To clear the cache entirely, run `uv cache clean`. To clear the cache for a specific package, run + `uv cache clean `. For example, `uv cache clean ruff` will clear the cache for the + `ruff` package. - To force uv to revalidate cached data for all dependencies, pass `--refresh` to any command (e.g., `uv sync --refresh` or `uv pip install --refresh ...`). - To force uv to revalidate cached data for a specific dependency pass `--refresh-package` to any - command (e.g., `uv sync --refresh-package flask` or `uv pip install --refresh-package flask ...`). + command (e.g., `uv sync --refresh-package ruff` or `uv pip install --refresh-package ruff ...`). - To force uv to ignore existing installed versions, pass `--reinstall` to any installation command - (e.g., `uv sync --reinstall` or `uv pip install --reinstall ...`). + (e.g., `uv sync --reinstall` or `uv pip install --reinstall ...`). (Consider running + `uv cache clean ` first, to ensure that the cache is cleared prior to + reinstallation.) As a special case, uv will always rebuild and reinstall any local directory dependencies passed explicitly on the command-line (e.g., `uv pip install .`).