Skip to content

Commit a765204

Browse files
committed
WIP Migrate sections to use runcmd where possible
1 parent 587c2ae commit a765204

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+339
-564
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ watch: clean
2828
--ignore='**venv' \
2929
--ignore='**.github' \
3030
--ignore='*.egg-info' \
31+
--ignore='**_includes/**/*.txt' \
3132
--watch='cwl'
3233

3334
## unittest-examples :

cwl/sphinx/runcmd.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
import subprocess
55
import sys
66

7+
from pathlib import Path
8+
79
from docutils.parsers.rst import directives
810
from sphinx.directives import code
911

@@ -116,7 +118,12 @@ def run(self):
116118
# change to that working directory before running the desired command.
117119
# The working directory is omitted from the final output.
118120
# TODO: PATCHED
119-
working_directory = self.options.get('working-directory', 'src/_includes/cwl/')
121+
includes_dir = Path('src/_includes/cwl/')
122+
if not includes_dir.exists():
123+
# You can run Sphinx from the root directory, with `make watch`
124+
# for instance, or from the src directory (RTD does that).
125+
includes_dir = Path('_includes/cwl')
126+
working_directory = self.options.get('working-directory', includes_dir)
120127
if working_directory == '':
121128
# subprocess default value, so that we can disable it if needed.
122129
working_directory = None

src/_includes/cwl/05-stdout/echo-job.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.
Binary file not shown.

src/_includes/cwl/conformance-test.yml

Lines changed: 97 additions & 98 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,64 @@
1-
# Section 2
2-
- doc: Test for section 2
3-
job: 02-1st-example/echo-job.yml
4-
tool: hello_world.cwl
5-
should_fail: false
6-
output: {}
7-
8-
# Section 3
9-
- doc: Test for section 3
10-
job: 03-input/inp-job.yml
11-
tool: 03-input/inp.cwl
12-
should_fail: false
13-
output: {}
14-
15-
# Section 4
16-
- doc: Test for section 4
17-
job: 04-output/tar-job.yml
18-
tool: 04-output/tar.cwl
1+
# Expressions
2+
- doc: Test for Expressions section
3+
job: expressions/empty.yml
4+
tool: expressions/expression.cwl
195
output:
206
example_out:
217
class: File
22-
checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
23-
basename: hello.txt
8+
checksum: sha1$a739a6ff72d660d32111265e508ed2fc91f01a7c
9+
basename: output.txt
2410
location: Any
25-
size: 0
11+
size: 36
2612

27-
# Section 5
28-
- doc: Test for section 5
29-
job: 05-stdout/echo-job.yml
30-
tool: 05-stdout/stdout.cwl
13+
# Inputs
14+
- doc: Test for Essential Inputs section
15+
job: inputs/inp-job.yml
16+
tool: inputs/inp.cwl
17+
should_fail: false
18+
output: {}
19+
20+
- doc: Test for Array Inputs section
21+
job: inputs/array-inputs-job.yml
22+
tool: inputs/array-inputs.cwl
3123
output:
3224
example_out:
3325
class: File
34-
checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
26+
checksum: sha1$91038e29452bc77dcd21edef90a15075f3071540
3527
basename: output.txt
3628
location: Any
37-
size: 13
29+
size: 60
30+
31+
- doc: Test for Include and Exclusive Inputs section (1st example)
32+
job: inputs/record-job1.yml
33+
tool: inputs/record.cwl
34+
should_fail: true
3835

39-
# Section 6
40-
- doc: Test for section 6
41-
job: 06-params/tar-param-job.yml
42-
tool: 06-params/tar-param.cwl
36+
- doc: Test for Include and Exclusive Inputs section (2nd example)
37+
job: inputs/record-job2.yml
38+
tool: inputs/record.cwl
4339
output:
44-
extracted_file:
40+
example_out:
4541
class: File
46-
checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
47-
basename: goodbye.txt
42+
checksum: sha1$329fe3b598fed0dfd40f511522eaf386edb2d077
43+
basename: output.txt
4844
location: Any
49-
size: 0
45+
size: 23
5046

51-
# Section 7
52-
- doc: Test for section 7
53-
job: 07-containers/docker-job.yml
54-
tool: 07-containers/docker.cwl
47+
- doc: Test for Include and Exclusive Inputs section (3rd example)
48+
job: inputs/record-job3.yml
49+
tool: inputs/record.cwl
5550
output:
5651
example_out:
5752
class: File
58-
checksum: sha1$648a6a6ffffdaa0badb23b8baf90b6168dd16b3a
53+
checksum: sha1$77f572b28e441240a5e30eb14f1d300bcc13a3b4
5954
basename: output.txt
6055
location: Any
61-
size: 12
56+
size: 22
6257

