Skip to content

Commit 70ffd64

Browse files
committed
Merge branch 'loop_prototype' of github.com:common-workflow-language/cwltool into loop_prototype
2 parents cfbd17e + c61f6f5 commit 70ffd64

File tree

6 files changed

+26
-3
lines changed

6 files changed

+26
-3
lines changed

cwltool/checker.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,8 @@ def check_all_types(
386386
message="Source is from conditional step, but pickValue is not used",
387387
)
388388
)
389+
if is_all_output_method_loop_step(param_to_step, parm_id):
390+
src_dict[parm_id]['type'] = {'type': 'array', 'items': src_dict[parm_id]['type']}
389391
else:
390392
parm_id = cast(str, sink[sourceField])
391393
if parm_id not in src_dict:
@@ -427,6 +429,9 @@ def check_all_types(
427429

428430
srcs_of_sink[0]["type"] = src_typ
429431

432+
if is_all_output_method_loop_step(param_to_step, parm_id):
433+
src_dict[parm_id]['type'] = {'type': 'array', 'items': src_dict[parm_id]['type']}
434+
430435
for src in srcs_of_sink:
431436
check_result = check_types(src, sink, linkMerge, valueFrom)
432437
if check_result == "warning":
@@ -514,3 +519,16 @@ def is_conditional_step(param_to_step: Dict[str, CWLObjectType], parm_id: str) -
514519
if source_step.get("when") is not None:
515520
return True
516521
return False
522+
523+
524+
def is_all_output_method_loop_step(param_to_step: Dict[str, CWLObjectType], parm_id: str) -> bool:
525+
source_step = param_to_step.get(parm_id)
526+
if source_step is not None:
527+
requirements = {
528+
**{h['class']: h for h in source_step.get('hints', [])},
529+
**{r['class']: r for r in source_step.get('requirements', [])}}
530+
if 'http://commonwl.org/cwltool#Loop' in requirements:
531+
output_method = requirements['http://commonwl.org/cwltool#Loop'].get('outputMethod', 'last')
532+
if output_method == 'all':
533+
return True
534+
return False

cwltool/extensions-v1.2.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ $graph:
135135
type:
136136
- string?
137137
- string[]?
138+
jsonldPredicate:
139+
"_type": "@id"
140+
refScope: 1
138141
linkMerge:
139142
type: cwl:LinkMergeMethod?
140143
jsonldPredicate: "cwl:linkMerge"

mypy-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
mypy==0.950
1+
mypy==0.961
22
types-requests
33
types-setuptools
44
types-psutil

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
requests>=2.4.3
22
ruamel.yaml>=0.15,<0.17.22
33
rdflib>=4.2.2,<6.2
4+
rdflib>= 4.2.2, < 6.0.0;python_version<='3.6'
45
shellescape>=3.4.1,<3.9
56
schema-salad>=8.2.20211104054942,<9
67
prov==1.5.1

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@
110110
# https://github.com/ionrock/cachecontrol/issues/137
111111
"ruamel.yaml >= 0.15, < 0.17.22",
112112
"rdflib >= 4.2.2, < 6.2.0",
113+
"rdflib >= 4.2.2, < 6.0.0;python_version<='3.6'",
113114
"shellescape >= 3.4.1, < 3.9",
114115
"schema-salad >= 8.2.20211104054942, < 9",
115116
"mypy-extensions",
@@ -134,7 +135,7 @@
134135
"mock >= 2.0.0",
135136
"pytest-mock >= 1.10.0",
136137
"arcp >= 0.2.0",
137-
"rdflib-jsonld >= 0.4.0",
138+
"rdflib-jsonld>=0.4.0, <= 0.6.1;python_version<='3.6'",
138139
],
139140
entry_points={"console_scripts": ["cwltool=cwltool.main:run"]},
140141
zip_safe=True,

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ mock >= 2.0.0
44
pytest-mock >= 1.10.0
55
pytest-cov
66
arcp >= 0.2.0
7-
rdflib-jsonld >= 0.4.0
7+
rdflib-jsonld>=0.4.0, <= 0.6.1;python_version<='3.6'
88
-rrequirements.txt

0 commit comments

Comments
 (0)