Skip to content

Commit 184ca63

Browse files
committed
PY37: Use typing_extensions to get Literal in Python 3.7
1 parent 3c27b2a commit 184ca63

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

pydra/tasks/core/sequences.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,15 @@
44
from pydra.engine.core import TaskBase
55
from pydra.engine.helpers import ensure_list
66

7+
try:
8+
from typing import Literal
9+
except ImportError: # PY37
10+
from typing_extensions import Literal
11+
712

813
@attr.s(kw_only=True)
914
class MergeInputSpec(BaseSpec):
10-
axis: ty.Literal["vstack", "hstack"] = attr.ib(
15+
axis: Literal["vstack", "hstack"] = attr.ib(
1116
default="vstack",
1217
metadata={
1318
"help_string": "Direction in which to merge, hstack requires same number of elements in each input."

setup.cfg

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ install_requires =
2828
cloudpickle >= 1.2.2
2929
filelock >= 3.0.0
3030
etelemetry >= 0.2.2
31+
typing_extensions ; python_version < "3.8"
3132

3233
test_requires =
3334
pytest >= 4.4.0, < 6.0.0

0 commit comments

Comments
 (0)