bazel-contrib / bazel-contrib/rules_python

Override a requirement with a Bazel target

Ouverte
#385 15 commentaires 14 réactions 0 personnes assignées Voir sur GitHub
type: feature request
Langage dominant
Starlark
Étoiles
688
Forks
721
Merge moyen
15 h 7 min
PR mergées (30 j)
76

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

ø

Guide de contribution

Ouvrir le guide de contribution

Piste de recherche

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.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
python
Domaine
build-system
Type d'issue
Fonctionnalité
Difficulté
4/5
Temps estimé
3-5 jours
Activité
Active
Clarté
Plutôt claire
Accessibilité débutants
48/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.