bazel-contrib / bazel-contrib/rules_python

Support building from `sdist` in a build action

Đang mở
#2,410 14 bình luận 2 reaction 0 người được giao Xem trên GitHub
help wanted type: feature request type: pip
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ả

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.

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

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

Hướng nghiên cứu

Xem xét luồng repository_rule và build-action hiện có, sau đó kiểm tra cách các dependency trong pyproject.toml được xử lý. Sử dụng rule sdist_archive được đề xuất và PEP 621 làm điểm bắt đầu, đồng thời xác định hỗ trợ cho các dependency build, build backend và extension Python. Công việc được xem là hoàn tất khi thiết kế được hỗ trợ và phạm vi triển khai đã được thống nhất, thay vì vẫn bị bỏ ngỏ dưới dạng các câu hỏi.

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
Cần làm rõ
Mức phù hợp với người mới
28/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.