From 45c220e0a70e955e5a558a5b49a357f79aedadfe Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 17:57:37 +0000 Subject: [PATCH 1/3] Bump mypy pin to ~=2.4.0 - Set `num_workers = "auto"` in [tool.mypy]: parallel checking is no longer experimental in 2.4, and "auto" picks the worker count from the available CPUs (capped at 8). This replaces the CI-only `--num-workers "$(nproc)"` flag, so local `mypy` runs are parallel too. dmypy forces num_workers=0, so `just lint` is unaffected. - Drop `fixed_format_cache = true`: it has been the default since mypy 2.0. - The native parser is now the default; nothing to configure. - No new documented strictness flags or error codes in 2.4 (the new `--check-unreachable` is a hidden flag), so the enable-checks list is unchanged; only the "last updated" marker moves to 2.4. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0188obxQFxxkZRKmsy9fstfd --- project_name/.github/workflows/ci.yml.jinja | 2 +- project_name/pyproject.toml.jinja | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/project_name/.github/workflows/ci.yml.jinja b/project_name/.github/workflows/ci.yml.jinja index 84e3576..a2392c8 100644 --- a/project_name/.github/workflows/ci.yml.jinja +++ b/project_name/.github/workflows/ci.yml.jinja @@ -77,7 +77,7 @@ jobs: - name: List packages run: uv pip list - name: Run mypy - run: uv run --no-sync mypy --num-workers "$(nproc)" + run: uv run --no-sync mypy dependencies: runs-on: ubuntu-latest diff --git a/project_name/pyproject.toml.jinja b/project_name/pyproject.toml.jinja index 96ae755..a094182 100644 --- a/project_name/pyproject.toml.jinja +++ b/project_name/pyproject.toml.jinja @@ -108,7 +108,7 @@ docs = [ "mkdocs-section-index ~=0.3.0", ] typing = [ - "mypy ~=2.3.0", + "mypy ~=2.4.0", "ty ~=0.0", # add "*-stubs" and "types-*" packages here (">=0") ] @@ -186,10 +186,10 @@ src.include = [ [tool.mypy] files = ["src", "tests"] mypy_path = "stubs" -fixed_format_cache = true +num_workers = "auto" # set the platform python_version = "3.{{ python_min }}" -# enable checks [last updated: mypy 2.3] +# enable checks [last updated: mypy 2.4] strict = true strict_equality_for_none = true disallow_any_unimported = true From b8b67ff76825da55587a557d3305bdf1e5db75d0 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 18:01:17 +0000 Subject: [PATCH 2/3] Enable mypy warn_unused_configs Reports [[tool.mypy.overrides]] sections that match no checked module, e.g. a stale ignore_missing_imports for a dropped dependency. It is not part of --strict. mypy 2.4 removed the docs caveat that it requires incremental mode to be off; verified it reports with a warm cache, in parallel mode, and under dmypy. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0188obxQFxxkZRKmsy9fstfd --- project_name/pyproject.toml.jinja | 1 + 1 file changed, 1 insertion(+) diff --git a/project_name/pyproject.toml.jinja b/project_name/pyproject.toml.jinja index a094182..7e8a3a6 100644 --- a/project_name/pyproject.toml.jinja +++ b/project_name/pyproject.toml.jinja @@ -195,6 +195,7 @@ strict_equality_for_none = true disallow_any_unimported = true warn_unreachable = true disallow_any_explicit = true +warn_unused_configs = true enable_error_code = [ # from https://mypy.readthedocs.io/en/stable/error_code_list2.html "redundant-self", From c24f9d1e5545b5f7d20b529cccfe7ad63f8f21b4 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 5 Oct 2026 18:04:53 +0000 Subject: [PATCH 3/3] Pass --num-workers auto in CI instead of the mypy config validate-pyproject (with the schema store) rejects num_workers = "auto": SchemaStore's partial-mypy.json still types num_workers as an integer, so generated projects failed `just lint`. Keep the parallel run in CI via the CLI flag, which accepts "auto" since mypy 2.4, until the schema catches up. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_0188obxQFxxkZRKmsy9fstfd --- project_name/.github/workflows/ci.yml.jinja | 2 +- project_name/pyproject.toml.jinja | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/project_name/.github/workflows/ci.yml.jinja b/project_name/.github/workflows/ci.yml.jinja index a2392c8..6ef6b25 100644 --- a/project_name/.github/workflows/ci.yml.jinja +++ b/project_name/.github/workflows/ci.yml.jinja @@ -77,7 +77,7 @@ jobs: - name: List packages run: uv pip list - name: Run mypy - run: uv run --no-sync mypy + run: uv run --no-sync mypy --num-workers auto dependencies: runs-on: ubuntu-latest diff --git a/project_name/pyproject.toml.jinja b/project_name/pyproject.toml.jinja index 7e8a3a6..9a2d445 100644 --- a/project_name/pyproject.toml.jinja +++ b/project_name/pyproject.toml.jinja @@ -186,7 +186,6 @@ src.include = [ [tool.mypy] files = ["src", "tests"] mypy_path = "stubs" -num_workers = "auto" # set the platform python_version = "3.{{ python_min }}" # enable checks [last updated: mypy 2.4]