Infer `python_version` from `project.requires-python` when using pyproject.toml
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Feature
Per the docs, the [mypy] python_version configuration option defaults to "the version of the Python interpreter used to run mypy." We should change this so that it is instead derived from the project.requires-python when the mypy configuration itself is defined in a pyproject.toml file, similar to what ruff currently does for ruff.target-version.
Pitch
Using the system Python version is almost always the wrong thing to do when running against a package that specifies a minimum supported Python version via their pyproject.toml file. This necessitates use of the [mypy] python_version option, even though it (perhaps partially) duplicates information already available. Automatically detecting a value for [mypy] python_version when not explicitly specified would be a neat little UX win.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia tracciando il modo in cui mypy legge la propria configurazione da pyproject.toml e risolve l’opzione [mypy] python_version. La modifica è completa quando un valore non specificato viene ricavato da project.requires-python, mentre un python_version configurato esplicitamente continua ad avere la precedenza; confronta il comportamento previsto con ruff.target-version.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- devtools
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Tranquilla
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 58/100