summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBvB93 <43369155+BvB93@users.noreply.github.com>2022-09-30 19:30:03 +0200
committerBvB93 <43369155+BvB93@users.noreply.github.com>2022-09-30 19:37:46 +0200
commit5d4bba30664f78f7e7b8656be674e519a525f6a7 (patch)
treee3f502228344760360f67ef3df575d09787aec41
parent17051caef30ad3b99291077c95f5ca9e55f0e082 (diff)
downloadnumpy-5d4bba30664f78f7e7b8656be674e519a525f6a7.tar.gz
TST,TYP: Bump mypy to 0.981
-rw-r--r--environment.yml2
-rw-r--r--numpy/typing/tests/data/fail/scalars.pyi2
-rw-r--r--numpy/typing/tests/data/reveal/ctypeslib.pyi2
-rw-r--r--numpy/typing/tests/data/reveal/flatiter.pyi2
-rw-r--r--test_requirements.txt2
5 files changed, 4 insertions, 6 deletions
diff --git a/environment.yml b/environment.yml
index f09be2062..b99fa1256 100644
--- a/environment.yml
+++ b/environment.yml
@@ -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
diff --git a/numpy/typing/tests/data/fail/scalars.pyi b/numpy/typing/tests/data/fail/scalars.pyi
index 964470538..c24f9e479 100644
--- a/numpy/typing/tests/data/fail/scalars.pyi
+++ b/numpy/typing/tests/data/fail/scalars.pyi
@@ -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
diff --git a/numpy/typing/tests/data/reveal/ctypeslib.pyi b/numpy/typing/tests/data/reveal/ctypeslib.pyi
index ccbdfe36e..2d30de3d1 100644
--- a/numpy/typing/tests/data/reveal/ctypeslib.pyi
+++ b/numpy/typing/tests/data/reveal/ctypeslib.pyi
@@ -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}
diff --git a/numpy/typing/tests/data/reveal/flatiter.pyi b/numpy/typing/tests/data/reveal/flatiter.pyi
index 0f0758175..8d3e80632 100644
--- a/numpy/typing/tests/data/reveal/flatiter.pyi
+++ b/numpy/typing/tests/data/reveal/flatiter.pyi
@@ -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_]]
diff --git a/test_requirements.txt b/test_requirements.txt
index c5fec8cd7..3e7d3fef7 100644
--- a/test_requirements.txt
+++ b/test_requirements.txt
@@ -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