Skip to content

Commit 225881c

Browse files
committed
Drop typing_extensions dependency (not necessary when targeting Python 3.8+)
1 parent 0113034 commit 225881c

File tree

8 files changed

+8
-16
lines changed

8 files changed

+8
-16
lines changed

redis/_parsers/hiredis.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import asyncio
22
import socket
33
import sys
4-
from typing import Callable, List, Optional, Union
4+
from typing import Callable, List, Optional, TypedDict, Union
55

66
if sys.version_info.major >= 3 and sys.version_info.minor >= 11:
77
from asyncio import timeout as async_timeout
88
else:
99
from async_timeout import timeout as async_timeout
1010

11-
from redis.compat import TypedDict
12-
1311
from ..exceptions import ConnectionError, InvalidResponse, RedisError
1412
from ..typing import EncodableT
1513
from ..utils import HIREDIS_AVAILABLE

redis/asyncio/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@
1515
Mapping,
1616
MutableMapping,
1717
Optional,
18+
Protocol,
1819
Set,
1920
Tuple,
2021
Type,
22+
TypedDict,
2123
TypeVar,
2224
Union,
2325
cast,
@@ -49,7 +51,6 @@
4951
AsyncSentinelCommands,
5052
list_or_args,
5153
)
52-
from redis.compat import Protocol, TypedDict
5354
from redis.credentials import CredentialProvider
5455
from redis.exceptions import (
5556
ConnectionError,

redis/asyncio/connection.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
List,
1818
Mapping,
1919
Optional,
20+
Protocol,
2021
Set,
2122
Tuple,
2223
Type,
24+
TypedDict,
2325
TypeVar,
2426
Union,
2527
)
@@ -34,7 +36,6 @@
3436

3537
from redis.asyncio.retry import Retry
3638
from redis.backoff import NoBackoff
37-
from redis.compat import Protocol, TypedDict
3839
from redis.connection import DEFAULT_RESP_VERSION
3940
from redis.credentials import CredentialProvider, UsernamePasswordCredentialProvider
4041
from redis.exceptions import (

redis/commands/cluster.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
Iterable,
88
Iterator,
99
List,
10+
Literal,
1011
Mapping,
1112
NoReturn,
1213
Optional,
1314
Union,
1415
)
1516

16-
from redis.compat import Literal
1717
from redis.crc import key_slot
1818
from redis.exceptions import RedisClusterException, RedisError
1919
from redis.typing import (

redis/commands/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
Iterable,
1414
Iterator,
1515
List,
16+
Literal,
1617
Mapping,
1718
Optional,
1819
Sequence,
@@ -21,7 +22,6 @@
2122
Union,
2223
)
2324

24-
from redis.compat import Literal
2525
from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
2626
from redis.typing import (
2727
AbsExpiryT,

redis/compat.py

Lines changed: 0 additions & 6 deletions
This file was deleted.

redis/typing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,12 @@
77
Awaitable,
88
Iterable,
99
Mapping,
10+
Protocol,
1011
Type,
1112
TypeVar,
1213
Union,
1314
)
1415

15-
from redis.compat import Protocol
16-
1716
if TYPE_CHECKING:
1817
from redis._parsers import Encoder
1918
from redis.asyncio.connection import ConnectionPool as AsyncConnectionPool

setup.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
python_requires=">=3.7",
3838
install_requires=[
3939
'importlib-metadata >= 1.0; python_version < "3.8"',
40-
'typing-extensions; python_version<"3.8"',
4140
'async-timeout>=4.0.2; python_full_version<="3.11.2"',
4241
],
4342
classifiers=[

0 commit comments

Comments
 (0)