bazel-contrib / bazel-contrib/rules_python

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

Abierto
#2,113 5 comentarios 0 reacciones 0 asignados Ver en GitHub
need: repro
Lenguaje dominante
Starlark
Estrellas
688
Forks
721
Merge medio
15 h 7 min
PR fusionados (30 d)
76

Descripción

# 🐞 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

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
build-system
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Necesita aclaración
Aptitud para principiantes
25/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.