Skip to content

Commit 537b8db

Browse files
committed
Fix use of extensions in $graph
Fixes #2114
1 parent 250e684 commit 537b8db

File tree

4 files changed

+63
-0
lines changed

4 files changed

+63
-0
lines changed

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ include cwltool/schemas/v1.3.0-dev1/salad/schema_salad/metaschema/*.md
6464
include cwltool/extensions.yml
6565
include cwltool/extensions-v1.1.yml
6666
include cwltool/extensions-v1.2.yml
67+
include cwltool/extensions-v1.3.yml
6768
include cwltool/jshint/jshint_wrapper.js
6869
include cwltool/jshint/jshint.js
6970
include cwltool/hello.simg

cwltool/main.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,16 +645,19 @@ def setup_schema(
645645
ext10 = files("cwltool").joinpath("extensions.yml").read_text("utf-8")
646646
ext11 = files("cwltool").joinpath("extensions-v1.1.yml").read_text("utf-8")
647647
ext12 = files("cwltool").joinpath("extensions-v1.2.yml").read_text("utf-8")
648+
ext13 = files("cwltool").joinpath("extensions-v1.3.yml").read_text("utf-8")
648649
use_custom_schema("v1.0", "http://commonwl.org/cwltool", ext10)
649650
use_custom_schema("v1.1", "http://commonwl.org/cwltool", ext11)
650651
use_custom_schema("v1.2", "http://commonwl.org/cwltool", ext12)
652+
use_custom_schema("v1.3.0-dev1", "http://commonwl.org/cwltool", ext13)
651653
use_custom_schema("v1.2.0-dev1", "http://commonwl.org/cwltool", ext11)
652654
use_custom_schema("v1.2.0-dev2", "http://commonwl.org/cwltool", ext11)
653655
use_custom_schema("v1.2.0-dev3", "http://commonwl.org/cwltool", ext11)
654656
else:
655657
use_standard_schema("v1.0")
656658
use_standard_schema("v1.1")
657659
use_standard_schema("v1.2")
660+
use_standard_schema("v1.3.0-dev1")
658661
use_standard_schema("v1.2.0-dev1")
659662
use_standard_schema("v1.2.0-dev2")
660663
use_standard_schema("v1.2.0-dev3")

tests/test_ext.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,10 @@ def test_ext_validation_no_namespace_warning() -> None:
285285
"URI prefix 'cwltool' of 'cwltool:loop' not recognized, are you "
286286
"missing a $namespaces section?"
287287
) not in stderr
288+
289+
290+
def test_ext_in_dollarsign_graph() -> None:
291+
error_code, stdout, stderr = get_main_output(
292+
["--validate", "--enable-ext", get_data("tests/wf/hello_gpu.cwl")]
293+
)
294+
assert error_code == 0

tests/wf/hello_gpu.cwl

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#!/usr/bin/env cwl-runner
2+
cwlVersion: v1.0
3+
4+
$graph:
5+
6+
- class: Workflow
7+
id: main
8+
label: Test GPU
9+
doc: |
10+
Print GPU info.
11+
s:keywords: gpu
12+
s:softwareVersion: 0.1.0
13+
14+
inputs: []
15+
16+
outputs:
17+
echo:
18+
type: File
19+
outputSource: node_hello/echo
20+
21+
steps:
22+
node_hello:
23+
in: []
24+
run: '#hello-cl'
25+
out:
26+
- echo
27+
28+
- class: CommandLineTool
29+
id: hello-cl
30+
s:softwareVersion: 1.0.0
31+
32+
baseCommand: nvidia-smi
33+
arguments: []
34+
35+
requirements:
36+
cwltool:CUDARequirement:
37+
cudaVersionMin: "12.0"
38+
cudaComputeCapability: "7.5"
39+
cudaDeviceCountMin: 1
40+
cudaDeviceCountMax: 4
41+
inputs: []
42+
43+
outputs:
44+
echo:
45+
type: File
46+
outputBinding:
47+
glob: output.txt
48+
stdout: output.txt
49+
50+
$namespaces:
51+
cwltool: http://commonwl.org/cwltool#
52+
s: https://schema.org/

0 commit comments

Comments
 (0)