bazel-contrib / bazel-contrib/rules_python

Override a requirement with a Bazel target

Open
#385 15 comments 14 reactions 0 assignees View on GitHub
type: feature request
Dominant language
Starlark
Stars
688
Forks
721
Avg merge
14h 49m
Merged PRs (30d)
81

Description

# 🚀 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

ø

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.