Skip to content

Commit 7c47c7f

Browse files
authored
Merge branch 'master' into patch-1
2 parents f2745cb + 4ae77ad commit 7c47c7f

File tree

721 files changed

+21169
-8747
lines changed

Some content is hidden

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

721 files changed

+21169
-8747
lines changed

.dockerignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
.tox/
2+
.eggs/
3+
.vscode/
4+
build/
5+
dist/
6+
*.Dockerfile

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
tests/wf/whale.txt test eol=lf

.travis.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
sudo: false
1+
sudo: true
2+
services:
3+
- docker
24
language: python
35
cache: pip
46
python:

Jenkinsfile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
pipeline {
2+
agent {
3+
node {
4+
label 'windows'
5+
}
6+
7+
}
8+
stages {
9+
stage('build') {
10+
steps {
11+
withPythonEnv(pythonInstallation: 'Windows-CPython-36') {
12+
pybat(script: 'pip install .', returnStdout: true)
13+
pybat 'jenkins.bat'
14+
}
15+
16+
}
17+
}
18+
}
19+
post {
20+
always {
21+
junit 'tests.xml'
22+
23+
}
24+
25+
}
26+
}

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
include MANIFEST.in
12
include gittaggers.py Makefile cwltool.py
23
include tests/*
34
include tests/tmp1/tmp2/tmp3/.gitkeep

Makefile

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#
1616
1717

18-
# make pep8 to check for basic Python code compliance
18+
# make pycodestyle to check for basic Python code compliance
1919
# make autopep8 to fix most pep8 errors
2020
# make pylint to check Python code for enhanced compliance including naming
2121
# and documentation
@@ -26,7 +26,7 @@ MODULE=cwltool
2626
# `SHELL=bash` doesn't work for some, so don't use BASH-isms like
2727
# `[[` conditional expressions.
2828
PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
29-
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pydocstyle flake8 pytest isort mock
29+
DEVPKGS=pycodestyle diff_cover autopep8 pylint coverage pydocstyle flake8 pytest isort mock
3030
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
3131
python-flake8 python-mock shellcheck
3232
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --utc --date=`git log --first-parent \
@@ -71,15 +71,16 @@ clean: FORCE
7171
sort_imports:
7272
isort ${MODULE}/*.py tests/*.py setup.py
7373

74-
## pep8 : check Python code style
75-
pep8: $(PYSOURCES)
76-
pep8 --exclude=_version.py --show-source --show-pep8 $^ || true
74+
pep8: pycodestyle
75+
## pycodestyle : check Python code style
76+
pycodestyle: $(PYSOURCES)
77+
pycodestyle --exclude=_version.py --show-source --show-pep8 $^ || true
7778

78-
pep8_report.txt: $(PYSOURCES)
79-
pep8 --exclude=_version.py $^ > pep8_report.txt || true
79+
pycodestyle_report.txt: $(PYSOURCES)
80+
pycodestyle --exclude=_version.py $^ > $@ || true
8081

81-
diff_pep8_report: pep8_report.txt
82-
diff-quality --violations=pep8 pep8_report.txt
82+
diff_pycodestyle_report: pycodestyle_report.txt
83+
diff-quality --violations=pycodestyle $^
8384

8485
pep257: pydocstyle
8586
## pydocstyle : check Python code style
@@ -113,7 +114,7 @@ pylint_report.txt: ${PYSOURCES}
113114
diff_pylint_report: pylint_report.txt
114115
diff-quality --violations=pylint pylint_report.txt
115116

116-
.coverage: tests
117+
.coverage: testcov
117118

118119
coverage: .coverage
119120
coverage report
@@ -134,7 +135,11 @@ diff-cover.html: coverage-gcovr.xml coverage.xml
134135
--html-report diff-cover.html
135136

136137
## test : run the ${MODULE} test suite
137-
test: $(PYSOURCES)
138+
test: $(pysources)
139+
python setup.py test
140+
141+
## testcov : run the ${MODULE} test suite and collect coverage
142+
testcov: $(pysources)
138143
python setup.py test --addopts "--cov cwltool"
139144

140145
sloccount.sc: ${PYSOURCES} Makefile

README.rst

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

5-
CWL conformance tests: |Build Status| Travis CI: |Unix Build Status|
5+
CWL conformance tests: |Conformance Status| |Linux Status| |Windows Status| |Coverage Status|
66

7-
.. |Unix Build Status| image:: https://img.shields.io/travis/common-workflow-language/cwltool/master.svg?label=unix%20build
7+
8+
.. |Conformance Status| image:: https://ci.commonwl.org/buildStatus/icon?job=cwltool-conformance
9+
:target: https://ci.commonwl.org/job/cwltool-conformance/
10+
11+
.. |Linux Status| image:: https://img.shields.io/travis/common-workflow-language/cwltool/master.svg?label=Linux%20builds
812
:target: https://travis-ci.org/common-workflow-language/cwltool
913

14+
.. |Windows Status| image:: https://img.shields.io/appveyor/ci/mr-c/cwltool/master.svg?label=Windows%20builds
15+
:target: https://ci.appveyor.com/project/mr-c/cwltool
16+
17+
.. |Coverage Status| image:: https://img.shields.io/codecov/c/github/common-workflow-language/cwltool.svg
18+
:target: https://codecov.io/gh/common-workflow-language/cwltool
19+
1020
This is the reference implementation of the Common Workflow Language. It is
1121
intended to feature complete and provide comprehensive validation of CWL
1222
files as well as provide other tools related to working with CWL.
1323

14-
This is written and tested for Python ``2.7 and 3.x {x = 3, 4, 5, 6}``
24+
This is written and tested for `Python <https://www.python.org/>`_ ``2.7 and 3.x {x = 4, 5, 6}``
1525

1626
The reference implementation consists of two packages. The ``cwltool`` package
1727
is the primary Python module containing the reference implementation in the
@@ -78,6 +88,8 @@ List of all environment can be seen using:
7888
``tox --listenvs``
7989
and running a specfic test env using:
8090
``tox -e <env name>``
91+
and additionally run a specific test using this format:
92+
``tox -e py36-unit -- tests/test_examples.py::TestParamMatching``
8193

8294
- Running the entire suite of CWL conformance tests:
8395

@@ -110,9 +122,6 @@ and ``--tmp-outdir-prefix`` to somewhere under ``/Users``::
110122

111123
$ cwl-runner --tmp-outdir-prefix=/Users/username/project --tmpdir-prefix=/Users/username/project wc-tool.cwl wc-job.json
112124

113-
.. |Build Status| image:: https://ci.commonwl.org/buildStatus/icon?job=cwltool-conformance
114-
:target: https://ci.commonwl.org/job/cwltool-conformance/
115-
116125
Using user-space replacements for Docker
117126
----------------------------------------
118127

@@ -132,8 +141,8 @@ Run `cwltool` just as you normally would, but with the new option, e.g. from the
132141
.. code:: bash
133142
134143
cwltool --user-space-docker-cmd=udocker https://github.com/raw/common-workflow-language/common-workflow-language/master/v1.0/v1.0/test-cwl-out2.cwl https://github.com/common-workflow-language/common-workflow-language/blob/master/v1.0/v1.0/empty.json
135-
136-
or
144+
145+
or
137146

138147
.. code:: bash
139148

appveyor.yml

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,28 +14,45 @@ environment:
1414
PYTHON_VERSION: "2.7.x"
1515
PYTHON_ARCH: "64"
1616

17+
- PYTHON: "C:\\Python34"
18+
PYTHON_VERSION: "3.4.x"
19+
PYTHON_ARCH: "32"
20+
1721
- PYTHON: "C:\\Python34-x64"
1822
PYTHON_VERSION: "3.4.x"
1923
PYTHON_ARCH: "64"
2024

25+
- PYTHON: "C:\\Python35"
26+
PYTHON_VERSION: "3.5.x"
27+
PYTHON_ARCH: "32"
28+
2129
- PYTHON: "C:\\Python35-x64"
2230
PYTHON_VERSION: "3.5.x"
2331
PYTHON_ARCH: "64"
2432

33+
- PYTHON: "C:\\Python36"
34+
PYTHON_VERSION: "3.6.x"
35+
PYTHON_ARCH: "32"
36+
37+
- PYTHON: "C:\\Python36-x64"
38+
PYTHON_VERSION: "3.6.x"
39+
PYTHON_ARCH: "64"
2540

2641
install:
42+
- "%PYTHON%\\python.exe -m pip install -U wheel setuptools pip pytest mock"
2743
# Get the latest stable version of Node.js or io.js
2844
- ps: Install-Product node $env:nodejs_version
29-
- "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%"
3045

3146
build_script:
32-
- "%CMD_IN_ENV% python -m pip install -U setuptools pip"
33-
- "%CMD_IN_ENV% pip install pytest mock"
34-
- "%CMD_IN_ENV% pip install ."
35-
47+
- "%PYTHON%\\python.exe -m pip install ."
3648

3749
test_script:
38-
- "%CMD_IN_ENV% py.test --verbose -p no:cacheprovider"
50+
- "%PYTHON%\\python.exe -m pytest --verbose -p no:cacheprovider --junit-xml=tests.xml"
51+
52+
after_test:
53+
- ps: |
54+
$wc = New-Object 'System.Net.WebClient'
55+
$wc.UploadFile("https://ci.appveyor.com/api/testresults/junit/$($Env:APPVEYOR_JOB_ID)", (Resolve-Path .\tests.xml))
3956
4057
branches:
4158
only:

build-cwl-docker.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/bin/sh
22
set -e
3-
docker build --file=cwltool_module.Dockerfile --tag=commonworkflowlanguage/cwltool_module .
3+
docker build --file=cwltool.Dockerfile --tag=commonworkflowlanguage/cwltool-module --target module .
44
docker build --file=cwltool.Dockerfile --tag=commonworkflowlanguage/cwltool .
5+
6+
version=$(git describe --tags)
7+
echo $version | grep -vq '\-' >& /dev/null
8+
if [ $? -eq 0 ];then
9+
docker tag commonworkflowlanguage/cwltool-module commonworkflowlanguage/cwltool-module:$version
10+
docker tag commonworkflowlanguage/cwltool commonworkflowlanguage/cwltool:$version
11+
fi

cwl-docker.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
#!/bin/sh
2-
docker run --name=cwl-docker -v /var/lib/docker -i -t fedora-data true
3-
docker run --privileged -ti --volume=$PWD:$PWD -w=$PWD commonworkflowlanguage/cwltool $@
2+
exec docker run -v /var/run/docker.sock:/var/run/docker.sock -v /tmp:/tmp -v "$PWD":"$PWD" -w="$PWD" commonworkflowlanguage/cwltool "$@"

cwltool-in-docker.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/usr/bin/env sh
2+
if [ ! -S /var/run/docker.sock ]; then
3+
>&2 echo 'ERROR: cwltool cannot work inside a container without access to docker'
4+
>&2 echo 'Launch the container with the option -v /var/run/docker.sock:/var/run/docker.sock'
5+
exit 1
6+
elif [ "$PWD" = '/error' ]; then
7+
>&2 echo 'ERROR: cwltool cannot work without access to the current path'
8+
>&2 echo 'Launch the container with the options -v "$PWD":"$PWD" -w="$PWD"'
9+
exit 1
10+
else
11+
cwltool "$@"
12+
fi

cwltool.Dockerfile

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,27 @@
1-
FROM commonworkflowlanguage/cwltool_module
2-
3-
4-
# Let's start with some basic stuff.
5-
RUN apt-get update -qq && apt-get install -qqy \
6-
apt-transport-https \
7-
ca-certificates \
8-
curl \
9-
lxc \
10-
iptables \
11-
python-setuptools
12-
13-
# Install Docker from Docker Inc. repositories.
14-
RUN curl -sSL https://get.docker.com/ | sh
15-
16-
# Install the magic wrapper.
17-
ADD ./wrapdocker /usr/local/bin/wrapdocker
18-
RUN chmod +x /usr/local/bin/wrapdocker
19-
20-
VOLUME /var/lib/docker
21-
ENTRYPOINT ["wrapdocker", "cwltool"]
1+
FROM python:3.6-alpine as builder
2+
3+
RUN apk add --no-cache git
4+
5+
WORKDIR /cwltool
6+
COPY . .
7+
8+
RUN python setup.py bdist_wheel --dist-dir=/wheels
9+
RUN pip wheel -r requirements.txt --wheel-dir=/wheels
10+
RUN pip install --no-index --no-warn-script-location --root=/pythonroot/ /wheels/*.whl
11+
12+
FROM python:3.6-alpine as module
13+
LABEL maintainer [email protected]
14+
15+
RUN apk add --no-cache docker nodejs
16+
COPY --from=builder /pythonroot/ /
17+
18+
FROM python:3.6-alpine
19+
LABEL maintainer [email protected]
20+
21+
RUN apk add --no-cache docker nodejs
22+
COPY --from=builder /pythonroot/ /
23+
COPY cwltool-in-docker.sh /cwltool-in-docker.sh
24+
25+
WORKDIR /error
26+
27+
ENTRYPOINT ["/cwltool-in-docker.sh"]

cwltool/argparser.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,9 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
214214
parser.add_argument("--custom-net", type=Text,
215215
help="Will be passed to `docker run` as the '--net' "
216216
"parameter. Implies '--enable-net'.")
217+
parser.add_argument("--disable-validate", dest="do_validate",
218+
action="store_false", default=True,
219+
help=argparse.SUPPRESS)
217220

218221
exgroup = parser.add_mutually_exclusive_group()
219222
exgroup.add_argument("--enable-ga4gh-tool-registry", action="store_true", help="Enable resolution using GA4GH tool registry API",

0 commit comments

Comments
 (0)