Platform-specific packages missing from the unified `@pypi` hub
メンテナーはふだん 1 日以内に返信
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 活発
- 技術スタック
- python
- 領域
- build-system, tooling
調査の方向性
Start at the pip.parse entry point and reproduce the issue with MODULE.bazel, BUILD.bazel, requirements_linux.txt, and requirements_windows.txt. Compare the concrete @pypi_b//six alias with @pypi//six, then add regression coverage showing that the unified hub includes platform-specific packages and the alias resolves on Linux.
索引モデルが issue の本文から書いたものです。
説明
🐞 bug report
(This was diagnosed with help from Codex.)
Affected Rule
pip.parse and the automatically generated unified @pypi hub.
Is this a regression?
Not sure.
Description
I'm seeing an issue where packages that appear only in some platform-specific requirements files are omitted from the unified @pypi hub.
I have an example where I expect @pypi//six to resolve on Linux when the selected concrete hub provides six for Linux. Instead, the unified hub omits the package entirely, even though the concrete hub provides the alias.
The unified hub collects packages from exposed_packages, which filters out platform-specific packages. I think it should collect packages from each concrete hub's complete wheel map and let that hub's aliases handle platform selection.
🔬 Minimal Reproduction
With rules_python and a Python 3.11 toolchain configured, add:
# MODULE.bazel
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
pip.parse(
hub_name = "pypi_b",
python_version = "3.11",
requirements_by_platform = {
"//:requirements_linux.txt": "linux_*",
"//:requirements_windows.txt": "windows_*",
},
target_platforms = [
"linux_x86_64",
"windows_x86_64",
],
)
pip.default(default_hub = "pypi_b")
use_repo(pip, "pypi_b", "pypi")
# BUILD.bazel
exports_files([
"requirements_linux.txt",
"requirements_windows.txt",
])
# requirements_linux.txt
colorama==0.4.5
six==1.16.0
# requirements_windows.txt
colorama==0.4.5
On Linux x86_64, compare:
bazel build @pypi_b//six
bazel build @pypi//six
The concrete alias resolves, but the unified alias is absent.
🔥 Exception or Error
Bazel cannot resolve @pypi//six because the unified repository does not contain the six package.
🌍 Your Environment
Operating system: linux_x86_64.
Bazel version used to validate the fix: 9.1.1.
rules_python @ 9cc620ebf92d9afaa1c0535968d82d5a7d7e4522.
Anything else relevant?
Using the concrete hub label avoids the missing unified alias. I'd be happy to contribute the fix and regression coverage.
- 主要言語
- Starlark
- スター
- 688
- フォーク
- 724
- 平均マージ
- 1日 18時間
- マージ済み PR(30日)
- 46
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bazel-contrib/rules_python のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
bazel-contrib/rules_python#4201 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
bazel-contrib/rules_python#4164 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
go:embed stdlib_list.txt file in gazelle/python/std_modules.go is missing対応中かも @udaya2899 が 8 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
bazel-contrib/rules_python#3821 ·
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 28/100
bazel-contrib/rules_python#4218 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
type: toolchain
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
bazel-contrib/rules_python#4216 · コメント 5 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
bazel-contrib/rules_python の issue をすべて見る
似ている issue
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
IAmTomShaw/f1-race-replay#341 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
0x80/isolate-package#218 ·
-
libasr headers?オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
reflex-dev/reflex#7480 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
sustainability
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
caktus/Traffic-Stops#421 ·