bazel-contrib / bazel-contrib/rules_python

Override a requirement with a Bazel target

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

`load("@rules_python//python:pip.bzl", "pip_install")`

### Description

We'd like to be able to override a `requirement` with a Bazel target. This is basically the `rules_python` equivalent of `rules_jvm_external`'s [`override_targets` directive](https://github.com/bazelbuild/rules_jvm_external#overriding-generated-targets).

Consider the case where we're using grpc and protobuf from Bazel, and an external python library depends on `protobuf==3.13.0` (or whatever). I'd like to replace that dependency with `"@com_google_protobuf//:protobuf_python"` instead, so I'm not mixing pypi and Bazel versions of `protobuf`.

### Describe the solution you'd like

I like the way that `rules_jvm_external` has done it.

### Describe alternatives you've considered

ø

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

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

Hướng nghiên cứu

Start with the pip_install rule described in the issue and compare its dependency handling with rules_jvm_external's override_targets directive. The change is done when a Python requirement can be replaced by the specified Bazel target without mixing the corresponding PyPI and Bazel dependencies.

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
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
48/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.