bazel-contrib / bazel-contrib/rules_python
multi_pip_parse should support platform specific requirement files
- 主要言語
- Starlark
- スター
- 688
- フォーク
- 721
- 平均マージ
- 15時間 7分
- マージ済み PR(30日)
- 76
説明
# 🚀 feature request
### Relevant Rules
I think we should extend the functionality of `multi_pip_parse` to deal with platform specific requirement files better.
### Description
Currently you can do this to have different lock files on different versions of python
```
multi_pip_parse(
...
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```
but the platform specific attributes take strings (and not dict) so you can only have a single requirements file on a specific platform
```
multi_pip_parse(
...
requirements_linux = "//requirements:requirements_lock_3_12_linux.txt",
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```
The platform specific requirements should also allow you to specify a dict so we can express the proper requirements files on various platforms
### Describe the solution you'd like
Ideally it would just look like this
```
multi_pip_parse(
...
requirements_linux = {
"3.10": "//:requirements_lock_3_10_linux.txt",
"3.12": "//:requirements_lock_3_12_linux.txt",
},
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```
### Describe alternatives you've considered
I'm not really sure there are any good alternative solutions, this feels like it is just missing functionality
コントリビューションガイド
調査の方向性
エントリーポイントは multi_pip_parse です。まず、requirements_lock と requirements_linux がどのように宣言され、選択されるかを追跡してください。既存の Python バージョン辞書の処理と、プラットフォーム固有の属性を比較してください。プラットフォーム固有の属性が、示されているバージョンからラベルへのマッピングを受け入れ、現在の文字列の動作を維持できれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- build-system
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100