python / python/mypy

Daemon mode mypy checks way more files the second time with the same command run

Open
#17,272 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Bug Report

Daemon mode mypy takes a long time to check the same file with no modifications done

To Reproduce

git clone https://github.com/Ryang20718/mypy-repro
cd mypy-repro
python3 -m venv .venv
pip install -r requirements.txt
dmypy run example/c.py
dmypy run example/c.py

Expected Behavior

I'd expect dmypy to report no issues both times, but it hangs the second time

Actual Behavior

based on the timing file, we see time spent on numpy

(.venv)mypyrepro ryang$ dmypy run example/c.py 
Daemon started
Success: no issues found in 1 source file
(.venv) mypyrepro ryang$ dmypy run example/c.py 
Success: no issues found in 1087 source files

Your Environment

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

Reproduce the issue with the listed virtualenv, mypy.ini, and repeated dmypy run example/c.py commands. Compare the first and second runs, including the timing file and unexpected numpy checks, then trace the daemon's incremental work. Done means the unchanged second command checks only the requested file and reports the expected result without the long delay.

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
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.