Skip to content
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

TST,TYP: Bump mypy to 0.981 #22390

Merged
merged 2 commits into from Oct 6, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion environment.yml
Expand Up @@ -19,7 +19,7 @@ dependencies:
- pytest-xdist
- hypothesis
# For type annotations
- mypy=0.950
- mypy=0.981
- typing_extensions>=4.2.0
# For building docs
- sphinx=4.5.0
Expand Down
2 changes: 0 additions & 2 deletions numpy/typing/tests/data/fail/scalars.pyi
Expand Up @@ -70,8 +70,6 @@ np.timedelta64(value=0) # E: Unexpected keyword argument
np.bytes_(b"hello", encoding='utf-8') # E: No overload variant
np.str_("hello", encoding='utf-8') # E: No overload variant

complex(np.bytes_("1")) # E: No overload variant

f8.item(1) # E: incompatible type
f8.item((0, 1)) # E: incompatible type
f8.squeeze(axis=1) # E: incompatible type
Expand Down
2 changes: 1 addition & 1 deletion numpy/typing/tests/data/reveal/ctypeslib.pyi
Expand Up @@ -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]

reveal_type(np.ctypeslib.c_intp()) # E: {c_intp}

Expand Down
2 changes: 1 addition & 1 deletion numpy/typing/tests/data/reveal/flatiter.pyi
Expand Up @@ -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
reveal_type(next(a)) # E: str_
reveal_type(a[0]) # E: str_
reveal_type(a[[0, 1, 2]]) # E: ndarray[Any, dtype[str_]]
Expand Down
2 changes: 2 additions & 0 deletions pytest.ini
Expand Up @@ -25,3 +25,5 @@ filterwarnings =
# Ignore DeprecationWarnings from distutils
ignore::DeprecationWarning:.*distutils
ignore:\n\n `numpy.distutils`:DeprecationWarning
# Ignore mypy >= 0.971 DeprecationWarnings
ignore:path is deprecated\. Use files\(\) instead:DeprecationWarning:mypy
2 changes: 1 addition & 1 deletion test_requirements.txt
Expand Up @@ -10,5 +10,5 @@ cffi; python_version < '3.10'
# For testing types. Notes on the restrictions:
# - Mypy relies on C API features not present in PyPy
# NOTE: Keep mypy in sync with environment.yml
mypy==0.950; platform_python_implementation != "PyPy"
mypy==0.981; platform_python_implementation != "PyPy"
typing_extensions>=4.2.0