Skip to content

Cache Python resolutions by uv storage paths - #151

Draft
t-kalinowski wants to merge 1 commit into
mainfrom
fix/uv-python-cache-paths
Draft

t-kalinowski wants to merge 1 commit into
mainfrom
fix/uv-python-cache-paths

Conversation

@t-kalinowski

Copy link
Copy Markdown
Member

Summary

Reuse cached Python resolutions when UV_CACHE_DIR or UV_PYTHON_INSTALL_DIR is set. Previously, any nonempty UV_* variable disabled cache reuse, even though these two variables are stable path inputs.

Including their effective paths in the cache key preserves reuse for identical settings while resolving again when either uv storage location changes.

User-facing changes

  • Python dependencies no longer resolve again on every run solely because UV_CACHE_DIR or UV_PYTHON_INSTALL_DIR is set.
  • Changing either path uses a separate cached resolution, so an interpreter from another uv storage location is not reused.

Internal changes

  • Treat the two uv path variables as cache-key inputs while continuing to make other nonempty UV_* variables and RETICULATE_UV bypass the cache.
  • Resolve relative uv paths against the current working directory before hashing them.
  • Add public ir run coverage for reuse and isolation across multiple uv path combinations.

Testing

  • cargo fmt --all -- --check
  • cargo clippy --all-targets -- -D warnings
  • cargo nextest run --no-fail-fast -j 4 (205 passed)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant