Skip to content

Commit

Permalink
Bumps the version of typing_extensions to include Self Type
Browse files Browse the repository at this point in the history
  • Loading branch information
konichuvak committed Jun 18, 2023
1 parent f3834ef commit 5c6c657
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 17 deletions.
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,7 @@
"protobuf>=4.21.6",
"pywin32>=223;platform_system=='Windows'",
"requests>=2.16.0",
# remove typing_extensions after python_requires>=3.8, see web3._utils.compat
"typing-extensions>=3.7.4.1,<5;python_version<'3.8'",
"typing-extensions>=4.0.1,<5",
"websockets>=10.0.0",
],
python_requires=">=3.7.2",
Expand Down
22 changes: 7 additions & 15 deletions web3/_utils/compat/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
import sys
# Changelog for `typing_extensions` for checking which types were added when
# https://github.com/python/typing_extensions/blob/main/CHANGELOG.md

# remove once web3 supports python>=3.8
# Types was added to typing in 3.8
if sys.version_info >= (3, 8):
from typing import (
Literal,
Protocol,
TypedDict,
)
else:
from typing_extensions import ( # noqa: F401
Literal,
Protocol,
TypedDict,
)
# Note that we do not need to explicitly check for python version here,
# because `typing_extensions` will do it for us and either import from `typing`
# or use the back-ported version of the type.

from typing_extensions import Literal, Protocol, TypedDict, Self

0 comments on commit 5c6c657

Please sign in to comment.