bazel-contrib / bazel-contrib/rules_python

Add repl_env dependency support

Aperta
#3,200 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Starlark
Stelle
688
Fork
721
Merge medio
15h 7m
PR unite (30g)
76

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
build-system
Tipo di issue
Funzionalità
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.