python / python/mypy

api.run has empty reports when crashing early

オープン
#7,534 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

feature priority-1-normal
主要言語
Python
スター
20.6k
フォーク
3.3k
PR マージ指標
PR 指標を取得中

説明

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)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

api.run エントリポイントから開始し、提供された mypy.ini 設定と mypy コマンドを使用して、その動作を CLI と比較します。初期クラッシュを再現し、その後、終了ステータスを維持しながら、api.run が CLI と同じ診断出力を公開することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
python
領域
tooling
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。