diff options
Diffstat (limited to 'numpy')
-rw-r--r-- | numpy/typing/__init__.py | 7 | ||||
-rw-r--r-- | numpy/typing/tests/test_typing_extensions.py | 35 |
2 files changed, 0 insertions, 42 deletions
diff --git a/numpy/typing/__init__.py b/numpy/typing/__init__.py index bfa7982c0..d60ddb5bb 100644 --- a/numpy/typing/__init__.py +++ b/numpy/typing/__init__.py @@ -5,13 +5,6 @@ Typing (:mod:`numpy.typing`) .. versionadded:: 1.20 -.. warning:: - - Some of the types in this module rely on features only present in - the standard library in Python 3.8 and greater. If you want to use - these types in earlier versions of Python, you should install the - typing-extensions_ package. - Large parts of the NumPy API have PEP-484-style type annotations. In addition a number of type aliases are available to users, most prominently the two below: diff --git a/numpy/typing/tests/test_typing_extensions.py b/numpy/typing/tests/test_typing_extensions.py deleted file mode 100644 index f59f222fb..000000000 --- a/numpy/typing/tests/test_typing_extensions.py +++ /dev/null @@ -1,35 +0,0 @@ -"""Tests for the optional typing-extensions dependency.""" - -import sys -import textwrap -import subprocess - -CODE = textwrap.dedent(r""" - import sys - import importlib - - assert "typing_extensions" not in sys.modules - assert "numpy.typing" not in sys.modules - - # Importing `typing_extensions` will now raise an `ImportError` - sys.modules["typing_extensions"] = None - assert importlib.import_module("numpy.typing") -""") - - -def test_no_typing_extensions() -> None: - """Import `numpy.typing` in the absence of typing-extensions. - - Notes - ----- - Ideally, we'd just run the normal typing tests in an environment where - typing-extensions is not installed, but unfortunatelly this is currently - impossible as it is an indirect hard dependency of pytest. - - """ - p = subprocess.run([sys.executable, '-c', CODE], capture_output=True) - if p.returncode: - raise AssertionError( - f"Non-zero return code: {p.returncode!r}\n\n{p.stderr.decode()}" - ) - |