The execution results of dmypy are not as expected
オープン
まだ誰も着手していません。
bug
topic-daemon
- 主要言語
- Python
- スター
- 20.6k
- フォーク
- 3.3k
- PR マージ指標
- PR 指標を取得中
説明
Operation steps
- I start a daemon server
command = [
'dmypy', '--status-file', status_file_name, 'start', '--log-file', mypy_server_log_name,
'--', '--show-column-numbers', '--show-error-end'
]
process = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = process.communicate()
- use command line to check
dmypy --status-file xxxx.json check -v xxx.py
It can output the correct result
- use python to write file,and use command line to check again
with open(path, 'w') as file:
file.write(content)
It can not output any issue,like:
Success: no issues found in 1 source file
err :
out : Success: no issues found in 1 source file\n
platform : darwin
python_version : 3_11
roundtrip_time : 1.148
stats : {'find_module_time': 0.006188869476318359, 'find_module_calls': 673, 'update_isolated_time': 0.0071163177490234375, 'propagate_time': 1.1365551948547363, 'find_changes_time': 0.00043392181396484375, 'fg_update_time': 6.198883056640625e-06, 'refresh_suppressed_time': 0.0006737709045410156, 'find_added_supressed_time': 0.0018012523651123047, 'cleanup_time': 1.1443119049072266}
status
- BUT if I use mypy instead of dmypy,It can output correct result:
mypy xxx.py
Found 8 errors in 6 files (checked 1 source file)
err :
out : c8f34f1c-8173-4437-b07f-8d7f8c7f7210/FLO ... 1725 more characters
platform : darwin
python_version : 3_11
roundtrip_time : 0.160
stats : {'validate_meta_time': 8.96453857421875e-05, 'files_parsed': 34, 'modules_parsed': 22, 'stubs_parsed': 12, 'parse_time': 0.01146078109741211, 'find_module_time': 0.01342916488647461, 'find_module_calls': 3688, 'semanal_time': 0.018131256103515625, 'typecheck_time': 0.014755964279174805, 'finish_passes_time': 0.007950305938720703, 'load_fg_deps_time': 1.5020370483398438e-05, 'update_isolated_time': 0.1284799575805664, 'propagate_time': 0.02331995964050293, 'find_changes_time': 0.0006420612335205078, 'fg_update_time': 0.1564321517944336, 'refresh_suppressed_time': 0.0005068778991699219, 'find_added_supressed_time': 0.0013458728790283203, 'cleanup_time': 0.0001461505889892578}
status : 1
- If I manually change the python file slightly,the dmypy can ouput correct result again
Your Environment
- Mypy version used: 1.10.1
Is there anything special about the caching logic of this dmypy? Will all information be lost if the file is regenerated?
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
dmypy start、dmypy check、生成された Python ファイル、状態ファイルを使って報告された手順を再現し、その後 mypy のバージョン 1.10.1 と比較してください。まず、dmypy のインクリメンタルキャッシュ動作と、ファイルを書き換えることでキャッシュされた状態が無効になるかどうかを調査してください。ファイルの再生成後に dmypy が mypy と同じ型エラーを報告すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- tooling
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- 説明が足りない
- 初心者へのやさしさ
- 35/100