summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--pyproject.toml2
-rw-r--r--tests/unittest_scoped_nodes.py7
3 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 94208b67..5eb6c5e9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,8 @@ Release date: TBA
Closes #1958
+* Remove unnecessary typing_extensions dependency on Python 3.11 and newer
+
What's New in astroid 2.13.2?
=============================
Release date: 2023-01-08
diff --git a/pyproject.toml b/pyproject.toml
index 537bca9a..3fac032e 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -36,7 +36,7 @@ dependencies = [
"wrapt>=1.14,<2;python_version>='3.11'",
"wrapt>=1.11,<2;python_version<'3.11'",
"typed-ast>=1.4.0,<2.0;implementation_name=='cpython' and python_version<'3.8'",
- "typing-extensions>=4.0.0",
+ "typing-extensions>=4.0.0;python_version<'3.11'",
]
dynamic = ["version"]
diff --git a/tests/unittest_scoped_nodes.py b/tests/unittest_scoped_nodes.py
index 39d21369..c59bdc3f 100644
--- a/tests/unittest_scoped_nodes.py
+++ b/tests/unittest_scoped_nodes.py
@@ -1907,11 +1907,14 @@ class ClassNodeTest(ModuleLoader, unittest.TestCase):
import typing
import dataclasses
- import typing_extensions
+ if sys.version_info >= (3, 8):
+ from typing import Protocol
+ else:
+ from typing_extensions import Protocol
T = typing.TypeVar("T")
- class MyProtocol(typing_extensions.Protocol): pass
+ class MyProtocol(Protocol): pass
class EarlyBase(typing.Generic[T], MyProtocol): pass
class Base(EarlyBase[T], abc.ABC): pass
class Final(Base[object]): pass