bazel-contrib / bazel-contrib/rules_python

Smooth IDE support for python_rules

Aperta
#1,401 13 commenti 20 reazioni 0 assegnatari Vedi su GitHub
type: feature request type: pip
Lingua principale
Starlark
Stelle
688
Fork
721
Merge medio
15h 7m
PR unite (30g)
76

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Inizia esaminando l’integrazione dell’editor e degli strumenti di rules_go collegata nell’issue, quindi confronta il modo in cui pyright e ruff-lsp individuano gli import Python di terze parti e gli import Python generati da Bazel. Il lavoro sarà completo quando fornirà un’integrazione dell’editor documentata e ripetibile che supporti il controllo dei tipi delle dipendenze, il completamento automatico e il codice protobuf generato, senza dover creare manualmente un ambiente virtuale corrispondente.

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

Valutazione

Stack tecnologico
python
Ambito
build-system, developer-experience, tooling
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Attiva
Chiarezza
Abbastanza chiara
Idoneità per principianti
42/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.