Skip to content

Commit cf846bc

Browse files
authored
Merge branch 'main' into pa/cwlutil-validator
2 parents b00b17e + 2a2216b commit cf846bc

29 files changed

+124
-41
lines changed

.github/workflows/ci-tests.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,3 +184,43 @@ jobs:
184184
- uses: actions/checkout@v3
185185
- name: build & test cwltool_module container
186186
run: ./build-cwltool-docker.sh
187+
188+
macos:
189+
name: CI test on macos-latest
190+
runs-on: macos-latest
191+
env:
192+
TOXENV: py310-unit
193+
steps:
194+
- uses: actions/checkout@v3
195+
with:
196+
fetch-depth: 0
197+
- name: Set up Python
198+
uses: actions/setup-python@v4
199+
with:
200+
python-version: "3.10"
201+
cache: pip
202+
cache-dependency-path: |
203+
requirements.txt
204+
tox.ini
205+
- name: Upgrade setuptools and install tox
206+
run: |
207+
pip install -U pip setuptools wheel
208+
pip install tox tox-gh-actions
209+
# # docker for mac install is not currently stable
210+
# - name: 'SETUP MacOS: load Homebrew cache'
211+
# uses: actions/cache@v3
212+
# if: runner.os == 'macOS'
213+
# with:
214+
# path: |
215+
# ~/Library/Caches/Homebrew/downloads/*--Docker.dmg
216+
# key: brew-actions-setup-docker-1.0.11
217+
# restore-keys: brew-actions-setup-docker-
218+
# - name: setup docker on macos (default stable version)
219+
# uses: docker-practice/actions-setup-docker@master
220+
- name: Test with tox
221+
run: tox
222+
- name: Upload coverage to Codecov
223+
if: ${{ matrix.step == 'unit' }}
224+
uses: codecov/codecov-action@v3
225+
with:
226+
fail_ci_if_error: true

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ For the more traditional workflow:
3131
- To begin using the virtual environment, it needs to be activated: `source venv/bin/activate`
3232
- To check if you have the virtual environment set up: `which python`
3333
and it should point to python executable in your virtualenv
34+
- Install the latest versions of `pip` and `wheel` with `pip install --upgrade pip wheel`
3435
- Install cwltool in development mode, along with development tools:
3536
`make install-dep dev`
3637
- Check the `cwltool` version which might be different from the version installed in

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@ diff-cover: coverage.xml
157157
diff-cover.html: coverage.xml
158158
diff-cover --compare-branch=main $^ --html-report $@
159159

160-
## test : run the ${MODULE} test suite
160+
## test : run the cwltool test suite
161161
test: check-python3 $(PYSOURCES)
162162
python -m pytest -rs ${PYTEST_EXTRA}
163163

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

build-cwltool-docker.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ docker run -t -v /var/run/docker.sock:/var/run/docker.sock \
77
-v /tmp:/tmp \
88
-v "$PWD":/tmp/cwltool \
99
quay.io/commonwl/cwltool_module /bin/sh -c \
10-
"apk add gcc bash && pip install -r/tmp/cwltool/test-requirements.txt ; pytest -k 'not (test_bioconda or test_double_overwrite or test_env_filtering or test_biocontainers or test_disable_file_overwrite_without_ext or test_disable_file_creation_in_outdir_with_ext or test_write_write_conflict or test_directory_literal_with_real_inputs_inside or test_revsort_workflow or test_stdin_with_id_preset)' --ignore-glob '*test_udocker.py' -n auto -v -rs --pyargs cwltool"
10+
"apk add gcc bash && pip install -r/tmp/cwltool/test-requirements.txt ; pytest -k 'not (test_bioconda or test_double_overwrite or test_env_filtering or test_biocontainers or test_disable_file_overwrite_without_ext or test_disable_file_creation_in_outdir_with_ext or test_write_write_conflict or test_directory_literal_with_real_inputs_inside or test_revsort_workflow or test_stdin_with_id_preset or test_no_compute_chcksum or test_packed_workflow_execution[tests/wf/count-lines1-wf.cwl-tests/wf/wc-job.json-False] or test_sequential_workflow or test_single_process_subwf_subwf_inline_step)' --ignore-glob '*test_udocker.py' -n 0 -v -rs --pyargs cwltool"

cwltool/argparser.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import urllib
66
from typing import (
77
Any,
8-
AnyStr,
98
Callable,
109
Dict,
1110
List,
@@ -18,8 +17,6 @@
1817
cast,
1918
)
2019

21-
from schema_salad.ref_resolver import file_uri
22-
2320
from .loghandler import _logger
2421
from .process import Process, shortname
2522
from .resolver import ga4gh_tool_registries

cwltool/command_line_tool.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
from functools import cmp_to_key, partial
1616
from typing import (
1717
Any,
18-
Callable,
1918
Dict,
2019
Generator,
2120
List,

cwltool/cuda.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import subprocess # nosec
22
import xml.dom.minidom # nosec
3-
from typing import Tuple, cast
3+
from typing import Tuple
44

55
from .loghandler import _logger
66
from .utils import CWLObjectType

cwltool/docker.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
from .builder import Builder
1818
from .context import RuntimeContext
19-
from .cuda import cuda_check
2019
from .docker_id import docker_vm_id
2120
from .errors import WorkflowException
2221
from .job import ContainerCommandLineJob

cwltool/provenance.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,7 @@ def __init__(
298298
self.cwltool_version = "cwltool %s" % versionstring().split()[-1]
299299
##
300300
self.relativised_input_object = {} # type: CWLObjectType
301+
self.has_manifest = False
301302

302303
self._initialize()
303304
_logger.debug("[provenance] Temporary research object: %s", self.folder)
@@ -355,6 +356,8 @@ def open_log_file_for_activity(
355356
def _finalize(self) -> None:
356357
self._write_ro_manifest()
357358
self._write_bag_info()
359+
if not self.has_manifest:
360+
(Path(self.folder) / "manifest-sha1.txt").touch()
358361

359362
def user_provenance(self, document: ProvDocument) -> None:
360363
"""Add the user provenance."""
@@ -853,6 +856,7 @@ def add_to_manifest(self, rel_path: str, checksums: Dict[str, str]) -> None:
853856
if os.path.commonprefix(["data/", rel_path]) == "data/":
854857
# payload file, go to manifest
855858
manifest = "manifest"
859+
self.has_manifest = True
856860
else:
857861
# metadata file, go to tag manifest
858862
manifest = "tagmanifest"

cwltool/provenance_profile.py

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,7 @@
2020
)
2121

2222
from prov.identifier import Identifier, QualifiedName
23-
from prov.model import (
24-
PROV,
25-
PROV_LABEL,
26-
PROV_TYPE,
27-
PROV_VALUE,
28-
ProvDocument,
29-
ProvEntity,
30-
ProvRecord,
31-
)
23+
from prov.model import PROV, PROV_LABEL, PROV_TYPE, PROV_VALUE, ProvDocument, ProvEntity
3224
from schema_salad.sourceline import SourceLine
3325
from typing_extensions import TYPE_CHECKING
3426

0 commit comments

Comments
 (0)