Skip to content

Commit

Permalink
Merge pull request #22390 from charris/backport-22360
Browse files Browse the repository at this point in the history
TST,TYP: Bump mypy to 0.981
  • Loading branch information
charris committed Oct 6, 2022
2 parents 5303507 + dc5caa8 commit fa16a0c
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
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

0 comments on commit fa16a0c

Please sign in to comment.