Skip to content

Commit f702f3e

Browse files
committed
fixes underspecified typing_extensions dependency
1 parent cbb177a commit f702f3e

File tree

4 files changed

+17
-101
lines changed

4 files changed

+17
-101
lines changed

diffsync/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
See the License for the specific language governing permissions and
1515
limitations under the License.
1616
"""
17+
import sys
1718
from inspect import isclass
1819
from typing import Callable, ClassVar, Dict, List, Optional, Tuple, Type, Union, Any, Set
19-
from typing_extensions import Self
2020

2121
from pydantic import BaseModel, PrivateAttr
2222
import structlog # type: ignore
@@ -29,6 +29,11 @@
2929
from diffsync.store.local import LocalStore
3030
from diffsync.utils import get_path, set_key, tree_string
3131

32+
if sys.version_info >= (3, 11):
33+
from typing import Self
34+
else:
35+
from typing_extensions import Self
36+
3237
# This workaround is used because we are defining a method called `str` in our class definition, which therefore renders
3338
# the builtin `str` type unusable.
3439
StrType = str

poetry.lock

Lines changed: 8 additions & 99 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ structlog = ">= 20.1.0, < 23.0.0"
2222
packaging = ">= 21.3, < 24.0"
2323
colorama = {version = "^0.4.3", optional = true}
2424
redis = {version = "^4.3", optional = true}
25+
# typing.Self introduced in 3.11
26+
typing-extensions = { version = ">=4.0.1", python = "<3.11" }
2527

2628
[tool.poetry.extras]
2729
redis = ["redis"]

tasks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def is_truthy(arg):
4747

4848

4949
# Can be set to a separate Python version to be used for launching or building image
50-
PYTHON_VER = os.getenv("PYTHON_VER", os.getenv("TRAVIS_PYTHON_VERSION", "3.8"))
50+
PYTHON_VER = os.getenv("PYTHON_VER", "3.8")
5151
# Name of the docker image/image
5252
NAME = os.getenv("IMAGE_NAME", f"diffsync-py{PYTHON_VER}")
5353
# Tag for the image

0 commit comments

Comments
 (0)