Skip to content

Enable mypy parallel workers in pre-commit#2185

Open
adamtheturtle wants to merge 2 commits intomainfrom
chore/mypy-docs-parallel-workers
Open

Enable mypy parallel workers in pre-commit#2185
adamtheturtle wants to merge 2 commits intomainfrom
chore/mypy-docs-parallel-workers

Conversation

@adamtheturtle
Copy link
Copy Markdown
Member

@adamtheturtle adamtheturtle commented May 7, 2026

Summary

  • enable parallel doc example execution for mypy-docs via doccmd --example-workers 4
  • keep mypy invocation compatible with current mypy CLI while fixing doccmd hook wiring
  • add uv as an explicit mypy-docs hook dependency for consistent hook environment resolution

Test plan

  • pre-commit run --hook-stage pre-push mypy --all-files
  • pre-commit run --hook-stage pre-push mypy-docs --all-files

Made with Cursor


Note

Low Risk
Low risk: only adjusts local pre-commit hook 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 mypy pre-push hook is updated to invoke mypy with --num-workers=4.

Docs type-checking is aligned and stabilized. The mypy-docs hook is rewired to run mypy --num-workers=4 via doccmd and now explicitly includes uv in additional_dependencies to 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.

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>
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread .pre-commit-config.yaml
name: mypy
stages: [pre-push]
entry: uv run --extra=dev -m mypy
entry: uv run --extra=dev -m mypy --num-workers=4
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit f455ade. Configure here.

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.

1 participant