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 diff --git a/dargs/dargs.py b/dargs/dargs.py index 38bfdf3..dc70b0d 100644 --- a/dargs/dargs.py +++ b/dargs/dargs.py @@ -24,7 +24,12 @@ 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"