python / python/mypy

Automatically detect when uv is being used

Offen
#18,971 5 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature topic-usability
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

Feature

If .venv/bin/python exists in the root of the project (where the pyproject.toml file is), then automatically use it as the python executable with priority over /usr/bin/python.

Pitch

This feature would make uv work out of the box, instead of a user having to figure out that they need to add --python-executable=.venv/bin/python to the mypy command that they run.

Alternative solutions

There could also be a help note if .venv/bin/python exists and mypy cannot find implementations or library stubs for the majority of the imports, that suggests adding --python-executable=.venv/bin/python to the mypy command.

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Rechercherichtung

Beginne damit, die bestehende Option --python-executable und nachzuverfolgen, wie mypy die Projektwurzel mit pyproject.toml findet. Prüfe das Verhalten, wenn .venv/bin/python vorhanden ist, einschließlich seines Vorrangs gegenüber /usr/bin/python, und ergänze Tests für die automatische Auswahl; fertig ist die Änderung, wenn uv-Projekte ohne die zusätzliche Option funktionieren.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 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.