bazel-contrib / bazel-contrib/rules_python

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

Đang mở
#1,103 10 bình luận 1 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Starlark
Star
688
Fork
721
Merge trung bình
15 giờ 7 phút
Pull request đã merge (30 ngày)
76

Mô tả

# 🚀 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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Bắt đầu bằng cách xem xét rule py_wheel hiện có và cách rules_python hiện xử lý metadata của wheel, sau đó xác nhận cách dependency tomli khả dụng có thể phân tích pyproject.toml. Công việc hoàn tất khi một target py_wheel có thể sử dụng metadata [project] được nêu và tạo ra wheel tương ứng, với coverage cho các trường được hỗ trợ.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
python
Lĩnh vực
build-system
Loại issue
Tính năng
Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.