Skip to content

Commit 8db9927

Browse files
committed
Merge remote-tracking branch 'refs/remotes/upstream/main' into on-error-abort
# Conflicts: # cwltool/errors.py
2 parents f249ccb + 67aa64a commit 8db9927

File tree

134 files changed

+13019
-385
lines changed

Some content is hidden

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

134 files changed

+13019
-385
lines changed

.github/workflows/ci-tests.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ jobs:
173173
- cwl-version: v1.2
174174
container: docker
175175
extras: "--fast-parser"
176+
- cwl-version: v1.3.0-dev1
177+
extras: "--relax-path-checks"
176178

177179
steps:
178180
- uses: actions/checkout@v4
@@ -266,7 +268,7 @@ jobs:
266268

267269
macos:
268270
name: Test on macos-latest
269-
runs-on: macos-latest
271+
runs-on: macos-13 # not latest, that is now an Apple Silicon M1, for which seqtk is not yet built on bioconda
270272
env:
271273
TOXENV: py312-unit
272274
steps:

.github/workflows/quay-publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
username: ${{ secrets.REGISTRY_USERNAME }}
3939
password: ${{ secrets.REGISTRY_PASSWORD }}
4040
- name: Build and publish cwltool_module image to Quay
41-
uses: docker/build-push-action@v5
41+
uses: docker/build-push-action@v6
4242
with:
4343
context: .
4444
file: cwltool.Dockerfile
@@ -49,7 +49,7 @@ jobs:
4949
cache-from: type=gha
5050
cache-to: type=gha,mode=max
5151
- name: Build and publish cwltool image to Quay
52-
uses: docker/build-push-action@v5
52+
uses: docker/build-push-action@v6
5353
with:
5454
context: .
5555
file: cwltool.Dockerfile

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ recursive-include mypy-stubs *.pyi *.py
77
include tests/*
88
include tests/cwl-conformance/cwltool-conftest.py
99
include tests/loop/*
10+
include tests/loop-ext/*
1011
include tests/tmp1/tmp2/tmp3/.gitkeep
1112
include tests/tmp4/alpha/*
1213
include tests/wf/*
@@ -54,6 +55,10 @@ include cwltool/schemas/v1.2/*.yml
5455
include cwltool/schemas/v1.2/*.md
5556
include cwltool/schemas/v1.2/salad/schema_salad/metaschema/*.yml
5657
include cwltool/schemas/v1.2/salad/schema_salad/metaschema/*.md
58+
include cwltool/schemas/v1.3.0-dev1/*.yml
59+
include cwltool/schemas/v1.3.0-dev1/*.md
60+
include cwltool/schemas/v1.3.0-dev1/salad/schema_salad/metaschema/*.yml
61+
include cwltool/schemas/v1.3.0-dev1/salad/schema_salad/metaschema/*.md
5762
include cwltool/extensions.yml
5863
include cwltool/extensions-v1.1.yml
5964
include cwltool/extensions-v1.2.yml

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,11 +160,11 @@ diff-cover.html: coverage.xml
160160

161161
## test : run the cwltool test suite
162162
test: $(PYSOURCES)
163-
python3 -m pytest -rs ${PYTEST_EXTRA}
163+
python3 -m pytest -rsfE ${PYTEST_EXTRA}
164164

165165
## testcov : run the cwltool test suite and collect coverage
166166
testcov: $(PYSOURCES)
167-
python3 -m pytest -rs --cov --cov-config=.coveragerc --cov-report= ${PYTEST_EXTRA}
167+
python3 -m pytest -rsfE --cov --cov-config=.coveragerc --cov-report= ${PYTEST_EXTRA}
168168

169169
sloccount.sc: $(PYSOURCES) Makefile
170170
sloccount --duplicates --wide --details $^ > $@
@@ -183,7 +183,7 @@ mypy: $(PYSOURCES)
183183

184184
mypyc: $(PYSOURCES)
185185
MYPYPATH=mypy-stubs CWLTOOL_USE_MYPYC=1 pip install --verbose -e . \
186-
&& pytest -rs -vv ${PYTEST_EXTRA}
186+
&& pytest -rsfE -vv ${PYTEST_EXTRA}
187187

188188
shellcheck: FORCE
189189
shellcheck build-cwltool-docker.sh cwl-docker.sh release-test.sh conformance-test.sh \

conformance-test.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ venv() {
1616
# VERSION=v1.2 GIT_TARGET=main CONTAINER=podman ./conformance_test.sh
1717

1818
# Version of the standard to test against
19-
# Current options: v1.0, v1.1, v1.2
19+
# Current options: v1.0, v1.1, v1.2, v1.3.0-dev1
2020
VERSION=${VERSION:-"v1.2"}
2121

2222
# Which commit of the standard's repo to use
@@ -78,7 +78,7 @@ else
7878
pip uninstall -y cwltool
7979
pip install -r"${SCRIPT_DIRECTORY}/mypy-requirements.txt"
8080
CWLTOOL_USE_MYPYC=1 MYPYPATH="${SCRIPT_DIRECTORY}/mypy-stubs" pip install "${SCRIPT_DIRECTORY}" -r"${SCRIPT_DIRECTORY}/requirements.txt"
81-
pip install 'cwltest>=2.5' pytest-cov pytest-xdist>=3.2.0 psutil
81+
pip install 'cwltest>=2.5,!=2.5.20240709060407' pytest-cov pytest-xdist>=3.2.0 psutil
8282
fi
8383

8484
# Set conformance test filename
@@ -121,7 +121,7 @@ if (( "${#exclusions[*]}" > 0 )); then
121121
fi
122122

123123
# Build command
124-
TEST_COMMAND="python -m pytest ${CONFORMANCE_TEST} -n logical --dist worksteal -rs --junit-xml=${TMP_DIR}/cwltool_conf_${VERSION}_${GIT_TARGET}_${CONTAINER}.xml -o junit_suite_name=cwltool_$(echo "${CWLTOOL_OPTIONS}" | tr "[:blank:]-" _)"
124+
TEST_COMMAND="python -m pytest ${CONFORMANCE_TEST} -n logical --dist worksteal -rsfE --junit-xml=${TMP_DIR}/cwltool_conf_${VERSION}_${GIT_TARGET}_${CONTAINER}.xml -o junit_suite_name=cwltool_$(echo "${CWLTOOL_OPTIONS}" | tr "[:blank:]-" _)"
125125
if [[ -n "${EXCLUDE}" ]] ; then
126126
TEST_COMMAND="${TEST_COMMAND} --cwl-exclude ${EXCLUDE}"
127127
fi

cwltool/builder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def content_limit_respected_read(f: IO[bytes]) -> str:
8686
:returns: the file contents
8787
:raises WorkflowException: if the file is too large
8888
"""
89-
return content_limit_respected_read_bytes(f).decode("utf-8")
89+
return str(content_limit_respected_read_bytes(f), "utf-8")
9090

9191

9292
def substitute(value: str, replace: str) -> str:

cwltool/checker.py

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -517,42 +517,33 @@ def is_conditional_step(param_to_step: Dict[str, CWLObjectType], parm_id: str) -
517517

518518

519519
def is_all_output_method_loop_step(param_to_step: Dict[str, CWLObjectType], parm_id: str) -> bool:
520-
"""Check if a step contains a http://commonwl.org/cwltool#Loop requirement with `all` outputMethod."""
520+
"""Check if a step contains a `loop` directive with `all` outputMethod."""
521521
source_step: Optional[MutableMapping[str, Any]] = param_to_step.get(parm_id)
522522
if source_step is not None:
523-
for requirement in source_step.get("requirements", []):
524-
if (
525-
requirement["class"] == "http://commonwl.org/cwltool#Loop"
526-
and requirement.get("outputMethod") == "all"
527-
):
528-
return True
523+
if source_step.get("loop") is not None and source_step.get("outputMethod") == "all":
524+
return True
529525
return False
530526

531527

532528
def loop_checker(steps: Iterator[MutableMapping[str, Any]]) -> None:
533529
"""
534-
Check http://commonwl.org/cwltool#Loop requirement compatibility with other directives.
530+
Check `loop` compatibility with other directives.
535531
536-
:raises ValidationException: If there is an incompatible combination between
537-
cwltool:loop and 'scatter' or 'when'.
532+
:raises ValidationException: If there is an incompatible combination between `loop` and `scatter`.
538533
"""
539534
exceptions = []
540535
for step in steps:
541-
requirements = {
542-
**{h["class"]: h for h in step.get("hints", [])},
543-
**{r["class"]: r for r in step.get("requirements", [])},
544-
}
545-
if "http://commonwl.org/cwltool#Loop" in requirements:
546-
if "when" in step:
536+
if "loop" in step:
537+
if "when" not in step:
547538
exceptions.append(
548539
SourceLine(step, "id").makeError(
549-
"The `cwltool:Loop` clause is not compatible with the `when` directive."
540+
"The `when` clause is mandatory when the `loop` directive is defined."
550541
)
551542
)
552543
if "scatter" in step:
553544
exceptions.append(
554545
SourceLine(step, "id").makeError(
555-
"The `cwltool:Loop` clause is not compatible with the `scatter` directive."
546+
"The `loop` clause is not compatible with the `scatter` directive."
556547
)
557548
)
558549
if exceptions:

cwltool/command_line_tool.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,8 +1369,8 @@ def collect_output(
13691369
else:
13701370
if binding.get("loadContents"):
13711371
with fs_access.open(cast(str, rfile["location"]), "rb") as f:
1372-
files["contents"] = content_limit_respected_read_bytes(f).decode(
1373-
"utf-8"
1372+
files["contents"] = str(
1373+
content_limit_respected_read_bytes(f), "utf-8"
13741374
)
13751375
if compute_checksum:
13761376
with fs_access.open(cast(str, rfile["location"]), "rb") as f:

cwltool/cwlprov/ro.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ def __str__(self) -> str:
106106
return f"ResearchObject <{self.ro_uuid}> in <{self.folder}>"
107107

108108
def _initialize(self) -> None:
109+
"""Initialize the bagit folder structure."""
109110
for research_obj_folder in (
110111
METADATA,
111112
DATA,
@@ -359,6 +360,7 @@ def add_annotation(
359360
return uri
360361

361362
def _ro_annotations(self) -> List[Annotation]:
363+
"""Append base RO and provenance annotations to the list of annotations."""
362364
annotations: List[Annotation] = []
363365
annotations.append(
364366
{
@@ -414,6 +416,7 @@ def _ro_annotations(self) -> List[Annotation]:
414416

415417
def _authored_by(self) -> Optional[AuthoredBy]:
416418
authored_by: AuthoredBy = {}
419+
"""Returns the authoredBy metadata if it was supplied on CLI"""
417420
if self.orcid:
418421
authored_by["orcid"] = self.orcid
419422
if self.full_name:
@@ -542,6 +545,7 @@ def add_to_manifest(self, rel_path: str, checksums: Dict[str, str]) -> None:
542545
checksum_file.write(line)
543546

544547
def _add_to_bagit(self, rel_path: str, **checksums: str) -> None:
548+
"""Compute file size and checksums and adds to bagit manifest."""
545549
if PurePosixPath(rel_path).is_absolute():
546550
raise ValueError(f"rel_path must be relative: {rel_path}")
547551
lpath = os.path.join(self.folder, local_path(rel_path))

cwltool/cwlrdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def printrdf(wflow: Process, ctx: ContextType, style: str) -> str:
2727
rdf = gather(wflow, ctx).serialize(format=style, encoding="utf-8")
2828
if not rdf:
2929
return ""
30-
return rdf.decode("utf-8")
30+
return str(rdf, "utf-8")
3131

3232

3333
def lastpart(uri: Any) -> str:

0 commit comments

Comments
 (0)