Skip to content

Commit 94b5500

Browse files
authored
Merge pull request #247 from networktocode/typing_extensions_fix
fixes underspecified typing_extensions dependency and deprecates Python 3.7
2 parents b6f2d63 + f702f3e commit 94b5500

File tree

5 files changed

+19
-103
lines changed

5 files changed

+19
-103
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ jobs:
129129
strategy:
130130
fail-fast: true
131131
matrix:
132-
python-version: ["3.7", "3.8", "3.9", "3.10"]
132+
python-version: ["3.8", "3.9", "3.10", "3.11"]
133133
runs-on: "ubuntu-20.04"
134134
env:
135135
PYTHON_VER: "${{ matrix.python-version }}"

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,14 @@ include = [
1616
]
1717

1818
[tool.poetry.dependencies]
19-
python = "^3.7"
19+
python = ">=3.8,<4.0"
2020
pydantic = "^1.7.4,!=1.8,!=1.8.1"
2121
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.7"))
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)