Skip to content

Commit 3cdfb72

Browse files
authored
Merge branch 'common-workflow-language:main' into ResourceRequirement-MinMax
2 parents a0a9dc3 + 135a0c6 commit 3cdfb72

File tree

9 files changed

+116
-8
lines changed

9 files changed

+116
-8
lines changed

.github/workflows/wheels.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
# platforms: all
4545

4646
- name: Build wheels
47-
uses: pypa/cibuildwheel@v3.2
47+
uses: pypa/cibuildwheel@v3.3
4848
env:
4949
CIBW_BUILD: ${{ matrix.build }}
5050
CIBW_MANYLINUX_X86_64_IMAGE: quay.io/pypa/${{ matrix.image }}
@@ -86,8 +86,8 @@ jobs:
8686
runs-on: ${{ matrix.os }}
8787
strategy:
8888
matrix:
89-
# macos-13 is an intel runner, macos-14 is apple silicon
90-
os: [macos-13, macos-14]
89+
# macos-15-intel is an intel runner, macos-14 is apple silicon
90+
os: [macos-15-intel, macos-14, macos-15]
9191
steps:
9292
- uses: actions/checkout@v5
9393
if: ${{ github.event_name != 'repository_dispatch' }}
@@ -100,7 +100,7 @@ jobs:
100100
ref: ${{ github.event.client_payload.ref }}
101101

102102
- name: Build wheels
103-
uses: pypa/cibuildwheel@v3.2
103+
uses: pypa/cibuildwheel@v3.3
104104

105105
- uses: actions/upload-artifact@v5
106106
with:

cwltool/command_line_tool.py

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from mypy_extensions import mypyc_attr
2828
from ruamel.yaml.comments import CommentedMap, CommentedSeq
29-
from schema_salad.avro.schema import Schema
29+
from schema_salad.avro.schema import RecordSchema
3030
from schema_salad.exceptions import ValidationException
3131
from schema_salad.ref_resolver import file_uri, uri_file_path
3232
from schema_salad.sourceline import SourceLine
@@ -1221,6 +1221,7 @@ def collect_output_ports(
12211221
if cwl_version != "v1.0":
12221222
builder.resources["exitCode"] = rcode
12231223
try:
1224+
expected_schema = cast(RecordSchema, self.names.get_name("outputs_record_schema", None))
12241225
fs_access = builder.make_fs_access(outdir)
12251226
custom_output = fs_access.join(outdir, "cwl.output.json")
12261227
if fs_access.exists(custom_output):
@@ -1232,6 +1233,20 @@ def collect_output_ports(
12321233
custom_output,
12331234
json_dumps(ret, indent=4),
12341235
)
1236+
if ORDERED_VERSIONS.index(cast(str, cwl_version)) >= ORDERED_VERSIONS.index(
1237+
"v1.3.0-dev1"
1238+
):
1239+
for k in list(ret):
1240+
found = False
1241+
for field in expected_schema.fields:
1242+
if k == field.name:
1243+
found = True
1244+
break
1245+
if not found:
1246+
_logger.warning(
1247+
f"Discarded undeclared output named {k!r} from {custom_output}."
1248+
)
1249+
ret.pop(k)
12351250
else:
12361251
for i, port in enumerate(ports):
12371252
with SourceLine(
@@ -1262,7 +1277,6 @@ def collect_output_ports(
12621277

12631278
if compute_checksum:
12641279
adjustFileObjs(ret, partial(compute_checksums, fs_access))
1265-
expected_schema = cast(Schema, self.names.get_name("outputs_record_schema", None))
12661280
validate_ex(
12671281
expected_schema,
12681282
ret,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ def _find_package_data(base: str, globs: list[str], root: str = "cwltool") -> li
176176
test_suite="tests",
177177
tests_require=[
178178
"bagit >= 1.6.4, < 1.10",
179-
"pytest >= 6.2, < 8.5",
179+
"pytest >= 6.2, < 9.1",
180180
"mock >= 2.0.0",
181181
"pytest-mock >= 1.10.0",
182182
"pytest-httpserver",

test-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
bagit>=1.6.4,<1.10
2-
pytest>= 6.2,< 8.5
2+
pytest>= 6.2,< 9.1
33
pytest-xdist>=3.2.0 # for the worksteal scheduler
44
psutil # enhances pytest-xdist to allow "-n logical"
55
pytest-httpserver

tests/test-cwl-out-v1.0.cwl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class: CommandLineTool
2+
cwlVersion: v1.0
3+
4+
inputs: []
5+
6+
baseCommand: sh
7+
8+
arguments:
9+
- -c
10+
- |
11+
echo '{"foo": 5 }'
12+
13+
stdout: cwl.output.json
14+
15+
outputs: {}

tests/test-cwl-out-v1.1.cwl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class: CommandLineTool
2+
cwlVersion: v1.1
3+
4+
inputs: []
5+
6+
baseCommand: sh
7+
8+
arguments:
9+
- -c
10+
- |
11+
echo '{"foo": 5 }'
12+
13+
stdout: cwl.output.json
14+
15+
outputs: {}

tests/test-cwl-out-v1.2.cwl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class: CommandLineTool
2+
cwlVersion: v1.2
3+
4+
inputs: []
5+
6+
baseCommand: sh
7+
8+
arguments:
9+
- -c
10+
- |
11+
echo '{"foo": 5 }'
12+
13+
stdout: cwl.output.json
14+
15+
outputs: {}

tests/test-cwl-out-v1.3.cwl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class: CommandLineTool
2+
cwlVersion: v1.3.0-dev1
3+
4+
inputs: []
5+
6+
baseCommand: sh
7+
8+
arguments:
9+
- -c
10+
- |
11+
echo '{"foo": 5 }'
12+
13+
stdout: cwl.output.json
14+
15+
outputs: {}

tests/test_cwl_output_json.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import json
2+
3+
from .util import get_data, get_main_output
4+
5+
6+
def test_cwl_output_json_missing_field_v1_0() -> None:
7+
"""Confirm that unknown outputs are propagated from cwl.output.json in CWL v1.0."""
8+
err_code, stdout, _ = get_main_output([get_data("tests/test-cwl-out-v1.0.cwl")])
9+
assert err_code == 0
10+
assert "foo" in json.loads(stdout)
11+
12+
13+
def test_cwl_output_json_missing_field_v1_1() -> None:
14+
"""Confirm that unknown outputs are propagated from cwl.output.json in CWL v1.1."""
15+
err_code, stdout, _ = get_main_output([get_data("tests/test-cwl-out-v1.1.cwl")])
16+
assert err_code == 0
17+
assert "foo" in json.loads(stdout)
18+
19+
20+
def test_cwl_output_json_missing_field_v1_2() -> None:
21+
"""Confirm that unknown outputs are propagated from cwl.output.json in CWL v1.2."""
22+
err_code, stdout, _ = get_main_output([get_data("tests/test-cwl-out-v1.2.cwl")])
23+
assert err_code == 0
24+
assert "foo" in json.loads(stdout)
25+
26+
27+
def test_cwl_output_json_missing_field_v1_3() -> None:
28+
"""Confirm that unknown outputs are propagated from cwl.output.json in CWL v1.3."""
29+
err_code, stdout, stderr = get_main_output(
30+
["--enable-dev", get_data("tests/test-cwl-out-v1.3.cwl")]
31+
)
32+
assert err_code == 0
33+
assert "foo" not in json.loads(stdout)
34+
assert "Discarded undeclared output named 'foo' from" in stderr

0 commit comments

Comments
 (0)