bazel-contrib / bazel-contrib/rules_python
Add repl_env dependency support
- 主要语言
- Starlark
- 星标
- 688
- 派生
- 721
- 平均合并
- 15 小时 7 分钟
- 30 天内合并 PR
- 76
描述
# 🚀 feature request
### Relevant Rules
Relevant rules are `//python/bin:repl` & `//python/bin:repl_env`.
### Description
Goal would be to enable repl use similar to how is is used now:
`bazel run @rules_python//python/bin:repl --@rules_python//python/bin:repl_dep=//python:my_rule_with_deps`
This is how I start interactive shells with access to runfiles and python packages depended on by the specified label.
It would be convenient to also enable the same for environment variables specified in that label. Could potentially be added to repl_dep. Alternative is:
--@rules_python//python/bin:repl_env=//python:my_rule_with_deps
### Potential Solution
Could add env attr assingment [here](https://github.com/bazel-contrib/rules_python/blob/bb2aad2d1e3f883c9cdc2264e0b4a2815233db57/python/bin/BUILD.bazel#L34).
kwargs forwarding should take care of any changes needed in py_binary_rule impl (I think).
贡献指南
调研方向
从 python/bin/BUILD.bazel 第 34 行附近开始,检查 //python/bin:repl 和 //python/bin:repl_env 的定义,包括 repl_dep 的处理方式。确定是否应支持传递给 repl_dep 的 label 中的环境变量,或通过 repl_env 暴露这些变量,然后验证使用指定 label 运行时交互式 shell 是否能接收到这些变量。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- build-system
- Issue 类型
- 功能
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100