bazel-contrib / bazel-contrib/rules_python

Add repl_env dependency support

オープン
#3,200 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Starlark
スター
688
フォーク
721
平均マージ
15時間 7分
マージ済み PR(30日)
76

説明

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

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

python/bin/BUILD.bazel の 34 行目付近から開始し、//python/bin:repl と //python/bin:repl_env の定義を調べます。repl_dep がどのように扱われているかも確認してください。repl_dep に渡された label の環境変数をサポートするべきか、または repl_env を通じて公開するべきかを判断し、その後、指定された label で実行したときにインタラクティブシェルがそれらの変数を受け取ることを検証してください。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
build-system
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。