Skip to content

Commit

Permalink
PY37: Use typing_extensions to get Literal in Python 3.7
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Mar 1, 2021
1 parent d0fe700 commit 38ef59e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pydra/tasks/core/sequences.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
from pydra.engine.core import TaskBase
from pydra.engine.helpers import ensure_list

try:
from typing import Literal
except ImportError: # PY37
from typing_extensions import Literal


@attr.s(kw_only=True)
class MergeInputSpec(BaseSpec):
axis: ty.Literal["vstack", "hstack"] = attr.ib(
axis: Literal["vstack", "hstack"] = attr.ib(
default="vstack",
metadata={
"help_string": "Direction in which to merge, hstack requires same number of elements in each input."
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ install_requires =
cloudpickle >= 1.2.2
filelock >= 3.0.0
etelemetry >= 0.2.2
typing_extensions ; python_version < "3.8"

test_requires =
pytest >= 4.4.0, < 6.0.0
Expand Down

0 comments on commit 38ef59e

Please sign in to comment.