Skip to content

Commit 6f9110d

Browse files
authored
Merge branch 'main' into mount-only-dirs
2 parents b4f4d88 + f288e67 commit 6f9110d

Some content is hidden

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

41 files changed

+303
-197
lines changed

.github/workflows/ci-tests.yml

Lines changed: 178 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,178 @@
1+
name: Continous integration tests
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
env:
10+
singularity_version: 3.6.4
11+
12+
jobs:
13+
14+
tox:
15+
name: CI tests via Tox
16+
17+
runs-on: ubuntu-20.04
18+
19+
strategy:
20+
matrix:
21+
py-ver-major: [3]
22+
py-ver-minor: [6, 7, 8, 9]
23+
step: [lint, unit, bandit, mypy]
24+
25+
env:
26+
py-semver: ${{ format('{0}.{1}', matrix.py-ver-major, matrix.py-ver-minor) }}
27+
TOXENV: ${{ format('py{0}{1}-{2}', matrix.py-ver-major, matrix.py-ver-minor, matrix.step) }}
28+
29+
steps:
30+
- uses: actions/checkout@v2
31+
32+
- name: Set up Singularity
33+
if: ${{ matrix.step == 'unit' || matrix.step == 'mypy' }}
34+
uses: eWaterCycle/setup-singularity@v6
35+
with:
36+
singularity-version: ${{ env.singularity_version }}
37+
38+
- name: Give the test runner user a name to make provenance happy.
39+
if: ${{ matrix.step == 'unit' || matrix.step == 'mypy' }}
40+
run: sudo usermod -c 'CI Runner' $(whoami)
41+
42+
- name: Set up Python
43+
uses: actions/setup-python@v2
44+
with:
45+
python-version: ${{ env.py-semver }}
46+
47+
- name: Cache for pip
48+
uses: actions/cache@v2
49+
with:
50+
path: ~/.cache/pip
51+
key: ${{ runner.os }}-pip-${{ matrix.step }}-${{ hashFiles('requirements.txt', 'tox.ini') }}
52+
53+
- name: Upgrade setuptools and install tox
54+
run: |
55+
pip install -U pip setuptools wheel
56+
pip install tox tox-gh-actions
57+
58+
- name: MyPy cache
59+
if: ${{ matrix.step == 'mypy' }}
60+
uses: actions/cache@v2
61+
with:
62+
path: .mypy_cache/${{ env.py-semver }}
63+
key: mypy-${{ env.py-semver }}
64+
65+
- name: Test with tox
66+
run: tox
67+
68+
- name: Upload coverage to Codecov
69+
if: ${{ matrix.step == 'unit' }}
70+
uses: codecov/codecov-action@v1
71+
with:
72+
fail_ci_if_error: true
73+
74+
tox-style:
75+
name: CI linters via Tox
76+
77+
runs-on: ubuntu-20.04
78+
79+
strategy:
80+
matrix:
81+
step: [lint-readme, shellcheck, pydocstyle]
82+
83+
env:
84+
py-semver: 3.9
85+
TOXENV: ${{ format('py39-{0}', matrix.step) }}
86+
87+
steps:
88+
- uses: actions/checkout@v2
89+
with:
90+
fetch-depth: 0
91+
92+
- name: Set up Python
93+
uses: actions/setup-python@v2
94+
with:
95+
python-version: ${{ env.py-semver }}
96+
97+
- name: Cache for pip
98+
uses: actions/cache@v2
99+
with:
100+
path: ~/.cache/pip
101+
key: ${{ runner.os }}-pip-${{ matrix.step }}-${{ hashFiles('requirements.txt') }}
102+
103+
- name: Upgrade setuptools and install tox
104+
run: |
105+
pip install -U pip setuptools wheel
106+
pip install tox tox-gh-actions
107+
108+
- if: ${{ matrix.step == 'pydocstyle' && github.event_name == 'pull_request'}}
109+
name: Create local branch for diff-quality for PRs
110+
run: git branch ${{github.base_ref}} origin/${{github.base_ref}}
111+
112+
- name: Test with tox
113+
run: tox
114+
115+
conformance_tests:
116+
name: CWL spec conformance tests
117+
118+
runs-on: ubuntu-20.04
119+
120+
strategy:
121+
matrix:
122+
cwl-version: [v1.0, v1.1, v1.2]
123+
124+
steps:
125+
- uses: actions/checkout@v2
126+
127+
- name: Set up Python
128+
uses: actions/setup-python@v2
129+
with:
130+
python-version: 3.9
131+
132+
- name: Cache for pip
133+
uses: actions/cache@v2
134+
with:
135+
path: ~/.cache/pip
136+
key: ${{ runner.os }}-conformance-${{ matrix.step }}-${{ hashFiles('requirements.txt') }}
137+
138+
- name: Run CWL conformance tests ${{ matrix.cwl-version }}
139+
env:
140+
version: ${{ matrix.cwl-version }}
141+
run: ./conformance-test.sh
142+
143+
release_test:
144+
name: cwltool release test
145+
146+
runs-on: ubuntu-20.04
147+
148+
steps:
149+
- uses: actions/checkout@v2
150+
151+
- name: Set up Singularity
152+
uses: eWaterCycle/setup-singularity@v6
153+
with:
154+
singularity-version: ${{ env.singularity_version }}
155+
156+
- name: Set up Python
157+
uses: actions/setup-python@v2
158+
with:
159+
python-version: 3.9
160+
161+
- name: Give the test runner user a name to make provenance happy.
162+
run: sudo usermod -c 'CI Runner' $(whoami)
163+
164+
- name: Cache for pip
165+
uses: actions/cache@v2
166+
with:
167+
path: ~/.cache/pip
168+
key: ${{ runner.os }}-pip-release-${{ hashFiles('requirements.txt', 'test-requirements.txt') }}
169+
170+
- name: Install packages
171+
run: |
172+
pip install -U pip setuptools wheel
173+
pip install virtualenv
174+
175+
- name: Release test
176+
env:
177+
RELEASE_SKIP: head
178+
run: ./release-test.sh

