Skip to content

Commit

Permalink
setup: Add type_extensions for forward compat with typing in recent P…
Browse files Browse the repository at this point in the history
…ythons

- Let's install it always regardless of the Python version
  • Loading branch information
achimnol committed Aug 25, 2023
1 parent 0f431ba commit b6c3a36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ python_requires = >=3.6
setup_requires =
setuptools>=51.2.0
install_requires =
typing-extensions~=3.7; python_version<"3.8"
typing-extensions>=4.6.0
zip_safe = false
include_package_data = true

Expand Down
5 changes: 3 additions & 2 deletions src/aiotools/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
Coroutine,
Generator,
TypeVar,
Union,
)
from typing_extensions import TypeAlias

Expand All @@ -17,5 +18,5 @@
AwaitableLike: TypeAlias = Awaitable[_T] # noqa: Y047
CoroutineLike: TypeAlias = Coroutine[Any, Any, _T] # noqa: Y047
else:
AwaitableLike: TypeAlias = Generator[Any, None, _T] | Awaitable[_T]
CoroutineLike: TypeAlias = Generator[Any, None, _T] | Coroutine[Any, Any, _T]
AwaitableLike: TypeAlias = Union[Generator[Any, None, _T], Awaitable[_T]]
CoroutineLike: TypeAlias = Union[Generator[Any, None, _T], Coroutine[Any, Any, _T]]

Check failure on line 22 in src/aiotools/types.py

View workflow job for this annotation

GitHub Actions / lint (3.11)

E501 line too long (87 > 85 characters)

0 comments on commit b6c3a36

Please sign in to comment.