bazel-contrib / bazel-contrib/rules_python

multi_pip_parse should support platform specific requirement files

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

I think we should extend the functionality of `multi_pip_parse` to deal with platform specific requirement files better.

### Description
Currently you can do this to have different lock files on different versions of python
```
multi_pip_parse(
...
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```
but the platform specific attributes take strings (and not dict) so you can only have a single requirements file on a specific platform
```
multi_pip_parse(
...
requirements_linux = "//requirements:requirements_lock_3_12_linux.txt",
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```
The platform specific requirements should also allow you to specify a dict so we can express the proper requirements files on various platforms

### Describe the solution you'd like
Ideally it would just look like this
```
multi_pip_parse(
...
requirements_linux = {
"3.10": "//:requirements_lock_3_10_linux.txt",
"3.12": "//:requirements_lock_3_12_linux.txt",
},
requirements_lock = {
"3.10": "//:requirements_lock_3_10.txt",
"3.12": "//:requirements_lock_3_12.txt",
},
)
```

### Describe alternatives you've considered
I'm not really sure there are any good alternative solutions, this feels like it is just missing functionality

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

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

Hướng nghiên cứu

Điểm vào là multi_pip_parse; hãy bắt đầu bằng cách lần theo cách requirements_lock và requirements_linux được khai báo và lựa chọn. So sánh cách xử lý từ điển phiên bản Python hiện có với các thuộc tính dành riêng cho nền tảng. Hoàn thành khi các thuộc tính dành riêng cho nền tảng chấp nhận các ánh xạ phiên bản-sang-nhãn được示されている và vẫn giữ nguyên hành vi chuỗi hiện tạ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
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.