Skip to content

Commit

Permalink
fix compatibility with Python 3.7 (#38)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
njzjz and pre-commit-ci[bot] authored Oct 24, 2023
1 parent d97bd20 commit b3a7a97
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion dargs/dargs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ classifiers = [
]
dependencies = [
"typeguard>=3",
'typing_extensions; python_version < "3.8"',
]
requires-python = ">=3.7"
readme = "README.md"
Expand Down

0 comments on commit b3a7a97

Please sign in to comment.