Skip to content

Commit 7b861b0

Browse files
committed
Merge remote-tracking branch 'origin/master' into non_ASCII_testing
2 parents 62eab92 + 2d0dbfe commit 7b861b0

Some content is hidden

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

90 files changed

+3989
-2323
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ eggs/
99
*.egg-info/
1010
*.egg
1111
.tox/
12+
.pytest_cache
1213

1314
# Editor Temps
1415
.*.sw?
@@ -44,4 +45,5 @@ output.txt
4445
pydocstyle_report.txt
4546
response.txt
4647
test.txt
48+
time.txt
4749
value

.travis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@ sudo: required
33
services:
44
- docker
55

6-
env:
7-
- SINGVER=2.5.1
8-
96
before_install:
107
- wget -O- http://neuro.debian.net/lists/trusty.us-nh.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
118
- sudo apt-key add .travis.singularity_key.txt

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
include MANIFEST.in
2+
include *requirements.txt
23
include gittaggers.py Makefile cwltool.py
34
include tests/*
45
include tests/tmp1/tmp2/tmp3/.gitkeep
56
include tests/wf/*
67
include tests/override/*
8+
include tests/checker_wf/*
79
include cwltool/schemas/v1.0/*.yml
810
include cwltool/schemas/draft-2/*.yml
911
include cwltool/schemas/draft-3/*.yml

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,12 @@ install-deb-dep:
5959

6060
## install : install the ${MODULE} module and schema-salad-tool
6161
install: FORCE
62-
pip install .
62+
pip install .[deps]
63+
64+
## dev : install the ${MODULE} module in dev mode
65+
dev: install-dep
66+
pip install -e .[deps]
67+
6368

6469
## dist : create a module package for distribution
6570
dist: dist/${MODULE}-$(VERSION).tar.gz
@@ -143,11 +148,11 @@ diff-cover.html: coverage.xml
143148

144149
## test : run the ${MODULE} test suite
145150
test: $(pysources)
146-
python setup.py test --addopt "-n$(shell expr $(nproc) / 2)"
151+
python setup.py test --addopts "-n$(nproc) --dist=loadfile"
147152

148153
## testcov : run the ${MODULE} test suite and collect coverage
149154
testcov: $(pysources)
150-
python setup.py test --addopts "--cov cwltool"
155+
python setup.py test --addopts "--cov cwltool -n$(nproc) --dist=loadfile"
151156

152157
sloccount.sc: ${PYSOURCES} Makefile
153158
sloccount --duplicates --wide --details $^ > sloccount.sc

appveyor.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,13 @@ install:
3535
- "%PYTHON%\\python.exe -m pip install -U codecov pytest-xdist pytest-cov galaxy-lib -rtest-requirements.txt"
3636
# Note the use of a `^` to escape the `>`
3737

38-
for:
39-
- matrix:
40-
only: [ { PYTHON_VERSION: "3.7.x" } ]
41-
before_build:
42-
- "%PYTHON%\\python.exe -m pip install https://download.lfd.uci.edu/pythonlibs/l8ulg3xw/lxml-4.2.3-cp37-cp37m-win_amd64.whl"
43-
4438
build_script:
4539
- "%PYTHON%\\python.exe -m pip install -rrequirements.txt"
4640

4741
test_script:
4842
- |
4943
%PYTHON%\\python.exe setup.py test --addopts "--cov-report xml --cov cwltool -p no:cacheprovider --junit-xml=tests.xml"
50-
- "%PYTHON%\\python.exe -m codecov"
44+
- "%PYTHON%\\python.exe -m codecov --file coverage.xml"
5145

5246
on_finish:
5347
- ps: |

build-cwl-docker.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
#!/bin/sh
1+
#!/bin/bash
22
set -e
3-
docker build --file=cwltool.Dockerfile --tag=commonworkflowlanguage/cwltool-module --target module .
3+
docker build --file=cwltool.Dockerfile --tag=commonworkflowlanguage/cwltool_module --target module .
44
docker build --file=cwltool.Dockerfile --tag=commonworkflowlanguage/cwltool .
55

66
version=$(git describe --tags)
77
echo $version | grep -vq '\-' >& /dev/null
88
if [ $? -eq 0 ];then
9-
docker tag commonworkflowlanguage/cwltool-module commonworkflowlanguage/cwltool-module:$version
9+
docker tag commonworkflowlanguage/cwltool_module commonworkflowlanguage/cwltool_module:$version
1010
docker tag commonworkflowlanguage/cwltool commonworkflowlanguage/cwltool:$version
1111
fi

cwltool.Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
FROM python:3.6-alpine as builder
22

3-
RUN apk add --no-cache git
3+
RUN apk add --no-cache git gcc python3-dev libxml2-dev libxslt-dev libc-dev linux-headers
44

55
WORKDIR /cwltool
66
COPY . .
@@ -12,13 +12,13 @@ RUN pip install --no-index --no-warn-script-location --root=/pythonroot/ /wheels
1212
FROM python:3.6-alpine as module
1313
LABEL maintainer [email protected]
1414

15-
RUN apk add --no-cache docker nodejs
15+
RUN apk add --no-cache docker nodejs graphviz libxml2 libxslt
1616
COPY --from=builder /pythonroot/ /
1717

1818
FROM python:3.6-alpine
1919
LABEL maintainer [email protected]
2020

21-
RUN apk add --no-cache docker nodejs
21+
RUN apk add --no-cache docker nodejs graphviz libxml2 libxslt
2222
COPY --from=builder /pythonroot/ /
2323
COPY cwltool-in-docker.sh /cwltool-in-docker.sh
2424

cwltool.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111
from cwltool import main
1212

1313
if __name__ == "__main__":
14-
sys.exit(main.main(sys.argv[1:]))
14+
main.run(sys.argv[1:])

cwltool/__main__.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1+
"""Default entrypoint for the cwltool module."""
12
from __future__ import absolute_import
23

3-
import sys
4-
54
from . import main
65

7-
sys.exit(main.main())
6+
main.run()

cwltool/argparser.py

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
"""Command line argument parsing for cwltool."""
12
from __future__ import absolute_import, print_function
23

34
import argparse
45
import os
5-
from typing import (Any, AnyStr, Dict, List, # pylint: disable=unused-import
6-
Optional, Sequence, Text, Union, cast)
6+
from typing import (Any, AnyStr, Dict, List, MutableMapping, MutableSequence,
7+
Optional, Sequence, Union, cast)
78

89
from schema_salad.ref_resolver import file_uri
10+
from typing_extensions import Text # pylint: disable=unused-import
11+
# move to a regular typing import when Python 3.3-3.6 is no longer supported
912

1013
from .loghandler import _logger
1114
from .process import Process, shortname # pylint: disable=unused-import
@@ -25,44 +28,43 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
2528
help="[experimental] Run jobs in parallel. ")
2629
envgroup = parser.add_mutually_exclusive_group()
2730
envgroup.add_argument("--preserve-environment", type=Text, action="append",
28-
help="Preserve specific environment variable when "
29-
"running CommandLineTools. May be provided multiple "
30-
"times.", metavar="ENVVAR", default=["PATH"],
31-
dest="preserve_environment")
31+
help="Preserve specific environment variable when "
32+
"running CommandLineTools. May be provided multiple "
33+
"times.", metavar="ENVVAR", default=["PATH"],
34+
dest="preserve_environment")
3235
envgroup.add_argument("--preserve-entire-environment", action="store_true",
33-
help="Preserve all environment variable when running "
34-
"CommandLineTools.", default=False,
35-
dest="preserve_entire_environment")
36+
help="Preserve all environment variable when running "
37+
"CommandLineTools.", default=False,
38+
dest="preserve_entire_environment")
3639

3740
exgroup = parser.add_mutually_exclusive_group()
3841
exgroup.add_argument("--rm-container", action="store_true", default=True,
3942
help="Delete Docker container used by jobs after they exit (default)",
4043
dest="rm_container")
4144

42-
exgroup.add_argument("--leave-container", action="store_false",
43-
default=True, help="Do not delete Docker container used by jobs after they exit",
44-
dest="rm_container")
45+
exgroup.add_argument(
46+
"--leave-container", action="store_false", default=True,
47+
help="Do not delete Docker container used by jobs after they exit",
48+
dest="rm_container")
4549

46-
cidgroup = parser.add_argument_group("Options for recording the Docker "
47-
"container identifier into a file")
50+
cidgroup = parser.add_argument_group(
51+
"Options for recording the Docker container identifier into a file")
4852
cidgroup.add_argument("--record-container-id", action="store_true",
4953
default=False,
5054
help="If enabled, store the Docker container ID into a file. "
5155
"See --cidfile-dir to specify the directory.",
5256
dest="record_container_id")
5357

54-
cidgroup.add_argument("--cidfile-dir", type=Text,
55-
help="Directory for storing the Docker container ID file. "
56-
"The default is the current directory",
57-
default="",
58-
dest="cidfile_dir")
58+
cidgroup.add_argument(
59+
"--cidfile-dir", type=Text, help="Directory for storing the Docker "
60+
"container ID file. The default is the current directory",
61+
default="", dest="cidfile_dir")
5962

60-
cidgroup.add_argument("--cidfile-prefix", type=Text,
61-
help="Specify a prefix to the container ID filename. "
62-
"Final file name will be followed by a timestamp. "
63-
"The default is no prefix.",
64-
default="",
65-
dest="cidfile_prefix")
63+
cidgroup.add_argument(
64+
"--cidfile-prefix", type=Text,
65+
help="Specify a prefix to the container ID filename. "
66+
"Final file name will be followed by a timestamp. The default is no prefix.",
67+
default="", dest="cidfile_prefix")
6668

6769
parser.add_argument("--tmpdir-prefix", type=Text,
6870
help="Path prefix for temporary directories",
@@ -73,8 +75,9 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
7375
help="Path prefix for intermediate output directories",
7476
default=DEFAULT_TMP_PREFIX)
7577

76-
exgroup.add_argument("--cachedir", type=Text, default="",
77-
help="Directory to cache intermediate workflow outputs to avoid recomputing steps.")
78+
exgroup.add_argument(
79+
"--cachedir", type=Text, default="",
80+
help="Directory to cache intermediate workflow outputs to avoid recomputing steps.")
7881

7982
exgroup = parser.add_mutually_exclusive_group()
8083
exgroup.add_argument("--rm-tmpdir", action="store_true", default=True,
@@ -86,9 +89,10 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
8689
dest="rm_tmpdir")
8790

8891
exgroup = parser.add_mutually_exclusive_group()
89-
exgroup.add_argument("--move-outputs", action="store_const", const="move", default="move",
90-
help="Move output files to the workflow output directory and delete intermediate output directories (default).",
91-
dest="move_outputs")
92+
exgroup.add_argument(
93+
"--move-outputs", action="store_const", const="move", default="move",
94+
help="Move output files to the workflow output directory and delete "
95+
"intermediate output directories (default).", dest="move_outputs")
9296

9397
exgroup.add_argument("--leave-outputs", action="store_const", const="leave", default="move",
9498
help="Leave output files in intermediate output directories.",
@@ -378,7 +382,7 @@ def add_argument(toolparser, name, inptype, records, description="",
378382
flag = "--"
379383

380384
required = True
381-
if isinstance(inptype, list):
385+
if isinstance(inptype, MutableSequence):
382386
if inptype[0] == "null":
383387
required = False
384388
if len(inptype) == 2:
@@ -395,16 +399,16 @@ def add_argument(toolparser, name, inptype, records, description="",
395399
action = cast(argparse.Action, FileAction)
396400
elif inptype == "Directory":
397401
action = cast(argparse.Action, DirectoryAction)
398-
elif isinstance(inptype, dict) and inptype["type"] == "array":
402+
elif isinstance(inptype, MutableMapping) and inptype["type"] == "array":
399403
if inptype["items"] == "File":
400404
action = cast(argparse.Action, FileAppendAction)
401405
elif inptype["items"] == "Directory":
402406
action = cast(argparse.Action, DirectoryAppendAction)
403407
else:
404408
action = "append"
405-
elif isinstance(inptype, dict) and inptype["type"] == "enum":
409+
elif isinstance(inptype, MutableMapping) and inptype["type"] == "enum":
406410
atype = Text
407-
elif isinstance(inptype, dict) and inptype["type"] == "record":
411+
elif isinstance(inptype, MutableMapping) and inptype["type"] == "record":
408412
records.append(name)
409413
for field in inptype['fields']:
410414
fieldname = name + "." + shortname(field['name'])

0 commit comments

Comments
 (0)