python / python/mypy

Setting --shadow-file makes dmypy reload daemon(perf issue)

Open
#9,309 6 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

This is a bug report.

  • Minimal repro
$ touch test.py
$ cp test.py /tmp/test.py
$ dmypy run test.py
Daemon started
Success: no issues found in 22 source files
$ dmypy run test.py
Success: no issues found in 1 source file
$ dmypy run -- --shadow-file test.py /tmp/test.py test.py 
Restarting: configuration changed
Daemon stopped
Daemon started
Success: no issues found in 22 source files
  • What is the actual behavior/output?
    dmypy interprets setting --shadow-file as a "configuration change" and reloads the mypy daemon. This effectively counteracts the whole point of having a daemon since it takes a long time to reload the daemon.
  • What is the behavior/output you expect?
    dmypy should not interpret --shadow-file changes as configuration changes. It should use the existing daemon instead of reloading.
  • What are the versions of mypy and Python you are using?
    Python 3.8.2.
    mypy 0.790+dev.2e9afec83a5214f4a0eaf57a96034230b8460379
    The mypy install is from Github master as of thirty minutes ago.
  • What are the mypy flags you are using? (For example --strict-optional)
    The repro above describes this. There are no mypy.ini (or friends) files in the directory.

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 tracing how dmypy processes the --shadow-file option and decides that configuration has changed. Use the minimal reproduction to verify that changing the shadow file does not stop or restart the daemon, while type checking still succeeds with the expected source-file count.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.