Skip to content

Commit

Permalink
Merge pull request #247 from networktocode/typing_extensions_fix
Browse files Browse the repository at this point in the history
fixes underspecified typing_extensions dependency and deprecates Python 3.7
  • Loading branch information
Kircheneer authored Oct 24, 2023
2 parents b6f2d63 + f702f3e commit 94b5500
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 103 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ jobs:
strategy:
fail-fast: true
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
runs-on: "ubuntu-20.04"
env:
PYTHON_VER: "${{ matrix.python-version }}"
Expand Down
7 changes: 6 additions & 1 deletion diffsync/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
See the License for the specific language governing permissions and
limitations under the License.
"""
import sys
from inspect import isclass
from typing import Callable, ClassVar, Dict, List, Optional, Tuple, Type, Union, Any, Set
from typing_extensions import Self

from pydantic import BaseModel, PrivateAttr
import structlog # type: ignore
Expand All @@ -29,6 +29,11 @@
from diffsync.store.local import LocalStore
from diffsync.utils import get_path, set_key, tree_string

if sys.version_info >= (3, 11):
from typing import Self
else:
from typing_extensions import Self

# This workaround is used because we are defining a method called `str` in our class definition, which therefore renders
# the builtin `str` type unusable.
StrType = str
Expand Down
107 changes: 8 additions & 99 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@ include = [
]

[tool.poetry.dependencies]
python = "^3.7"
python = ">=3.8,<4.0"
pydantic = "^1.7.4,!=1.8,!=1.8.1"
structlog = ">= 20.1.0, < 23.0.0"
packaging = ">= 21.3, < 24.0"
colorama = {version = "^0.4.3", optional = true}
redis = {version = "^4.3", optional = true}
# typing.Self introduced in 3.11
typing-extensions = { version = ">=4.0.1", python = "<3.11" }

[tool.poetry.extras]
redis = ["redis"]
Expand Down
2 changes: 1 addition & 1 deletion tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def is_truthy(arg):


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

0 comments on commit 94b5500

Please sign in to comment.