bazel-contrib / bazel-contrib/rules_python
Support python_version on modules_mapping and/or gazelle_manifest rule
- 主要言語
- Starlark
- スター
- 688
- フォーク
- 721
- 平均マージ
- 15時間 7分
- マージ済み PR(30日)
- 76
説明
# 🚀 feature request
### Relevant Rules
* [gazelle_python_manifest](https://github.com/bazel-contrib/rules_python/blob/main/gazelle/manifest/defs.bzl)
* [modules_mapping](https://github.com/bazel-contrib/rules_python/blob/main/gazelle/modules_mapping/def.bzl)
### Description
When in the middle of working on a Python version upgrade, it's valuable to generate gazelle manifests with different module maps because you the requirements.in may include additional requirements for the new python version:
```
gradio; python_version >= "3.11"
```
When running the manifest rule with all_whl_requirements, it'll fail with something like:
> No matching wheel for current configuration's Python version.
In order to get the desired behavior, we need to run the gazelle manifest update by specifying a different python version via command line `--@rules_python//python/config_settings:python_version=3.11`.
### Describe the solution you'd like
Adding a `python_version attribute to the manifest or modules_mapping rule, so that we can run it with the expected python_version as needed without a command-line flag.
### Describe alternatives you've considered
We currently customize our scripts so that we add the command line flag, but I don't think this is feasible.
Other alternatives:
* Generate a modules mapping per different environment tag satisfied in the requirements.in . This might be heavy-handed, but could work for all other environment markers beyond python_version . And there's no need to maintain multiple manifest files.
コントリビューションガイド
調査の方向性
gazelle/manifest/defs.bzl と gazelle/modules_mapping/def.bzl から始め、次に manifest ルールが all_whl_requirements とコマンドラインの python_version 設定をどのように使用しているかを確認します。完了条件は、いずれかのルールが要求された Python バージョンを受け入れ、コマンドライン・フラグなしで対応する manifest または module map を生成し、バージョンによって条件付けられた要件を扱えることです。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- build-system
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100