-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Closed
Description
Description
When using uv tool run, specifying @latest doesn't reuse the cached environment from a previous run with a specific version, even when @latest resolves to the same version.
Steps to reproduce
# First run with specific version - uses cache correctly on subsequent runs
uv tool run --python 3.12 wcgw@5.4.3
# Run with @latest - reinstalls all packages even though latest = 5.4.3
uv tool run --python 3.12 wcgw@latestActual behavior
When running with @latest, uv reports:
wcgw version: 5.4.3
Installed 64 packages in 67ms
It reinstalls all packages despite them being cached from the @5.4.3 run.
Expected behavior
Since @latest resolves to 5.4.3, uv should reuse the cached environment from the previous @5.4.3 run instead of reinstalling all packages.
Environment
- uv version: uv 0.8.6 (329a6b4 2025-08-07)
- Platform: macOS (Darwin 24.6.0)
- Python: 3.12
Additional context
The issue appears to be that uv uses the version specifier (@latest vs @5.4.3) as part of the cache key, rather than the resolved version. This leads to unnecessary reinstallations when using version specifiers that resolve to already-cached versions.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels