Skip to content

Commit

Permalink
Merge pull request #94 from girder/more-py37-support
Browse files Browse the repository at this point in the history
Add more workarounds to allow running on Python 3.7
  • Loading branch information
manthey authored Aug 19, 2021
2 parents 8b8a9d2 + 0104e8a commit 3161284
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 13 deletions.
1 change: 1 addition & 0 deletions swcc/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
'rich',
'toml',
'tqdm',
'typing-extensions ; python_version < "3.8"',
],
entry_points={'console_scripts': ['swcc=swcc.cli:main']},
extras_require={'dev': ['factory_boy', 'ipython', 'tox']},
Expand Down
45 changes: 32 additions & 13 deletions swcc/swcc/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,38 @@

from pathlib import Path, PurePath
from tempfile import TemporaryDirectory
from typing import (
Any,
Dict,
Generic,
Iterator,
Literal,
Optional,
Tuple,
Type,
TypeVar,
Union,
get_args,
)

try:
from typing import (
Any,
Dict,
Generic,
Iterator,
Literal,
Optional,
Tuple,
Type,
TypeVar,
Union,
get_args,
)
except ImportError:
from typing import (
Any,
Dict,
Generic,
Iterator,
Optional,
Tuple,
Type,
TypeVar,
Union,
)
from typing_extensions import ( # type: ignore
Literal,
get_args,
)

from urllib.parse import unquote

from openpyxl import load_workbook
Expand Down
15 changes: 15 additions & 0 deletions swcc/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,21 @@ deps =
commands =
pytest {posargs}

[testenv:py37]
install_command = pip install --ignore-requires-python {opts} {packages}
basepython=python3.7
passenv =
DJANGO_BASE_URL
DJANGO_SUPERUSER_EMAIL
DJANGO_SUPERUSER_PASSWORD
deps =
pytest
click
pytest-factoryboy
pytest-mock
commands =
pytest {posargs}

[testenv:release]
skipsdist = true
skip_install = true
Expand Down

0 comments on commit 3161284

Please sign in to comment.