bazel-contrib / bazel-contrib/rules_python

Allow specifying dependencies directly in `pip.parse`

Đang mở
#2,271 6 bình luận 1 reaction 0 người được giao Xem trên GitHub
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ả

# 🚀 feature request

### Relevant Rules

`pip.parse()` (not a rule, but the module extension tag)

### Description

Just putting this out there to gather feedback and see if it's worth implementing myself. I use Python as a pretty minor part of my polyglot Bazel codebase, and it has a single PyPI dependency. Call me petty, but I just don't like having to put that 1 dependency in its own `requirements.txt` file when all my other dependencies are listed directly in `MODULE.bazel`.

### Describe the solution you'd like

Is there any appetite for adding a new parameter to `pip.parse()` called `requirements` (as an alternative to `requirements_lock`) which is just a Starlark list of strings that get parsed as though they were the lines of a `requirements.txt` file? This would be kinda nice for really simple cases like mine, but perhaps "not recommended" for larger Python projects.

### Describe alternatives you've considered

Alternatives already exist, but if the maintainers would welcome a PR to this effect, then I can draft one up.

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 xác định phần triển khai extension của pip.parse() và đọc cách tham số requirements_lock hiện có được xử lý. So sánh ngữ nghĩa của danh sách requirements được đề xuất với đường dẫn phân tích requirements.txt hiện tại; được xem là hoàn tất khi các chuỗi dependency Starlark trực tiếp hoạt động trong các trường hợp đơn giản và các test liên quan bao phủ tham số mớ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ó
4/5
Thời gian dự kiến
3-5 ngày
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
38/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.