Skip to content

add uv cache-keys for Rust source and Cargo files#15

Merged
jph00 merged 1 commit into
mainfrom
rust-uv-cache-keys
Jul 13, 2026
Merged

add uv cache-keys for Rust source and Cargo files#15
jph00 merged 1 commit into
mainfrom
rust-uv-cache-keys

Conversation

@RensDimmendaal

Copy link
Copy Markdown

Adds a [tool.uv] section with cache-keys so that uv's cache is invalidated when Rust source files (src/**/*.rs), Cargo.toml, or Cargo.lock change, in addition to pyproject.toml itself.

When this project's Rust extensions are modified, uv's default cache key (based on pyproject.toml alone) may not detect the change, leading to stale builds. By including Rust source and Cargo manifest/lock files as cache keys, uv will correctly rebuild when any of these inputs change.

This PR adds the exact setting uv adds when initializing a rust project (uv init --build-backend maturin)

@RensDimmendaal
RensDimmendaal requested a review from jph00 July 13, 2026 09:49
@RensDimmendaal RensDimmendaal added the enhancement New feature or request label Jul 13, 2026
@jph00
jph00 merged commit f5733e1 into main Jul 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants