Skip to content

Document how the daemon handles a changing set of source files - #22243

Open
Madin-H23 wants to merge 1 commit into
python:masterfrom
Madin-H23:docs/daemon-source-set
Open

Madin-H23 wants to merge 1 commit into
python:masterfrom
Madin-H23:docs/daemon-source-set

Conversation

@Madin-H23

Copy link
Copy Markdown

Fixes #15622.

The daemon documentation says that "Each mypy daemon process supports one user and one set of source files", but it does not say what happens when that set changes between runs — in particular whether adding a file to the command line requires a restart and loses the cached state.

It does not. The running daemon picks up files added to the command line and type checks them without a restart, so the cached state is preserved. To type check different sets of files at the same time, run one daemon per set, each with its own status file.

Verified with a daemon started from a checkout of main:

$ dmypy run -- a.py
Daemon started
Success: no issues found in 1 source file

$ dmypy run -- a.py b.py
b.py:2: error: Incompatible return value type (got "str", expected "int")  [return-value]
Found 1 error in 1 file (checked 2 source files)

The second run reuses the running daemon (no "Restarting:" message) and reports the error in the newly added file.

The documentation builds cleanly with sphinx-build -W.

🤖 This contribution was drafted with AI assistance; the analysis, the change and the verification are described above so that they can be reviewed.

…n#15622)

The daemon documentation only mentioned that a daemon process supports
one set of source files, leaving open whether adding a file to the
command line requires a restart (and loses the cached state).

The running daemon picks up files added to the command line and type
checks them without a restart, so the cached state is preserved.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clarification regarding dmypy and "one set of source files"

1 participant