Skip to content

uv tool run @latest doesn't reuse cache from specific version run #15824

@domdomegg

Description

@domdomegg

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 [email protected]

# Run with @latest - reinstalls all packages even though latest = 5.4.3
uv tool run --python 3.12 wcgw@latest

Actual 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions