Skip to content

Commit 136d34b

Browse files
Add CWL objects to parser __init__.py
This commit adds some objects to the `__init__.py` file of the `parser` module to allow for version-independent reference in Python typing.
1 parent 282a7c0 commit 136d34b

File tree

1 file changed

+66
-0
lines changed

1 file changed

+66
-0
lines changed

cwl_utils/parser/__init__.py

+66
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,58 @@
2121
cwl_v1_0.InputParameter, cwl_v1_1.InputParameter, cwl_v1_2.InputParameter
2222
]
2323
"""Type union for a CWL v1.x InputParameter object."""
24+
InputArraySchema = Union[
25+
cwl_v1_0.InputArraySchema,
26+
cwl_v1_1.InputArraySchema,
27+
cwl_v1_2.InputArraySchema,
28+
]
29+
"""Type union for a CWL v1.x InputArraySchema object."""
30+
InputEnumSchema = Union[
31+
cwl_v1_0.InputEnumSchema,
32+
cwl_v1_1.InputEnumSchema,
33+
cwl_v1_2.InputEnumSchema,
34+
]
35+
"""Type union for a CWL v1.x InputEnumSchema object."""
36+
InputRecordField = Union[
37+
cwl_v1_0.InputRecordField,
38+
cwl_v1_1.InputRecordField,
39+
cwl_v1_2.InputRecordField,
40+
]
41+
"""Type union for a CWL v1.x InputRecordField object."""
42+
InputRecordSchema = Union[
43+
cwl_v1_0.InputRecordSchema,
44+
cwl_v1_1.InputRecordSchema,
45+
cwl_v1_2.InputRecordSchema,
46+
]
47+
"""Type union for a CWL v1.x InputRecordSchema object."""
2448
OutputParameter = Union[
2549
cwl_v1_0.OutputParameter, cwl_v1_1.OutputParameter, cwl_v1_2.OutputParameter
2650
]
2751
"""Type union for a CWL v1.x OutputParameter object."""
52+
OutputArraySchema = Union[
53+
cwl_v1_0.OutputArraySchema,
54+
cwl_v1_1.OutputArraySchema,
55+
cwl_v1_2.OutputArraySchema,
56+
]
57+
"""Type union for a CWL v1.x OutputArraySchema object."""
58+
OutputEnumSchema = Union[
59+
cwl_v1_0.OutputEnumSchema,
60+
cwl_v1_1.OutputEnumSchema,
61+
cwl_v1_2.OutputEnumSchema,
62+
]
63+
"""Type union for a CWL v1.x OutputEnumSchema object."""
64+
OutputRecordField = Union[
65+
cwl_v1_0.OutputRecordField,
66+
cwl_v1_1.OutputRecordField,
67+
cwl_v1_2.OutputRecordField,
68+
]
69+
"""Type union for a CWL v1.x OutputRecordField object."""
70+
OutputRecordSchema = Union[
71+
cwl_v1_0.OutputRecordSchema,
72+
cwl_v1_1.OutputRecordSchema,
73+
cwl_v1_2.OutputRecordSchema,
74+
]
75+
"""Type union for a CWL v1.x OutputRecordSchema object."""
2876
Workflow = Union[cwl_v1_0.Workflow, cwl_v1_1.Workflow, cwl_v1_2.Workflow]
2977
WorkflowTypes = (cwl_v1_0.Workflow, cwl_v1_1.Workflow, cwl_v1_2.Workflow)
3078
"""Type union for a CWL v1.x Workflow object."""
@@ -64,6 +112,18 @@
64112
cwl_v1_2.CommandLineBinding,
65113
]
66114
"""Type union for a CWL v1.x CommandLineBinding object."""
115+
CommandOutputBinding = Union[
116+
cwl_v1_0.CommandOutputBinding,
117+
cwl_v1_1.CommandOutputBinding,
118+
cwl_v1_2.CommandOutputBinding,
119+
]
120+
"""Type union for a CWL v1.x CommandOutputBinding object."""
121+
CommandInputParameter = Union[
122+
cwl_v1_0.CommandInputParameter,
123+
cwl_v1_1.CommandInputParameter,
124+
cwl_v1_2.CommandInputParameter,
125+
]
126+
"""Type union for a CWL v1.x CommandInputParameter object."""
67127
CommandOutputParameter = Union[
68128
cwl_v1_0.CommandOutputParameter,
69129
cwl_v1_1.CommandOutputParameter,
@@ -74,6 +134,12 @@
74134
cwl_v1_0.ExpressionTool, cwl_v1_1.ExpressionTool, cwl_v1_2.ExpressionTool
75135
]
76136
"""Type union for a CWL v1.x ExpressionTool object."""
137+
ExpressionToolOutputParameter = Union[
138+
cwl_v1_0.ExpressionToolOutputParameter,
139+
cwl_v1_1.ExpressionToolOutputParameter,
140+
cwl_v1_2.ExpressionToolOutputParameter,
141+
]
142+
"""Type union for a CWL v1.x ExpressionToolOutputParameter object."""
77143
DockerRequirement = Union[
78144
cwl_v1_0.DockerRequirement, cwl_v1_1.DockerRequirement, cwl_v1_2.DockerRequirement
79145
]

0 commit comments

Comments
 (0)