"--install-types not supported in this mode of running mypy" even with `--non-interactive`
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
Bug Report
When running mypy with redirected stdout / stderr (for example, via mypy.api.run), --install-types fails with:
error: --install-types not supported in this mode of running mypy
Per the comment, this is because --install-types performs user input. However, when --non-interactive is specified, no user input is necessary, and this error should not be raised.
To Reproduce
- Create a file
src/foo.pylike:
# src/foo.py
from mypy.api import run
_, _, exit_code = run(["--install-types", "--non-interactive", "src"])
assert exit_code == 0
- Run
python src/foo.py
Expected Behavior
The program exits with exit code 0.
Actual Behavior
Traceback (most recent call last):
File "src/foo.py", line 4, in <module>
assert exit_code == 0
AssertionError
Your Environment
- Mypy version used: 0.910
- Mypy command-line flags:
--install-types --non-interactive src(invoked via api) - Mypy configuration options from
mypy.ini(and other config files): N/A - Python version used: Python 3.7.5
- Operating system and version: Ubuntu 18.04.5 LTS (Bionic Beaver)
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne damit, die Prüfung des --install-types-Modus in mypy/main.py zu untersuchen, und reproduziere den Fehler über mypy.api.run mit --non-interactive. Erledigt ist die Aufgabe, wenn dieser Aufruf nicht mehr meldet, dass der Modus nicht unterstützt wird, und mit dem Exit-Code 0 endet.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 55/100