summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2022-10-02 17:14:12 +0300
committerGitHub <noreply@github.com>2022-10-02 17:14:12 +0300
commita5d2c58a55852f6e302e8362e9d703485d27bead (patch)
tree3873ac58a6ecd602f958d9594fe1f60fdb31a373
parent3bfe84acbe5e9fcc87c92365be647c20d6695edd (diff)
parentef852f1259b1a9b9a33fd5fc5dc4e9e548acda98 (diff)
downloadnumpy-a5d2c58a55852f6e302e8362e9d703485d27bead.tar.gz
Merge pull request #22360 from BvB93/mypy
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--pytest.ini2
-rw-r--r--test_requirements.txt2
6 files changed, 6 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/pytest.ini b/pytest.ini
index f1c49d0ff..29ec1d1a4 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -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
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