Skip to content

Allow runnable lock targets to reuse the uv cache聽#4179

Description

@hartikainen

馃殌 feature request

Relevant Rules

lock

Description

The runnable targets generated by lock pass --no-cache to uv:

args.add("--no-cache")

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.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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