Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Allow runnable lock targets to reuse the `uv` cache

Open
#4,179 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

This issue has not been assessed yet.

Description

🚀 feature request

Relevant Rules

lock

Description

The runnable targets generated by lock pass --no-cache to uv:
https://github.com/bazel-contrib/rules_python/blob/9cc620ebf92d9afaa1c0535968d82d5a7d7e4522/python/uv/private/lock.bzl#L146

This flag applies to both build actions and runnable targets. As a result, repeated invocations of bazel run //path:requirements.run (in our case via multirun), use temporary caches instead of reusing registry metadata, Git checkouts, and build metadata.

Describe the solution you'd like

Drop the --no-cache flag from .run target but keep it on build actions. This way runnable targets would use the caller's environment and write the lockfile into the workspace, so they could also reuse the cache. Callers could still pass --no-cache or select a cache with UV_CACHE_DIR if they want.

Describe alternatives you've considered

Patching rules_python downstream. I'll open up a PR to show what my patch looks like.

Dominant language
Starlark
Stars
690
Forks
722
Avg merge
1d 55m
Merged PRs (30d)
38

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from bazel-contrib/rules_python

All issues in bazel-contrib/rules_python

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.