From ab4a88a3204cadc3abfbc8b6e1fd9cb4036f7297 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 24 Oct 2023 00:13:02 -0400 Subject: [PATCH 1/3] fix compatibility with py37 --- dargs/dargs.py | 6 +++++- pyproject.toml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dargs/dargs.py b/dargs/dargs.py index 38bfdf3..5058bcd 100644 --- a/dargs/dargs.py +++ b/dargs/dargs.py @@ -24,7 +24,11 @@ from copy import deepcopy from enum import Enum from textwrap import indent -from typing import Any, Callable, Dict, Iterable, List, Optional, Union, get_origin +from typing import Any, Callable, Dict, Iterable, List, Optional, Union +try: + from typing import get_origin +except ImportError: + from typing_extensions import get_origin import typeguard diff --git a/pyproject.toml b/pyproject.toml index bd31a2f..506180f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,6 +17,7 @@ classifiers = [ ] dependencies = [ "typeguard>=3", + 'typing_extensions; python_version < "3.8"', ] requires-python = ">=3.7" readme = "README.md" From b87114e41149053b567cdc135d8e99904975a959 Mon Sep 17 00:00:00 2001 From: Jinzhe Zeng Date: Tue, 24 Oct 2023 00:14:49 -0400 Subject: [PATCH 2/3] add tests for py37 --- .github/workflows/test.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index c88ba61..4d74ee5 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,12 +7,17 @@ on: jobs: build: runs-on: ubuntu-latest + strategy: + matrix: + python_version: + - "3" + - "3.7" steps: - uses: actions/checkout@v2 - name: Set up Python uses: actions/setup-python@v2 with: - python-version: 3 + python-version: ${{ matrix.python_version }} - run: pip install .[test] coverage - name: Test run: coverage run --source=./dargs -m unittest -v && coverage report From d6a5bf4eaabc3482473271abf71db98deda3ed1d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 24 Oct 2023 04:15:10 +0000 Subject: [PATCH 3/3] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- dargs/dargs.py | 1 + 1 file changed, 1 insertion(+) diff --git a/dargs/dargs.py b/dargs/dargs.py index 5058bcd..dc70b0d 100644 --- a/dargs/dargs.py +++ b/dargs/dargs.py @@ -25,6 +25,7 @@ from enum import Enum from textwrap import indent from typing import Any, Callable, Dict, Iterable, List, Optional, Union + try: from typing import get_origin except ImportError: