bazel-contrib / bazel-contrib/rules_python

Smooth IDE support for python_rules

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

説明

# 🚀 feature request

### Description

I would like smooth editor support of the python_rules. Now when I open an editor (tried [helix](https://helix-editor.com/) and vscode) neither recognizes any of the third party imports properly breaking autocomplete and type checking.

### Describe the solution you'd like

Something like what the [rules_go people have done](https://github.com/bazelbuild/rules_go/wiki/Editor-and-tool-integration) but I imagine that pyright (the most commonly used python language server) does not have support for something similar to the gopackagedriver.. So I was thinking more along the lines of a shell script that manipulates `PATH` and `PYTHONPATH` to achieve something similar. still hacky but better than what I have now. It's also something that would work for other python language server's such as [ruff-lsp](https://github.com/astral-sh/ruff-lsp).

### Describe alternatives you've considered

Manually make a venv with the same dependencies and activate that before starting my editor. Works fine but it's hackish and it won't work for generated code. For example python files generated from protobuf by Bazel..

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

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

調査の方向性

Start by reviewing the rules_go editor and tool integration linked in the issue, then compare how pyright and ruff-lsp discover third-party and Bazel-generated Python imports. Done should provide a documented, repeatable editor integration that supports dependency type checking, autocomplete, and generated protobuf code without manually creating a matching virtual environment.

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

評価

技術スタック
python
領域
build-system, developer-experience, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
42/100

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

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