bazel-contrib / bazel-contrib/rules_python

Support building from `sdist` in a build action

未关闭
#2,410 14 条评论 2 个 reaction 已指派 0 人 在 GitHub 查看
help wanted type: feature request type: pip
主要语言
Starlark
星标
688
派生
721
平均合并
15 小时 7 分钟
30 天内合并 PR
76

描述

Support building from `sdist` as a build action instead of `repository_rule`.

Things needed:
* [ ] A way to use a different `repository` rule that would not do any building with `pip`.
* [ ] Parsing the dependencies from `pyproject.toml` so that the `deps` field is populated at the repository time.
* [ ] A `pip` toolchain or something similar for building packages. Maybe we should have a `toolchain` for each build backend in the https://peps.python.org/pep-0621/
* [ ] A way to specify build dependencies see #1325.
* [ ] How do we build Python extensions?

Initial thoughts:
* It would be good to create an `sdist_archive` rule, which would download a given `sdist` by URL and then would parse `pyproject.toml`. If the `pyproject.toml` is not found or it is dynamic and requires Python to correctly infer the dependencies, we may need to fail at least in the first iteration.
* Using Python in the repository context is OK, but adds a lot of complication in the long run - we should attempt to limit its usage as much as possible.

At the moment I don't have time to work on this myself, but writing it down so that an issue for PEP621 based sdist building exists. Feel free to add thoughts here on possible design.

贡献指南

打开贡献指南

调研方向

审查现有的 repository_rule 和 build-action 流程,然后检查 pyproject.toml 依赖项的处理方式。以提议的 sdist_archive 规则和 PEP 621 为起点,确定对构建依赖项、构建后端和 Python 扩展的支持方案。完成的标准是已就受支持的设计和实现范围达成一致,而不是将其留作未解决的问题。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
build-system
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
需要澄清
新手友好度
28/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。