.travis.singularity_key.txt

Lines changed: 0 additions & 70 deletions
This file was deleted.

.travis.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ mypyc: ${PYSOURCES}
172172
MYPYPATH=typeshed/2and3/:typeshed/3 CWLTOOL_USE_MYPYC=1 pip install --verbose -e . && pytest --ignore cwltool/schemas --basetemp ./tmp
173173

174174
shellcheck: FORCE
175-
shellcheck build-cwl-docker.sh cwl-docker.sh release-test.sh travis.bash \
175+
shellcheck build-cwl-docker.sh cwl-docker.sh release-test.sh conformance-test.sh \
176176
cwltool-in-docker.sh
177177

178178
release-test: FORCE

README.rst

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22
Common Workflow Language tool description reference implementation
33
==================================================================
44

5-
|Linux Status| |Windows Status| |Coverage Status| |Downloads|
5+
|Linux Status| |Debian Stable package| |Debian Testing package| |Windows Status| |Coverage Status| |Downloads|
66

7-
.. |Linux Status| image:: https://img.shields.io/travis/common-workflow-language/cwltool/main.svg?label=Linux%20builds
8-
:target: https://travis-ci.org/common-workflow-language/cwltool
7+
.. |Linux Status| image:: https://github.com/common-workflow-language/cwltool/actions/workflows/ci-tests.yml/badge.svg?branch=main
8+
:target: https://github.com/common-workflow-language/cwltool/actions/workflows/ci-tests.yml
9+
10+
.. |Debian Stable package| image:: https://badges.debian.net/badges/debian/stable/cwltool/version.svg
11+
:target: https://packages.debian.org/stable/cwltool
12+
13+
.. |Debian Testing package| image:: https://badges.debian.net/badges/debian/testing/cwltool/version.svg
14+
:target: https://packages.debian.org/testing/cwltool
915

1016
.. |Windows Status| image:: https://img.shields.io/appveyor/ci/mr-c/cwltool/main.svg?label=Windows%20builds
1117
:target: https://ci.appveyor.com/project/mr-c/cwltool
@@ -55,7 +61,7 @@ please follow the install instructions for `conda-forge <https://conda-forge.org
5561
conda install -c conda-forge cwltool
5662
5763
All of the above methods of installing ``cwltool`` use packages which might contain bugs already fixed in newer versions, or be missing features that you desire.
58-
If the packaged version of ``cwltool`` available to you is too old, then we recommend installing using ``pip`` and ``venv`::
64+
If the packaged version of ``cwltool`` available to you is too old, then we recommend installing using ``pip`` and ``venv``::
5965

6066
.. code:: bash
6167
File renamed without changes.

cwltool/__init__.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
"""Reference implementation of the CWL standards."""
22

33
__author__ = "[email protected]"
4+
5+
CWL_CONTENT_TYPES = [
6+
"text/plain",
7+
"application/json",
8+
"text/vnd.yaml",
9+
"text/yaml",
10+
"text/x-yaml",
11+
"application/x-yaml",
12+
]

cwltool/context.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
# move to a regular typing import when Python 3.3-3.6 is no longer supported
99
from ruamel.yaml.comments import CommentedMap
1010
from schema_salad.avro.schema import Names
11-
from schema_salad.ref_resolver import FetcherCallableType, Loader
11+
from schema_salad.ref_resolver import Loader
12+
from schema_salad.utils import FetcherCallableType
1213
from typing_extensions import TYPE_CHECKING
1314

1415
from .builder import Builder, HasReqsHints

cwltool/cwlrdf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from rdflib import Graph
66
from ruamel.yaml.comments import CommentedMap
77
from schema_salad.jsonld_context import makerdf
8-
from schema_salad.ref_resolver import ContextType
8+
from schema_salad.utils import ContextType
99

1010
from .cwlviewer import CWLViewer
1111
from .process import Process

cwltool/load_tool.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
json_dumps,
3232
)
3333

34-
from . import process, update
34+
from . import CWL_CONTENT_TYPES, process, update
3535
from .context import LoadingContext
3636
from .errors import WorkflowException
3737
from .loghandler import _logger
@@ -127,7 +127,10 @@ def fetch_document(
127127
resolver=loadingContext.resolver,
128128
document_loader=loadingContext.loader,
129129
)
130-
workflowobj = cast(CommentedMap, loadingContext.loader.fetch(fileuri))
130+
workflowobj = cast(
131+
CommentedMap,
132+
loadingContext.loader.fetch(fileuri, content_types=CWL_CONTENT_TYPES),
133+
)
131134
return loadingContext, workflowobj, uri
132135
if isinstance(argsworkflow, MutableMapping):
133136
uri = (

0 commit comments

Comments
 (0)