bazel-contrib / bazel-contrib/rules_python

Unable to use whl dependency which is compiled from source due (arch not provided in pypi)

オープン
#2,113 コメント 5 件 リアクション 0 件 担当者 0 名 GitHub で見る
need: repro
主要言語
Starlark
スター
688
フォーク
721
平均マージ
15時間 7分
マージ済み PR(30日)
76

説明

# 🐞 bug report

### Affected Rule

he issue is caused by the rule: pip_parse

### Is this a regression?

No

### Description

I'm developing a tensorflow addon with custom ops on MacBook with Intel CPU. All tensorflow versions below 2.17 had prebuilt *macosx_*_x86_64.whl packages. But since v2.17 there are only arm64 versions. The only way i can use fresh tensorflow is to built it itself. As result i have a custom tensorflow whl for my arch.

But this custom-arch self-compiled whl does not exists in PyPi, pip_parse can't find it. And build fails...

**Is there any workaround to use locally-built whl?**

## 🔬 Minimal Reproduction

Exception is related to PyPi package dependency (tensorflow in my case) with specific version and arch (MacOS x86_64 in my case).

## 🔥 Exception or Error



===== stderr start =====
ERROR: Could not find a version that satisfies the requirement tensorflow==2.17.0 (from versions: 2.12.0rc0, 2.12.0rc1, 2.12.0, 2.12.1, 2.13.0rc0, 2.13.0rc1, 2.13.0rc2, 2.13.0, 2.13.1, 2.14.0rc0, 2.14.0rc1, 2.14.0, 2.14.1, 2.15.0rc0, 2.15.0rc1, 2.15.0, 2.15.1, 2.16.0rc0, 2.16.1, 2.16.2)
ERROR: No matching distribution found for tensorflow==2.17.0
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/private/var/tmp/_bazel_alex/9f232a1fa475e5223cc8bd12f98cbb55/external/rules_python~0.34.0/python/private/pypi/whl_installer/wheel_installer.py", line 205, in
main()
File "/private/var/tmp/_bazel_alex/9f232a1fa475e5223cc8bd12f98cbb55/external/rules_python~0.34.0/python/private/pypi/whl_installer/wheel_installer.py", line 190, in main
subprocess.run(pip_args, check=True, env=env)
File "/private/var/tmp/_bazel_alex/9f232a1fa475e5223cc8bd12f98cbb55/external/rules_python~0.34.0~python~python_3_11_x86_64-apple-darwin/lib/python3.11/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/private/var/tmp/_bazel_alex/9f232a1fa475e5223cc8bd12f98cbb55/external/rules_python~0.34.0~python~python_3_11_host/python', '-m', 'pip', '--isolated', 'wheel', '--no-deps', '-r', '/var/folders/46/2h_pg_7s1r70lcfx37hb67nw0000gn/T/tmpoiw9bif1']' returned non-zero exit status 1.
===== stderr end =====

## 🌍 Your Environment

**Operating System:**

  

MacOS X 14.5 (23F79)

**Output of `bazel version`:**

  

Bazelisk version: 1.20.0
Build label: 6.5.0
Build target: bazel-out/darwin-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Tue Jan 23 16:54:12 2024 (1706028852)
Build timestamp: 1706028852
Build timestamp as int: 1706028852

**Rules_python version:**

  

0.34.0

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

Start with the pip_parse rule and the failing path in python/private/pypi/whl_installer/wheel_installer.py, then reproduce the tensorflow==2.17.0 failure on macOS x86_64. Determine how a locally built, architecture-specific wheel could be supplied or resolved; done means the reported dependency can be processed without the PyPI distribution lookup failing.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system
issue の種類
バグ
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
25/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。