python / python/mypy

`--use-fine-grained-cache` for `dmypy` hangs

Open
#10,735 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug topic-daemon topic-fine-grained-incremental
Dominant language
Python
Stars
20.6k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

According to the docs (https://mypy.readthedocs.io/en/stable/additional_features.html?highlight=caching#caching-with-mypy-daemon) enabling the fine grained cache should help speed up initial mypy runs. However, this doesn't seem to be working, and dmypy seems to hang when using it:

# Slow initial run (mypy):
❯ rm -r .mypy_cache
❯ time mypy --cache-fine-grained .
mypy --cache-fine-grained .  82.04s user 9.06s system 97% cpu 1:33.69 total

# Faster cached run (mypy)
❯ time mypy --cache-fine-grained .
mypy --cache-fine-grained .  45.68s user 6.77s system 95% cpu 54.732 total

# Slow initial run (daemon)
❯ dmypy stop
❯ time dmypy run .
dmypy run .  0.32s user 0.31s system 0% cpu 1:23.13 total

# Faster cached run (daemon)
❯ time dmypy run .
dmypy run .  0.08s user 0.06s system 12% cpu 1.124 total

# Initial run using mypy cache (daemon)
❯ dmypy stop
❯ time dmypy run . -- --use-fine-grained-cache
# Nothing happening for at least 10 minutes...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the documented caching workflow with dmypy run . -- --use-fine-grained-cache, comparing it with mypy --cache-fine-grained . and normal dmypy run .. Trace the dmypy fine-grained-cache entry point and determine why the initial run does not complete; done means the command finishes and uses the cache as described in the caching documentation.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.