dmypy in a metadata reload loop with `--use-fine-grained-cache`
Nessuno ha ancora preso questa issue.
- Lingua principale
- Python
- Stelle
- 20.6k
- Fork
- 3.3k
- Metriche di merge delle PR
- Metriche PR in attesa
Descrizione
Bug Report
I'm investigating remote caching, I find that dmypy is spinning for a very long time when using --use-fine-grained-cache. I've tried dmypy check <file> and it takes 10 minutes before I give up. If I used no caching at all, it would take 1.5 minutes, and give me expected answers.
To Reproduce
- produce a cache with
mypy --cache-fine-grained --sqlite-cache --no-incremental --cache-dir=... % dmypy start --log-file debug.log --timeout=3600 -- --use-fine-grained-cache --cache-dir=<cache> --sqlite-cache --verbosetime dmypy check tools/my_tool.py 2>&1 | ts > log.txt
Expected Behavior
fast checks
Actual Behavior
Seems to spin at 100% cpu for a long time. in the log, I see just a bunch of
...
2254727 Sep 25 17:35:45 LOG: Metadata not found for <module>
2254728 Sep 25 17:35:45 LOG: Using cached AST for <module path> (<module>)
...
for every file in my venv & project. indeed, I see the same modules on repeat:
% grep 'Metadata not found for numpy.fft.helper' log.txt | wc -l
284
which makes me think this is stuck in a loop.
Your Environment
- Mypy version used: mypy 1.10.1 (compiled: yes)
- Mypy command-line flags: (see above)
- Mypy configuration options from
mypy.ini(and other config files):
[mypy]
platform = linux
plugins = private_internal_plugin.py,trio_typing.plugin
skip_cache_mtime_checks = true
allow_any_generics = false
allow_incomplete_defs = false
allow_subclassing_any = false
allow_untyped_decorators = false
allow_untyped_defs = false
warn_redundant_casts = true
warn_unused_ignores = true
warn_return_any = true
implicit_reexport = true
show_error_codes = true
implicit_optional = true
explicit_package_bases = true
local_partial_types = true
exclude = (?x)(<some regex>)
disable_error_code = import-untyped
enable_error_code = ignore-without-code, unused-awaitable, truthy-bool, possibly-undefined
- Python version used: Python 3.11.10
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Riprodurre con il comando di generazione della cache di mypy elencato e i comandi dmypy start/check, acquisendo debug.log e log.txt. Iniziare tracciando le voci ripetute “Metadata not found” e “Using cached AST”, inclusa la ripetizione di numpy.fft.helper. Il lavoro è completato quando dmypy check termina senza il ciclo di ricaricamento dei metadati ed è sostanzialmente più veloce dell’esecuzione senza cache.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python, sqlite
- Ambito
- cli, devtools, performance
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100