Skip to content

trace log both current and prior plugin hash values#20759

Merged
ilevkivskyi merged 1 commit intopython:masterfrom
cburroughs:cbs/hash-debug
Feb 6, 2026
Merged

trace log both current and prior plugin hash values#20759
ilevkivskyi merged 1 commit intopython:masterfrom
cburroughs:cbs/hash-debug

Conversation

@cburroughs
Copy link
Contributor

I was debugging an issue where cache entries were being invalidated due to a plugin hash not matching. It would have helped a little to have both hashes listed so I could see which plugin didn't match and have the hash to go hunt down the problem file on my workstation.

In this repo, first run (no cache):

 $ mypy --config-file mypy_self_check.ini -vv mypy 2> l
Success: no issues found in 190 source files
(.venv) ecsb@fw16 ~/src/o/c-mypy (cbs/hash-debug) $ grep Plugin l
TRACE: Plugins snapshot (fresh) {"mypy.plugins.proper_plugin": "none:4449d775ee477b70f3e3ad7268db2128dae4324d"}

Second run:

$ mypy --config-file mypy_self_check.ini -vv mypy 2> l2
Success: no issues found in 190 source files
$ grep Plugin l2
TRACE: Plugins snapshot (cached) {"mypy.plugins.proper_plugin":"none:4449d775ee477b70f3e3ad7268db2128dae4324d"}
TRACE: Plugins snapshot (fresh) {"mypy.plugins.proper_plugin": "none:4449d775ee477b70f3e3ad7268db2128dae4324d"}

I was debugging an issue where cache entries were being invalidated
due to a plugin hash not matching.  It would have helped a little to
have both hashes listed so I could see which plugin didn't match and
have the hash to go hunt down the problem file on my workstation.

In this repo, first run (no cache):

```
 $ mypy --config-file mypy_self_check.ini -vv mypy 2> l
Success: no issues found in 190 source files
(.venv) ecsb@fw16 ~/src/o/c-mypy (cbs/hash-debug) $ grep Plugin l
TRACE: Plugins snapshot (fresh) {"mypy.plugins.proper_plugin": "none:4449d775ee477b70f3e3ad7268db2128dae4324d"}
```

Second run:
```
$ mypy --config-file mypy_self_check.ini -vv mypy 2> l2
Success: no issues found in 190 source files
$ grep Plugin l2
TRACE: Plugins snapshot (cached) {"mypy.plugins.proper_plugin":"none:4449d775ee477b70f3e3ad7268db2128dae4324d"}
TRACE: Plugins snapshot (fresh) {"mypy.plugins.proper_plugin": "none:4449d775ee477b70f3e3ad7268db2128dae4324d"}
```
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@ilevkivskyi ilevkivskyi merged commit 29a6f68 into python:master Feb 6, 2026
23 checks passed
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.

2 participants