Skip to content

Bump mypy so the pre-commit hook works with numpy 2.5 stubs - #401

Open
rishabhsai wants to merge 1 commit into
patrick-kidger:mainfrom
rishabhsai:bump-mypy-for-numpy-2-5
Open

Bump mypy so the pre-commit hook works with numpy 2.5 stubs#401
rishabhsai wants to merge 1 commit into
patrick-kidger:mainfrom
rishabhsai:bump-mypy-for-numpy-2-5

Conversation

@rishabhsai

Copy link
Copy Markdown

Run tests runs uv run prek run --all-files before pytest, and with the pinned mypy==1.14.1 the mypy hook crashes on numpy 2.5 stubs rather than reporting errors: AssertionError: Internal error: unresolved placeholder type None, raised from mypy/types.py:3173 while writing the cache.

Because fail_fast: true is set and this hook runs before pytest, every Run tests run since 2026-08-04 has gone red without a single test executing (for example run 33823039578, whose traceback matches the one I reproduced locally frame for frame with uv run -- mypy --ignore-missing-imports --follow-imports=skip test/types/__init__.py test/types/decorator.py on mypy 1.14.1 plus numpy 2.5.3).

There is no uv.lock in the repo, so CI always resolves the newest numpy and the crash will not clear on its own.

Bumping the pin to the current latest, mypy==2.3.1, gives Success: no issues found in 2 source files on test/types/ with zero new errors, and a full uv run prek run --all-files passes every hook.

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