Mypy does not recheck files when follow_imports changes for dependencies
オープン
まだ誰も着手していません。
bug
priority-0-high
topic-fine-grained-incremental
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Steps to reproduce
- Create module test.py with import from nonexistent module:
from foo import bar
- Create mypy.ini file:
[mypy]
[mypy-foo]
ignore_missing_imports = True
- Run
mypy
$ mypy test.py
Success: no issues found in 1 source file
- Comment out
[mypy-foo]section in mypy.ini
[mypy]
# [mypy-foo]
# ignore_missing_imports = True
- Run
mypy
$ mypy test.py
Success: no issues found in 1 source file
Expected result
After step 4, mypy should detect config change and (partially?) invalidate cache, leading to a type error.
$ mypy test.py
test.py:1: error: Cannot find module named 'foo'
test.py:1: note: See https://mypy.readthedocs.io/en/latest/running_mypy.html#missing-imports
Found 1 error in 1 file (checked 1 source file)
Notes
- Deleting
.mypy_cache/and re-runningmypyfixes the issue. - Adding/removing
ignore_missing_importsin the main[mypy]section does seem to invalidate the cache as expected. So this issue only seems to apply to[mypy-PATTERN]sections.
Versions
$ python --version
Python 3.7.3
$ mypy --version
mypy 0.740
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
示されている設定手順を使って、test.py、mypy.ini、および .mypy_cache/ ディレクトリで問題を再現します。まず、[mypy-PATTERN] セクションのキャッシュ無効化を追跡し、メインの [mypy] セクションの変更と比較します。パターンセクションを変更すると、キャッシュを手動で削除しなくても、mypy が欠落している foo モジュールを報告するようになれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- devtools
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 48/100