8000 DEP: Deprecate ``numpy.typing.mypy_plugin`` by jorenham · Pull Request #28129 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

DEP: Deprecate numpy.typing.mypy_plugin #28129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 9, 2025

Conversation

jorenham
Copy link
Member
@jorenham jorenham commented Jan 8, 2025

As discussed in the triage meeting, this deprecates the mypy plugin.

Generally speaking, it's bad practice to have platform-dependent type annotations.
It can easily lead to platform-specific typing issues, which can be very difficult to debug.
Since the plugin is limited to mypy, using it will also lead to different outcomes for different type-checkers like pyright, which goes against the typing specification.

@jorenham jorenham force-pushed the typing/deprecate_mypy_plugin branch from 5712ba4 to 797acb3 Compare January 9, 2025 00:38
@charris charris merged commit 94132ac into numpy:main Jan 9, 2025
67 checks passed
@charris
Copy link
Member
charris commented Jan 9, 2025

Thanks Joren.

Copy link
Member
@seberg seberg left a comment

Choose a reason for hiding this comment

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

Thanks, fine to merge, I had started to have a brief look last night, none of the comments are a big deal, but thought I'll comment anyway.

@seberg
Copy link
Member
seberg commented Jan 9, 2025

@jorenham one more comment: This seems like a deprecation that would be good to have a release note (really, all probably should have).

If anyone finds this PR because they need the mypy plugin, please open an issue and let's discuss. It would be nice to have identical behavior between mypy/pyright, etc. and this only works with mypy and the need for the plugin was a bit unclear. But if you have a need we should discuss the deprecation (or likely just how to deal with the changes).

@jorenham jorenham deleted the typing/deprecate_mypy_plugin branch January 9, 2025 20:34
jorenham added a commit to jorenham/numpy that referenced this pull request Jan 9, 2025
seberg added a commit that referenced this pull request Jan 10, 2025
* DEP: Address mypy plugin deprecation suggestions by @seberg in #28129

* DOC: Release note for the deprecated ``numpy.typing.mypy_plugin``

* Update numpy/typing/mypy_plugin.py

---------

Co-authored-by: Sebastian Berg <sebastian@sipsolutions.net>
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.

3 participants
0