bazel-contrib/rules_python

gazelle_python.yaml can only use one pip_repository

Open

#1,971 创建于 2024年6月14日

在 GitHub 查看
 (3 评论) (3 反应) (0 负责人)Starlark (705 fork)auto 404
gazellehelp wantedtype: feature request

仓库指标

Star
 (679 star)
PR 合并指标
 (PR 指标待抓取)

描述

The modules_mapping rule accepts a list of wheels, but then the manifest generator assumes that all those modules come from a single pip.parse call.

Since many Python projects separate dependencies, i.e. https://pip-tools.readthedocs.io/en/stable/#workflow-for-layered-requirements it's often the case that some users have different requirements repositories, even for the same folder.

For example, in https://github.com/alexeagle/bazel_python_repro/blob/18f4504adcdef9187f68397ea20a4f6672badcc2/app/BUILD.bazel gazelle has generated line 28 as @pip//python_dotenv. However that wheel came from test.in installed at pip.test - so it should have generated @pip.test//python_dotenv. Of course since the wheels were combined in the modules_mapping this information is lost and the gazelle_python.yaml can't indicate which repo should be used for a given import (no matter what folder the gazelle_python.yaml were to appear in)

贡献者指南