python / python/mypy

api.run has empty reports when crashing early

Offen
#7,534 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

feature priority-1-normal
Vorherrschende Sprache
Python
Sterne
20.6k
Forks
3.3k
PR-Merge-Kennzahlen
PR-Kennzahlen ausstehend

Beschreibung

I'm seeing a case where CLI would ouput useful messages but api.run is not. This causes https://github.com/PyCQA/prospector to think that the mypy run was successful when it wasn't (granted, prospector should look at exit_status).

mypy.ini

[mypy]
plugins = mypy_django_plugin.main
warn_return_any = True
warn_unused_configs = True
disallow_subclassing_any = True
disallow_any_generics = True
disallow_untyped_calls = True
disallow_untyped_defs = True
disallow_incomplete_defs = True
check_untyped_defs = True
disallow_untyped_decorators = True
no_implicit_optional = True
warn_redundant_casts = True
warn_unused_ignores = True
mypy_path = stubs

[mypy.plugins.django-stubs]
django_settings_module = "imake.settings"

Output of CLI

env PYTHONPATH=(pwd) mypy core/shortcuts.py
oscar_forks/catalogue/models.py:6: error: Module 'oscar.apps.catalogue.abstract_models' has no attribute 'AbstractCategory'
oscar_forks/catalogue/models.py:21: error: Class cannot subclass 'AbstractCategory' (has type 'Any')
stubs/oscar/apps/catalogue/abstract_models.pyi:3: error: INTERNAL ERROR -- Please try using mypy master on Github:
https://mypy.rtfd.io/en/latest/common_issues.html#using-a-development-mypy-build
If this issue continues with mypy master, please report a bug at https://github.com/python/mypy/issues
version: 0.720
stubs/oscar/apps/catalogue/abstract_models.pyi:3: : note: please use --show-traceback to print a traceback when reporting a bug

Return value of api.run

('', '', 2)

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 am Einstiegspunkt api.run und vergleiche sein Verhalten mit der CLI unter Verwendung der bereitgestellten mypy.ini-Konfiguration und des mypy-Befehls. Reproduziere den frühen Absturz und überprüfe anschließend, dass api.run dieselbe diagnostische Ausgabe wie die CLI bereitstellt, während der Exit-Status erhalten bleibt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.