bazel-contrib / bazel-contrib/rules_python

Add repl_env dependency support

Offen
#3,200 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Starlark
Sterne
688
Forks
721
Ø Merge
15 Std. 7 Min.
Gemergte PRs (30 T.)
76

Beschreibung

# 🚀 feature request

### Relevant Rules

Relevant rules are `//python/bin:repl` & `//python/bin:repl_env`.

### Description

Goal would be to enable repl use similar to how is is used now:
`bazel run @rules_python//python/bin:repl --@rules_python//python/bin:repl_dep=//python:my_rule_with_deps`
This is how I start interactive shells with access to runfiles and python packages depended on by the specified label.

It would be convenient to also enable the same for environment variables specified in that label. Could potentially be added to repl_dep. Alternative is:
--@rules_python//python/bin:repl_env=//python:my_rule_with_deps

### Potential Solution

Could add env attr assingment [here](https://github.com/bazel-contrib/rules_python/blob/bb2aad2d1e3f883c9cdc2264e0b4a2815233db57/python/bin/BUILD.bazel#L34).

kwargs forwarding should take care of any changes needed in py_binary_rule impl (I think).

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start at python/bin/BUILD.bazel around line 34 and inspect the //python/bin:repl and //python/bin:repl_env definitions, including how repl_dep is handled. Determine whether environment variables from the label passed to repl_dep should be supported or exposed through repl_env, then verify that the interactive shell receives those variables when run with the specified label.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
build-system
Issue-Typ
Feature
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
42/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.