Enable mypy parallel workers in pre-commit#2185
Conversation
Co-authored-by: Cursor <cursoragent@cursor.com>
Align mypy and mypy-docs entries with inline --num-workers=4 usage and remove the example-workers variant. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit f455ade. Configure here.
| name: mypy | ||
| stages: [pre-push] | ||
| entry: uv run --extra=dev -m mypy | ||
| entry: uv run --extra=dev -m mypy --num-workers=4 |
There was a problem hiding this comment.
Using mypy 2.0 flag with pinned 1.20.2 version
High Severity
The --num-workers=4 flag is a mypy 2.0 feature (parallel type checking), but the project pins mypy[faster-cache]==1.20.2 in pyproject.toml and uv.lock. Since uv run --extra=dev -m mypy resolves to the locked 1.20.2 version, both the mypy and mypy-docs hooks will fail with an unrecognized argument error. The mypy 1.20 release blog and release planning issue (#20726) confirm parallel type checking was planned exclusively for 2.0.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit f455ade. Configure here.


Summary
mypy-docsviadoccmd --example-workers 4mypyinvocation compatible with current mypy CLI while fixing doccmd hook wiringuvas an explicitmypy-docshook dependency for consistent hook environment resolutionTest plan
pre-commit run --hook-stage pre-push mypy --all-filespre-commit run --hook-stage pre-push mypy-docs --all-filesMade with Cursor
Note
Low Risk
Low risk: only adjusts local
pre-commithook commands/dependencies; main impact is potential differences in hook runtime/perf and any mypy nondeterminism under parallelism.Overview
Pre-push mypy checks now run in parallel. The
mypypre-push hook is updated to invokemypywith--num-workers=4.Docs type-checking is aligned and stabilized. The
mypy-docshook is rewired to runmypy --num-workers=4viadoccmdand now explicitly includesuvinadditional_dependenciesto ensure the hook environment resolves consistently.Reviewed by Cursor Bugbot for commit f455ade. Bugbot is set up for automated code reviews on this repo. Configure here.