Skip to content

Commit

Permalink
Drop typing_extensions dependency (not necessary when targeting Pytho…
Browse files Browse the repository at this point in the history
…n 3.8+)
  • Loading branch information
akx committed Nov 14, 2023
1 parent 0113034 commit 225881c
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 16 deletions.
4 changes: 1 addition & 3 deletions redis/_parsers/hiredis.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import asyncio
import socket
import sys
from typing import Callable, List, Optional, Union
from typing import Callable, List, Optional, TypedDict, Union

if sys.version_info.major >= 3 and sys.version_info.minor >= 11:
from asyncio import timeout as async_timeout
else:
from async_timeout import timeout as async_timeout

from redis.compat import TypedDict

from ..exceptions import ConnectionError, InvalidResponse, RedisError
from ..typing import EncodableT
from ..utils import HIREDIS_AVAILABLE
Expand Down
3 changes: 2 additions & 1 deletion redis/asyncio/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
Mapping,
MutableMapping,
Optional,
Protocol,
Set,
Tuple,
Type,
TypedDict,
TypeVar,
Union,
cast,
Expand Down Expand Up @@ -49,7 +51,6 @@
AsyncSentinelCommands,
list_or_args,
)
from redis.compat import Protocol, TypedDict
from redis.credentials import CredentialProvider
from redis.exceptions import (
ConnectionError,
Expand Down
3 changes: 2 additions & 1 deletion redis/asyncio/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,11 @@
List,
Mapping,
Optional,
Protocol,
Set,
Tuple,
Type,
TypedDict,
TypeVar,
Union,
)
Expand All @@ -34,7 +36,6 @@

from redis.asyncio.retry import Retry
from redis.backoff import NoBackoff
from redis.compat import Protocol, TypedDict
from redis.connection import DEFAULT_RESP_VERSION
from redis.credentials import CredentialProvider, UsernamePasswordCredentialProvider
from redis.exceptions import (
Expand Down
2 changes: 1 addition & 1 deletion redis/commands/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
Iterable,
Iterator,
List,
Literal,
Mapping,
NoReturn,
Optional,
Union,
)

from redis.compat import Literal
from redis.crc import key_slot
from redis.exceptions import RedisClusterException, RedisError
from redis.typing import (
Expand Down
2 changes: 1 addition & 1 deletion redis/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Iterable,
Iterator,
List,
Literal,
Mapping,
Optional,
Sequence,
Expand All @@ -21,7 +22,6 @@
Union,
)

from redis.compat import Literal
from redis.exceptions import ConnectionError, DataError, NoScriptError, RedisError
from redis.typing import (
AbsExpiryT,
Expand Down
6 changes: 0 additions & 6 deletions redis/compat.py

This file was deleted.

3 changes: 1 addition & 2 deletions redis/typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,12 @@
Awaitable,
Iterable,
Mapping,
Protocol,
Type,
TypeVar,
Union,
)

from redis.compat import Protocol

if TYPE_CHECKING:
from redis._parsers import Encoder
from redis.asyncio.connection import ConnectionPool as AsyncConnectionPool
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
python_requires=">=3.7",
install_requires=[
'importlib-metadata >= 1.0; python_version < "3.8"',
'typing-extensions; python_version<"3.8"',
'async-timeout>=4.0.2; python_full_version<="3.11.2"',
],
classifiers=[
Expand Down

0 comments on commit 225881c

Please sign in to comment.