63-
# Section 8
64-
- doc: Test for section 8
65-
job: 08-arguments/arguments-job.yml
66-
tool: 08-arguments/arguments.cwl
58+
# Additional Arguments and Parameters
59+
- doc: Test for Additional Arguments and Parameters section
60+
job: additional-arguments-and-parameters/arguments-job.yml
61+
tool: additional-arguments-and-parameters/arguments.cwl
6762
output:
6863
classfile:
6964
class: File
@@ -72,22 +67,44 @@
7267
location: Any
7368
size: 184
7469

75-
# Section 9
76-
- doc: Test for section 9
77-
job: 09-array-inputs/array-inputs-job.yml
78-
tool: 09-array-inputs/array-inputs.cwl
70+
# Parameter References
71+
- doc: Test for Parameter References section
72+
job: parameter-references/tar-param-job.yml
73+
tool: parameter-references/tar-param.cwl
74+
output:
75+
extracted_file:
76+
class: File
77+
checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
78+
basename: goodbye.txt
79+
location: Any
80+
size: 0
81+
82+
# Outputs
83+
- doc: Test for Outputs section
84+
job: outputs/tar-job.yml
85+
tool: outputs/tar.cwl
7986
output:
8087
example_out:
8188
class: File
82-
checksum: sha1$91038e29452bc77dcd21edef90a15075f3071540
89+
checksum: sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709
90+
basename: hello.txt
91+
location: Any
92+
size: 0
93+
94+
- doc: Test for Outputs, Capturing Standard Output section
95+
job: outputs/echo-job.yml
96+
tool: outputs/stdout.cwl
97+
output:
98+
example_out:
99+
class: File
100+
checksum: sha1$47a013e660d408619d894b20806b1d5086aab03b
83101
basename: output.txt
84102
location: Any
85-
size: 60
103+
size: 13
86104

87-
# Section 10
88-
- doc: Test for section 10
89-
job: 10-array-outputs/array-outputs-job.yml
90-
tool: 10-array-outputs/array-outputs.cwl
105+
- doc: Test for Outputs, Array Outputs section
106+
job: outputs/array-outputs-job.yml
107+
tool: outputs/array-outputs.cwl
91108
output:
92109
output:
93110
- class: File
@@ -101,33 +118,39 @@
101118
location: Any
102119
size: 0
103120

104-
# Section 11 depends on side-effects
105-
- doc: Test for section 11 (1st example)
106-
job: 11-records/record-job1.yml
107-
tool: 11-records/record.cwl
108-
should_fail: true
109-
110-
- doc: Test for section 11 (2nd example)
111-
job: 11-records/record-job2.yml
112-
tool: 11-records/record.cwl
121+
# Workflows
122+
- doc: Test for Workflows section
123+
job: workflows/1st-workflow-job.yml
124+
tool: workflows/1st-workflow.cwl
113125
output:
114-
example_out:
126+
compiled_class:
115127
class: File
116-
checksum: sha1$329fe3b598fed0dfd40f511522eaf386edb2d077
117-
basename: output.txt
128+
checksum: sha1$39e3219327347c05aa3e82236f83aa6d77fe6bfd
129+
basename: Hello.class
118130
location: Any
119-
size: 23
131+
size: 419
120132

121-
- doc: Test for section 11 (3rd example)
122-
job: 11-records/record-job3.yml
123-
tool: 11-records/record.cwl
133+
# TODO: The old section 23-scatter-workflow had workflows, but no conformance tests?
134+
# Maybe add them here, they are now in workflows:
135+
# - hello_world.cwl
136+
# - hello_world_to_stdout.cwl
137+
# - scatter-job.cwl
138+
# - scatter-nested-workflow.cwl
139+
# - scatter-two-steps.cwl
140+
# - scatter-workflow.cwl
141+
# - wc-tool.cwl
142+
143+
# Section 7
144+
- doc: Test for section 7
145+
job: 07-containers/docker-job.yml
146+
tool: 07-containers/docker.cwl
124147
output:
125148
example_out:
126149
class: File
127-
checksum: sha1$77f572b28e441240a5e30eb14f1d300bcc13a3b4
150+
checksum: sha1$648a6a6ffffdaa0badb23b8baf90b6168dd16b3a
128151
basename: output.txt
129152
location: Any
130-
size: 22
153+
size: 12
131154

