bazel-contrib / bazel-contrib/rules_python

Generate one Bazel repo per dependency

Đang mở
#2,370 10 bình luận 0 reaction 0 người được giao Xem trên GitHub
need: repro
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()` module extension

### Description

When the same pip package is (transitively) depended upon multiple times from different `requirements.txt` files, it is undefined which version will be chosen (both are added to the PYTHONPATH and the order of deps decides which one takes precedence).
This is especially problematic for transitive dependencies of module dependencies where one only has limited to no influence of which version is chosen. This is especially problematic for fundamental libraries like Protobuf which gets pulled in transitively in many `requirements.txt`.
The way this is handled in golang, is that every dependency is its own Bazel repo and as such takes part in version resolution. This makes sure that every package only exists once within a given Bazel workspace.

### Describe the solution you'd like

Generate one Bazel repo per pip dependency.

### Describe alternatives you've considered

For the transition period, `rules_python` could generate both, one repo for all of `requirements.txt` and one repo per dependency. This way, users can easily migrate from one approach to another. In a future major version, the old functionality could be removed.

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

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

Hướng nghiên cứu

Bắt đầu với phần mở rộng mô-đun `pip.parse()` và theo dõi cách nhiều tệp `requirements.txt` trở thành các repository và mục nhập PYTHONPATH. So sánh mô hình repository hiện tại chứa tất cả dependency với mô hình theo từng dependency được yêu cầu, bao gồm cả giai đoạn chuyển tiếp được đề xuất; được coi là hoàn thành khi mỗi dependency của pip có repository Bazel riêng và việc chọn phiên bản không còn được quyết định bởi thứ tự của các dependency.

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, tooling
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
30/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.