python / python/mypy

api.run has empty reports when crashing early

Aperta
#7,534 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

feature priority-1-normal
Lingua principale
Python
Stelle
20.6k
Fork
3.3k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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)

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia dal punto di ingresso api.run e confronta il suo comportamento con quello della CLI usando la configurazione mypy.ini fornita e il comando mypy. Riproduci l'arresto anomalo iniziale, quindi verifica che api.run esponga lo stesso output diagnostico della CLI, mantenendo lo stato di uscita.

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

Valutazione

Stack tecnologico
python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.