Skip to content

MAINT: bump mypy to 1.14.1 - #28089

Merged
charris merged 3 commits into
numpy:mainfrom
jorenham:typing/mypy-1.14.1
Jan 2, 2025
Merged

charris merged 3 commits into
numpy:mainfrom
jorenham:typing/mypy-1.14.1

Conversation

@jorenham

@jorenham jorenham commented Jan 2, 2025 •

Copy link
Copy Markdown
Member

Some type-tests needed to be refined because mypy now supports generic slice types.

The updated bundled typeshed was causing memoryview[int] to not be accepted anymore by npt.ArrayLike on python<3.12. This was also the case with pyright. I solved this by backporting collections.abc.Buffer on python<3.12, and included it in the numpy.typing.ArrayLike type alias, making it equivalent to its python>=3.12 variant (from a static typing perspective).

1.14.1 release notes

@jorenham jorenham changed the title MAINT: bump mypy to 1.14.1 MAINT: bump mypy to 1.14.1 Jan 2, 2025
@charris
charris merged commit 12364e3 into numpy:main Jan 2, 2025
@charris

charris commented Jan 2, 2025

Copy link
Copy Markdown
Member

Thanks Joren.

charris pushed a commit to charris/numpy that referenced this pull request Jan 7, 2025
* MAINT: bump `mypy` to `1.14.1`

* TYP: fix new `mypy==1.14.1` type-test errors

* TYP: backport `collections.abc.Buffer` for `npt.ArrayLike` on `python<3.11`
@jorenham
jorenham deleted the typing/mypy-1.14.1 branch January 8, 2025 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants