bazel-contrib / bazel-contrib/rules_python

feat: support bazel (rules_python) as a PEP-517 backend

未关闭
#1,103 10 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Starlark
星标
688
派生
721
平均合并
15 小时 7 分钟
30 天内合并 PR
76

描述

# 🚀 feature request

Probably very low priority, but having support for `pyproject.toml` would be awesome. Maybe for the first pass `rules_python` can support parsing `[project]` and other fields as metadata

### Relevant Rules

`py_wheel`

### Description

A clear and concise description of the problem or missing capability...

### Describe the solution you'd like

An example `pyproject.toml`:

```python
[build-system]
requires = ["setuptools>=65", "setuptools_scm[toml]>=7", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "my_project"
description = "description"
readme = { file = "README.md", content-type = "text/markdown" } # P1?
requires-python = ">=3.8"
version = "0.0.1"
classifiers = [
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Operating System :: POSIX :: Linux",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Mathematics",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
"Topic :: Software Development",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Programming Language :: Python",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
```

and its corresponding rule:

```starlark
py_wheel(
name = "my_wheel",
pyproject_toml = "://pyproject.toml"
)
```

### Describe alternatives you've considered.

I can contribute the implementation upstream if this makes sense. I believe we already have tomli available so it should be relatively straightforward for implementation.

贡献指南

打开贡献指南

调研方向

首先检查现有的 py_wheel 规则以及 rules_python 当前如何处理 wheel 元数据,然后确认可用的 tomli 依赖如何解析 pyproject.toml。当 py_wheel 目标能够使用所示的 [project] 元数据并生成相应的 wheel,且涵盖受支持的字段时,这项工作就完成了。

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

评估

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

把新 issue 发到你的邮箱

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