bazel-contrib / bazel-contrib/rules_python
Generate one Bazel repo per dependency
- 主要语言
- Starlark
- 星标
- 688
- 派生
- 721
- 平均合并
- 15 小时 7 分钟
- 30 天内合并 PR
- 76
描述
# 🚀 feature request
### Relevant Rules
`pip.parse()` module extension
### Description
When the same pip package is (transitively) depended upon multiple times from different `requirements.txt` files, it is undefined which version will be chosen (both are added to the PYTHONPATH and the order of deps decides which one takes precedence).
This is especially problematic for transitive dependencies of module dependencies where one only has limited to no influence of which version is chosen. This is especially problematic for fundamental libraries like Protobuf which gets pulled in transitively in many `requirements.txt`.
The way this is handled in golang, is that every dependency is its own Bazel repo and as such takes part in version resolution. This makes sure that every package only exists once within a given Bazel workspace.
### Describe the solution you'd like
Generate one Bazel repo per pip dependency.
### Describe alternatives you've considered
For the transition period, `rules_python` could generate both, one repo for all of `requirements.txt` and one repo per dependency. This way, users can easily migrate from one approach to another. In a future major version, the old functionality could be removed.
贡献指南
调研方向
从 `pip.parse()` 模块扩展开始,跟踪多个 `requirements.txt` 文件如何变成 repositories 和 PYTHONPATH 条目。比较当前包含所有依赖项的 repository 模型与所要求的按依赖项划分的模型,包括提议的过渡期;完成的标准是每个 pip 依赖项都有自己的 Bazel repository,并且版本选择不再由依赖项顺序决定。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- python
- 领域
- build-system, tooling
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 30/100