Skip to content

Commit 0fe6477

Browse files
tetronmr-c
authored andcommitted
Update parsers based on latest codegen, with mypy fixes
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <[email protected]>
1 parent 53a129b commit 0fe6477

File tree

5 files changed

+2676
-1238
lines changed

5 files changed

+2676
-1238
lines changed

cwl_utils/expression_refactor.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Dict,
1515
List,
1616
MutableSequence,
17+
MutableMapping,
1718
Optional,
1819
Tuple,
1920
Union,
@@ -43,7 +44,11 @@
4344
)
4445
from cwl_utils.parser import cwl_v1_0, cwl_v1_1, cwl_v1_2
4546

46-
save_type = Union[Dict[str, str], List[Union[Dict[str, str], List[Any], None]], None]
47+
save_type = Union[
48+
MutableMapping[str, Any],
49+
MutableSequence[Union[MutableMapping[str, Any], MutableSequence[Any], None]],
50+
None,
51+
]
4752

4853

4954
class saveCWL(Protocol):

cwl_utils/parser/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
LoadingOptions = Union[
1515
cwl_v1_0.LoadingOptions, cwl_v1_1.LoadingOptions, cwl_v1_2.LoadingOptions
1616
]
17-
Savable = Union[cwl_v1_0.Savable, cwl_v1_1.Savable, cwl_v1_2.Savable]
17+
Saveable = Union[cwl_v1_0.Saveable, cwl_v1_1.Saveable, cwl_v1_2.Saveable]
1818
Workflow = Union[cwl_v1_0.Workflow, cwl_v1_1.Workflow, cwl_v1_2.Workflow]
1919
WorkflowTypes = (cwl_v1_0.Workflow, cwl_v1_1.Workflow, cwl_v1_2.Workflow)
2020
WorkflowStep = Union[
@@ -157,16 +157,16 @@ def load_document_by_yaml(
157157

158158

159159
def save(
160-
val: Optional[Union[Savable, MutableSequence[Savable]]],
160+
val: Optional[Union[Saveable, MutableSequence[Saveable]]],
161161
top: bool = True,
162162
base_url: str = "",
163163
relative_uris: bool = True,
164164
) -> Any:
165165
"""Convert a given CWL object into a built-in typed object."""
166166
if (
167-
isinstance(val, cwl_v1_0.Savable)
168-
or isinstance(val, cwl_v1_1.Savable)
169-
or isinstance(val, cwl_v1_2.Savable)
167+
isinstance(val, cwl_v1_0.Saveable)
168+
or isinstance(val, cwl_v1_1.Saveable)
169+
or isinstance(val, cwl_v1_2.Saveable)
170170
):
171171
return val.save(top=top, base_url=base_url, relative_uris=relative_uris)
172172
if isinstance(val, MutableSequence):

0 commit comments

Comments
 (0)