The execution results of dmypy are not as expected
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 20.6k
- Forks
- 3.3k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
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?
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Reproduziere die gemeldete Abfolge mit dmypy start, dmypy check, der generierten Python-Datei und der Statusdatei und vergleiche sie anschließend mit mypy in Version 1.10.1. Beginne damit, das inkrementelle Caching-Verhalten von dmypy zu untersuchen und ob das erneute Schreiben der Datei ihren gecachten Zustand ungültig macht. Als erledigt gilt die Aufgabe, wenn dmypy dieselben Typfehler wie mypy meldet, nachdem die Datei neu generiert wurde.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- tooling
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Veraltet
- Klarheit
- Muss geklärt werden
- Anfängerfreundlichkeit
- 35/100