132155
# Section 12
133156
- doc: Test for section 12
@@ -139,18 +162,6 @@
139162
basename: output.txt
140163
location: Any
141164

142-
# Section 13
143-
- doc: Test for section 13
144-
job: 13-expressions/empty.yml
145-
tool: 13-expressions/expression.cwl
146-
output:
147-
example_out:
148-
class: File
149-
checksum: sha1$a739a6ff72d660d32111265e508ed2fc91f01a7c
150-
basename: output.txt
151-
location: Any
152-
size: 36
153-
154165
# Section 14
155166
- doc: Test for section 14
156167
job: 14-runtime/echo-job.yml
@@ -222,26 +233,14 @@
222233
# See: Issue #48
223234
# - doc: Test for section 20
224235
# job: 20-software-requirements/custom-types.yml
225-
# tool: 20-software-requirements/costom-types.cwl
236+
# tool: 20-software-requirements/custom-types.cwl
226237
# output:
227238
# i5Annotations:
228239
# class: File
229240
# basename: test_proteins.i5_annotations
230241
# location: Any
231242
# size: Any # To be fixed
232243

233-
# Section 21
234-
- doc: Test for section 21
235-
job: 21-1st-workflow/1st-workflow-job.yml
236-
tool: 21-1st-workflow/1st-workflow.cwl
237-
output:
238-
compiled_class:
239-
class: File
240-
checksum: sha1$39e3219327347c05aa3e82236f83aa6d77fe6bfd
241-
basename: Hello.class
242-
location: Any
243-
size: 419
244-
245244
# Section 22
246245
- doc: Test for section 22
247246
tool: 22-nested-workflows/nestedworkflows.cwl
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-A 2 -B baz -C 10 9 8 7 6 5 4 3 2 1
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"message": "こんにちは世界"
3+
}
File renamed without changes.

src/_includes/cwl/inputs/output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-A one -B two -D four

src/_includes/cwl/outputs/baz.txt

Whitespace-only changes.

src/_includes/cwl/outputs/foo.txt

Whitespace-only changes.

src/_includes/cwl/outputs/hello.txt

Whitespace-only changes.

src/_includes/cwl/outputs/output.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Hello world!

src/_includes/cwl/parameter-references/goodbye.txt

Whitespace-only changes.
File renamed without changes.
419 Bytes
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env cwl-runner
2+
3+
cwlVersion: v1.0
4+
class: CommandLineTool
5+
baseCommand: echo
6+
inputs:
7+
message:
8+
type: string
9+
inputBinding:
10+
position: 1
11+
outputs:
12+
echo_out:
13+
type: stdout
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
message_array:
2+
- Hello world!
3+
- Hola mundo!
4+
- Bonjour le monde!
5+
- Hallo welt!
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env cwl-runner
2+
3+
cwlVersion: v1.0
4+
class: Workflow
5+
6+
requirements:
7+
ScatterFeatureRequirement: {}
8+
SubworkflowFeatureRequirement: {}
9+
10+
inputs:
11+
message_array: string[]
12+
13+
steps:
14+
subworkflow:
15+
run:
16+
class: Workflow
17+
inputs:
18+
message: string
19+
outputs: []
20+
steps:
21+
echo:
22+
run: hello_world_to_stdout.cwl
23+
in:
24+
message: message
25+
out: [echo_out]
26+
wc:
27+
run: wc-tool.cwl
28+
in:
29+
input_file: echo/echo_out
30+
out: []
31+
scatter: message
32+
in:
33+
message: message_array
34+
out: []
35+
outputs: []
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/env cwl-runner
2+
3+
cwlVersion: v1.0
4+
class: Workflow
5+
6+
requirements:
7+
ScatterFeatureRequirement: {}
8+
9+
inputs:
10+
message_array: string[]
11+
12+
steps:
13+
echo:
14+
run: hello_world_to_stdout.cwl
15+
scatter: message
16+
in:
17+
message: message_array
18+
out: [echo_out]
19+
wc:
20+
run: wc-tool.cwl
21+
scatter: input_file
22+
in:
23+
input_file: echo/echo_out
24+
out: []
25+
26+
outputs: []

0 commit comments

Comments
 (0)