Skip to content

Commit 7add211

Browse files
committed
Rev cwltool for a Python 3 fix.
There was a Python 3 problem with the dependency resolver stuff in the version previously targetted, reving this and praying. Had to replace some CWL draft 3 testing artifacts with version 1.0 since the former is not longer compatible with latest versions of CWL.
1 parent 978e6e2 commit 7add211

6 files changed

Lines changed: 68 additions & 16 deletions

File tree

project_templates/cwl_draft3_spec/cat1-tool.cwl

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env cwl-runner
2-
cwlVersion: cwl:draft-3
2+
cwlVersion: 'v1.0'
33
class: CommandLineTool
4-
description: "Print the contents of a file to stdout using 'cat' running in a docker container."
4+
doc: "Print the contents of a file to stdout using 'cat' running in a docker container."
55
hints:
66
- class: DockerRequirement
77
dockerPull: debian:wheezy
@@ -15,4 +15,5 @@ inputs:
1515
position: 0
1616
prefix: -n
1717
outputs: []
18-
baseCommand: cat
18+
baseCommand:
19+
- cat

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ gxformat2>=0.2.0
1515
ephemeris>=0.8
1616
galaxy-lib>=18.5.11
1717
html5lib>=0.9999999,!=0.99999999,!=0.999999999,!=1.0b10,!=1.0b09
18-
cwltool==1.0.20170828135420
18+
cwltool==1.0.20180508202931

tests/data/count-lines2-wf.cwl

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/usr/bin/env cwl-runner
2+
class: Workflow
3+
cwlVersion: v1.0
4+
requirements:
5+
InlineJavascriptRequirement: {}
6+
7+
inputs:
8+
file1:
9+
type: File
10+
11+
outputs:
12+
count_output:
13+
type: int
14+
outputSource: step2/parseInt_output
15+
16+
steps:
17+
step1:
18+
in:
19+
wc_file1: file1
20+
out: [wc_output]
21+
run:
22+
id: wc
23+
class: CommandLineTool
24+
inputs:
25+
wc_file1:
26+
type: File
27+
inputBinding: {}
28+
outputs:
29+
wc_output:
30+
type: File
31+
outputBinding:
32+
glob: output.txt
33+
stdout: output.txt
34+
baseCommand: wc
35+
36+
step2:
37+
in:
38+
parseInt_file1: step1/wc_output
39+
out: [parseInt_output]
40+
run:
41+
class: ExpressionTool
42+
inputs:
43+
parseInt_file1:
44+
type: File
45+
inputBinding: { loadContents: true }
46+
outputs:
47+
parseInt_output:
48+
type: int
49+
expression: >
50+
${return {'parseInt_output': parseInt(inputs.parseInt_file1.contents)};}

tests/data/int_tool.cwl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
class: ExpressionTool
33
requirements:
44
- class: InlineJavascriptRequirement
5-
cwlVersion: cwl:draft-3
5+
cwlVersion: 'v1.0'
66
inputs: []
77
outputs:
88
- { id: output, type: int }

tests/data/output_tests_tool.cwl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/usr/bin/env cwl-runner
22
class: CommandLineTool
3-
cwlVersion: cwl:draft-3
4-
description: "Print the contents of a file to stdout using 'cat' running in a docker container."
3+
cwlVersion: 'v1.0'
4+
doc: "Print the contents of a file to stdout using 'cat' running in a docker container."
55
hints:
66
- class: DockerRequirement
77
dockerPull: debian:wheezy
88
inputs:
9-
- id: file1
9+
file1:
1010
type: File
1111
label: Input File
12-
description: "The file that will be copied using 'cat'"
12+
doc: "The file that will be copied using 'cat'"
1313
inputBinding: {position: 1}
1414
outputs:
15-
- id: output_file
15+
output_file:
1616
type: File
1717
outputBinding: {glob: output.txt}
18-
baseCommand: cat
18+
baseCommand:
19+
- cat
1920
stdout: output.txt

tests/test_engines.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
from planemo.engine import engine_context
66
from planemo.runnable import for_path
77
from planemo.runnable import get_outputs
8-
from .test_utils import CWL_DRAFT3_DIR, test_context, TEST_DATA_DIR
8+
from .test_utils import test_context, TEST_DATA_DIR
99

10-
A_CWL_TOOL = os.path.join(CWL_DRAFT3_DIR, "cat3-tool.cwl")
11-
A_CWL_WORKFLOW = os.path.join(CWL_DRAFT3_DIR, "count-lines1-wf.cwl")
10+
A_CWL_TOOL = os.path.join(TEST_DATA_DIR, "tools", "ok-cat1-tool.cwl")
11+
A_CWL_WORKFLOW = os.path.join(TEST_DATA_DIR, "count-lines2-wf.cwl")
1212

1313
A_GALAXY_TOOL = os.path.join(TEST_DATA_DIR, "tools", "ok_select_param.xml")
1414
A_GALAXY_GA_WORKFLOW = os.path.join(TEST_DATA_DIR, "test_workflow_1.ga")
@@ -41,7 +41,7 @@ def test_can_handle():
4141

4242

4343
def test_outputs():
44-
outputs = get_outputs(for_path(A_CWL_TOOL))
44+
outputs = get_outputs(for_path(A_CWL_WORKFLOW))
4545
assert len(outputs) == 1
4646
output_id = outputs[0].get_id()
47-
assert output_id == "output_file"
47+
assert output_id == "count_output"

0 commit comments

Comments
 (0)