Skip to content

TST,TYP: Bump mypy to 0.981 #22360

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
Oct 2, 2022
Merged

TST,TYP: Bump mypy to 0.981 #22360

merged 2 commits into from
Oct 2, 2022

Conversation

BvB93
Copy link
Member

@BvB93 BvB93 commented Sep 30, 2022

Bump mypy to version 0.981.

Marked as backport due as the test set required a few updates.

@BvB93 BvB93 added this to the 1.23.4 release milestone Sep 30, 2022
Comment on lines -73 to -74
complex(np.bytes_("1")) # E: No overload variant

Copy link
Member Author

@BvB93 BvB93 Sep 30, 2022

Choose a reason for hiding this comment

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

Minor regression due to python/typeshed#8473, i.e. any object that defines __float__ is now treated as valid by the complex constructor (even though this will raise during runtime as being a bytes subclass takes priority).

Nothing we can really do here I'm afraid.

@@ -20,7 +20,7 @@ AR_double: npt.NDArray[np.double]
AR_longdouble: npt.NDArray[np.longdouble]
AR_void: npt.NDArray[np.void]

pointer: ctypes.pointer[Any]
pointer: ctypes._Pointer[Any]
Copy link
Member Author

Choose a reason for hiding this comment

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

Adapt to the ctypes.pointer changes in python/typeshed#8446.

@@ -7,7 +7,7 @@ reveal_type(a.base) # E: ndarray[Any, dtype[str_]]
reveal_type(a.copy()) # E: ndarray[Any, dtype[str_]]
reveal_type(a.coords) # E: tuple[builtins.int, ...]
reveal_type(a.index) # E: int
reveal_type(iter(a)) # E: flatiter[ndarray[Any, dtype[str_]]]
reveal_type(iter(a)) # E: Any
Copy link
Member Author

Choose a reason for hiding this comment

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

A minor regression introduced by python/typeshed#7817.
Seems to be a mypy bug as pylance does produce the expected result here.

@BvB93
Copy link
Member Author

BvB93 commented Sep 30, 2022

Mypy seems to use importlib API that's deprecated since python 3.11, hence the test failure.
PR python/mypy#13783 should take care of the deprecation warning, so I propose to just ignore the warning on our end for now.

@mattip mattip merged commit a5d2c58 into numpy:main Oct 2, 2022
@mattip
Copy link
Member

mattip commented Oct 2, 2022

Thanks @BvB93

@BvB93 BvB93 deleted the mypy branch October 2, 2022 17:08
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Oct 6, 2022
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