Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion project_name/.github/workflows/ci.yml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ jobs:
- name: List packages
run: uv pip list
- name: Run mypy
run: uv run --no-sync mypy --num-workers auto
run: uv run --no-sync mypy

dependencies:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions project_name/.pre-commit-config.yaml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,9 @@ repos:
rev: <placeholder_until_update_deps>
hooks:
- id: validate-pyproject
# TODO: drop `args` once SchemaStore's mypy schema accepts
# `num_workers = "auto"` (new in mypy 2.4)
args: [--disable-plugins, mypy, --]

# YAML files
- repo: https://github.com/adrienverge/yamllint
Expand Down
1 change: 1 addition & 0 deletions project_name/pyproject.toml.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ src.include = [
[tool.mypy]
files = ["src", "tests"]
mypy_path = "stubs"
num_workers = "auto"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

馃煛 Medium 路 Pre-commit mypy stays serial

When the pre-commit mypy hook runs, the pre-commit mypy hook passes --config-file '', so it does not load [tool.mypy] and never sees num_workers = "auto"; that local mypy entry point continues using the default worker count.

Allow that hook to read the project config, or pass --num-workers auto explicitly if it must remain config-free.

Prompt for AI agents
In `project_name/pyproject.toml.jinja` at line 189:

**Pre-commit mypy stays serial**

When the pre-commit mypy hook runs, the pre-commit mypy hook passes `--config-file ''`, so it does not load `[tool.mypy]` and never sees `num_workers = "auto"`; that local mypy entry point continues using the default worker count.

Allow that hook to read the project config, or pass `--num-workers auto` explicitly if it must remain config-free.

# set the platform
python_version = "3.{{ python_min }}"
# enable checks [last updated: mypy 2.4]
Expand Down
Loading