diff --git a/CHANGES/484.misc b/CHANGES/484.misc new file mode 100644 index 000000000..a6e1d9a86 --- /dev/null +++ b/CHANGES/484.misc @@ -0,0 +1 @@ +Do not require typing_extensions on Python 3.8 and newer. diff --git a/requirements/test.txt b/requirements/test.txt index 9b941803c..6139eade0 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -2,5 +2,5 @@ pytest-cov>=2.3.1 pytest==5.4.3 multidict==4.7.6 idna==2.10 -typing_extensions==3.7.4.2 +typing_extensions==3.7.4.2;python_version<"3.8" -e . diff --git a/setup.py b/setup.py index 41d684d04..1ed5bfee5 100644 --- a/setup.py +++ b/setup.py @@ -30,7 +30,8 @@ except IndexError: raise RuntimeError("Unable to determine version.") -install_requires = ["multidict>=4.0", "idna>=2.0", "typing_extensions>=3.7.4"] +install_requires = ["multidict>=4.0", "idna>=2.0", + "typing_extensions>=3.7.4;python_version<\"3.8\""] def read(name): diff --git a/yarl/__init__.pyi b/yarl/__init__.pyi index b3b58ec3b..5aece3ddd 100644 --- a/yarl/__init__.pyi +++ b/yarl/__init__.pyi @@ -1,7 +1,12 @@ from typing import overload, Any, Tuple, Optional, Mapping, Union, Sequence, Type -from typing_extensions import TypedDict, Final, final import multidict from functools import _CacheInfo +import sys + +if sys.version_info >= (3, 8): + from typing import TypedDict, Final, final +else: + from typing_extensions import TypedDict, Final, final _QueryVariable = Union[str, int] _Query = Union[