Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Allow runnable lock targets to reuse the `uv` cache

未关闭 适合新手
#4,179 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
70/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
活跃
技术栈
python

调研方向

该 issue 指向 lock.bzl 文件以及设置 --no-cache 的具体行。首先检查 lock.bzl 文件,特别是生成可运行目标的函数。理解该标志在构建操作与可运行目标之间的不同应用方式。通过修改标志并运行目标进行测试,以确保缓存能按预期被重用。

由索引模型根据 Issue 内容生成。

描述

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

主要语言
Starlark
星标
690
派生
722
平均合并
1 天 55 分钟
30 天内合并 PR
38

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

bazel-contrib/rules_python 的其他 Issue

查看 bazel-contrib/rules_python 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。