From 5adcfc7341d843232e25499b01a849d5704dad49 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 14 May 2026 09:46:30 +0000 Subject: [PATCH 1/5] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Upgrade=20mypy=20to=20?= =?UTF-8?q?2.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Bump mypy from ~=1.20.0 to ~=2.1.0. - Remove local_partial_types from config (enabled by default in 2.1). - Pass --num-workers 4 in CI to match GitHub Actions runner vCPUs. https://claude.ai/code/session_01DSZJX4JKn2or8vLdmoGECt --- project_name/.github/workflows/ci.yml.jinja | 2 +- project_name/pyproject.toml.jinja | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/project_name/.github/workflows/ci.yml.jinja b/project_name/.github/workflows/ci.yml.jinja index fc81508..2a36b3a 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 4 dependencies: runs-on: ubuntu-latest diff --git a/project_name/pyproject.toml.jinja b/project_name/pyproject.toml.jinja index dc4e4b2..7f190c8 100644 --- a/project_name/pyproject.toml.jinja +++ b/project_name/pyproject.toml.jinja @@ -107,7 +107,7 @@ docs = [ "mkdocs-section-index ~=0.3.0", ] typing = [ - "mypy[native-parser] ~=1.20.0", + "mypy[native-parser] ~=2.1.0", "ty ~=0.0", # add "*-stubs" and "types-*" packages here (">=0") ] @@ -185,10 +185,9 @@ mypy_path = "stubs" fixed_format_cache = true # set the platform python_version = "3.{{ python_min }}" -# enable checks [last updated: mypy 1.20] +# enable checks [last updated: mypy 2.1] strict = true strict_equality_for_none = true -local_partial_types = true disallow_any_unimported = true warn_unreachable = true disallow_any_explicit = true From c77a2583f5b7916fee87a59e897a1f5a3eca9076 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 14 May 2026 09:54:45 +0000 Subject: [PATCH 2/5] =?UTF-8?q?=E2=AC=86=EF=B8=8F=20Drop=20mypy=20native-p?= =?UTF-8?q?arser=20extra?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit native-parser is included by default in mypy 2.1. https://claude.ai/code/session_01DSZJX4JKn2or8vLdmoGECt --- project_name/pyproject.toml.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_name/pyproject.toml.jinja b/project_name/pyproject.toml.jinja index 7f190c8..bee6fc9 100644 --- a/project_name/pyproject.toml.jinja +++ b/project_name/pyproject.toml.jinja @@ -107,7 +107,7 @@ docs = [ "mkdocs-section-index ~=0.3.0", ] typing = [ - "mypy[native-parser] ~=2.1.0", + "mypy ~=2.1.0", "ty ~=0.0", # add "*-stubs" and "types-*" packages here (">=0") ] From b65ce40ad8ed26fd3bb03830910c94a25f9ed5af Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 14 May 2026 09:59:06 +0000 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=94=A7=20Use=20$(nproc)=20for=20mypy?= =?UTF-8?q?=20--num-workers=20in=20CI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adapt the worker count to the runner instead of hardcoding 4. https://claude.ai/code/session_01DSZJX4JKn2or8vLdmoGECt --- project_name/.github/workflows/ci.yml.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_name/.github/workflows/ci.yml.jinja b/project_name/.github/workflows/ci.yml.jinja index 2a36b3a..e14513b 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 4 + run: uv run --no-sync mypy --num-workers "$(nproc)" dependencies: runs-on: ubuntu-latest From b86aaf1f624c4ec1185d56e0cfe44d4c4cad0d24 Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 14 May 2026 10:00:35 +0000 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=A7=20Pass=20--num-workers=204=20t?= =?UTF-8?q?o=20dmypy=20in=20justfile?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Mirrors the CI mypy parallelism. Hardcoded since macOS lacks nproc. https://claude.ai/code/session_01DSZJX4JKn2or8vLdmoGECt --- project_name/justfile.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_name/justfile.jinja b/project_name/justfile.jinja index 0a99d6d..71854dc 100644 --- a/project_name/justfile.jinja +++ b/project_name/justfile.jinja @@ -91,7 +91,7 @@ format: # Run linters lint: uv run ruff check - uv run --exact --all-extras --no-default-groups --group typing --group test -- dmypy run + uv run --exact --all-extras --no-default-groups --group typing --group test -- dmypy run -- --num-workers 4 uv run --exact --all-extras --all-groups --with deptry -- deptry src/ uv run --exact pre-commit run --all-files From fbbdab7815b92c187b48c6b75070e692862672de Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 14 May 2026 10:05:10 +0000 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=9A=A8=20Revert=20--num-workers=20on?= =?UTF-8?q?=20dmypy=20run?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit dmypy crashes when --num-workers is passed (FileExistsError in worker init) — the parallel-worker mode is incompatible with the daemon. Keep the flag only on the one-shot mypy invocation in CI. https://claude.ai/code/session_01DSZJX4JKn2or8vLdmoGECt --- project_name/justfile.jinja | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project_name/justfile.jinja b/project_name/justfile.jinja index 71854dc..0a99d6d 100644 --- a/project_name/justfile.jinja +++ b/project_name/justfile.jinja @@ -91,7 +91,7 @@ format: # Run linters lint: uv run ruff check - uv run --exact --all-extras --no-default-groups --group typing --group test -- dmypy run -- --num-workers 4 + uv run --exact --all-extras --no-default-groups --group typing --group test -- dmypy run uv run --exact --all-extras --all-groups --with deptry -- deptry src/ uv run --exact pre-commit run --all-files