Skip to content

Commit 394f7e6

Browse files
authored
Merge branch 'master' into defaultcheck
2 parents c9d6e13 + 5b2cd24 commit 394f7e6

File tree

124 files changed

+3011
-571
lines changed

Some content is hidden

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

124 files changed

+3011
-571
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
This issue tracker is for reporting bugs in cwltool (the CWL reference implementation) itself. Please use the [Gitter channel](https://gitter.im/common-workflow-language/common-workflow-language) or [Biostars forum](https://www.biostars.org/) for general questions about using cwltool to create/run workflows or issues not related to cwltool. Don't forget to use cwl tag when posting on Biostars Forum.
2+
3+
If you'd like to report a bug, fill out the template below and provide any extra information that may be useful / related to your problem. Ideally, you create an [a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) reproducing the problem before opening an issue to ensure it's not caused by something in your code.
4+
5+
Before you submit, please delete this help text above the ---
6+
Thanks!
7+
---
8+
9+
## Expected Behavior
10+
Tell us what should happen
11+
12+
## Actual Behavior
13+
Tell us what happens instead
14+
15+
## Workflow Code
16+
```
17+
Paste the template code (ideally a minimal example) that causes the issue
18+
19+
```
20+
21+
## Full Traceback
22+
```pytb
23+
Paste the full traceback in case there is an exception
24+
Run the workflow with ``--debug`` flag for more verbose logging
25+
```
26+
27+
## Your Environment
28+
* cwltool version:
29+
Check using ``cwltool --version``

.travis.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ install:
1313
script: tox
1414
notifications:
1515
email: false
16+
branches:
17+
only:
18+
- master

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
include gittaggers.py Makefile cwltool.py
22
include tests/*
3+
include tests/tmp1/tmp2/tmp3/.gitkeep
34
include tests/wf/*
45
include cwltool/schemas/v1.0/*.yml
56
include cwltool/schemas/draft-2/*.yml

Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ 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 pep257 flake8 pytest
30-
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pep257 sloccount python-flake8
29+
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pep257 flake8 pytest isort mock
30+
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pep257 sloccount python-flake8 python-mock
3131
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --date=`git log --first-parent \
3232
--max-count=1 --format=format:%cI`)
3333
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
@@ -65,6 +65,11 @@ clean: FORCE
6565
rm -Rf .coverage
6666
rm -f diff-cover.html
6767

68+
# Linting and code style related targets
69+
## sorting imports using isort: https://github.com/timothycrosley/isort
70+
sort_imports:
71+
isort ${MODULE}/*.py tests/*.py setup.py
72+
6873
## pep8 : check Python code style
6974
pep8: $(PYSOURCES)
7075
pep8 --exclude=_version.py --show-source --show-pep8 $^ || true

README.rst

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Common workflow language tool description reference implementation
44

55
CWL Conformance test: |Build Status|
66

7+
Travis: |Unix Build Status|
8+
9+
.. |Unix Build Status| image:: https://img.shields.io/travis/common-workflow-language/cwltool/master.svg?label=unix%20build
10+
:target: https://travis-ci.org/common-workflow-language/cwltool
11+
712
This is the reference implementation of the Common Workflow Language. It is
813
intended to be feature complete and provide comprehensive validation of CWL
914
files as well as provide other tools related to working with CWL.
@@ -26,7 +31,7 @@ well)::
2631

2732
pip install cwlref-runner
2833

29-
If installling alongside another CWL implementation then::
34+
If installing alongside another CWL implementation then::
3035

3136
pip install cwltool
3237

@@ -72,7 +77,7 @@ the default cwl-runner use::
7277
Use with boot2docker
7378
--------------------
7479
boot2docker is running docker inside a virtual machine and it only mounts ``Users``
75-
on it. The default behavoir of CWL is to create temporary directories under e.g.
80+
on it. The default behavior of CWL is to create temporary directories under e.g.
7681
``/Var`` which is not accessible to Docker containers.
7782

7883
To run CWL successfully with boot2docker you need to set the ``--tmpdir-prefix``

cwltool/builder.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
11
import copy
2+
from typing import Any, Callable, Text, Type, Union
3+
4+
from six import iteritems, string_types
25

36
import avro
47
import schema_salad.validate as validate
58
from schema_salad.sourceline import SourceLine
6-
from typing import Any, Callable, Text, Type, Union
7-
from six import string_types, iteritems
89

910
from . import expression
1011
from .errors import WorkflowException
11-
from .pathmapper import PathMapper, adjustFileObjs, normalizeFilesDirs, get_listing
12+
from .mutation import MutationManager
13+
from .pathmapper import (PathMapper, get_listing, normalizeFilesDirs,
14+
visit_class)
1215
from .stdfsaccess import StdFsAccess
1316
from .utils import aslist
1417

@@ -41,6 +44,7 @@ def __init__(self): # type: () -> None
4144
self.make_fs_access = None # type: Type[StdFsAccess]
4245
self.build_job_script = None # type: Callable[[List[str]], Text]
4346
self.debug = False # type: bool
47+
self.mutation_manager = None # type: MutationManager
4448

4549
# One of "no_listing", "shallow_listing", "deep_listing"
4650
# Will be default "no_listing" for CWL v1.1
@@ -144,7 +148,7 @@ def _capture_files(f):
144148
self.files.append(f)
145149
return f
146150

147-
adjustFileObjs(datum.get("secondaryFiles", []), _capture_files)
151+
visit_class(datum.get("secondaryFiles", []), ("File", "Directory"), _capture_files)
148152

149153
if schema["type"] == "Directory":
150154
ll = self.loadListing or (binding and binding.get("loadListing"))

cwltool/cwlrdf.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1+
from typing import IO, Any, Dict, Text
2+
13
from rdflib import Graph
4+
25
from schema_salad.jsonld_context import makerdf
36
from schema_salad.ref_resolver import ContextType
4-
from typing import Any, Dict, IO, Text
57
from six.moves import urllib
68

79
from .process import Process

cwltool/docker.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import subprocess
55
import sys
66
import tempfile
7+
from typing import Text
78

89
import requests
9-
from typing import Text
1010

1111
from .errors import WorkflowException
1212

@@ -27,6 +27,17 @@ def get_image(dockerRequirement, pull_image, dry_run=False):
2727
sp = dockerRequirement["dockerImageId"].split(":")
2828
if len(sp) == 1:
2929
sp.append("latest")
30+
elif len(sp) == 2:
31+
# if sp[1] doesn't match valid tag names, it is a part of repository
32+
if not re.match(r'[\w][\w.-]{0,127}', sp[1]):
33+
sp[0] = sp[0] + ":" + sp[1]
34+
sp[1] = "latest"
35+
elif len(sp) == 3:
36+
if re.match(r'[\w][\w.-]{0,127}', sp[2]):
37+
sp[0] = sp[0] + ":" + sp[1]
38+
sp[1] = sp[2]
39+
del sp[2]
40+
3041
# check for repository:tag match or image id match
3142
if ((sp[0] == m.group(1) and sp[1] == m.group(2)) or dockerRequirement["dockerImageId"] == m.group(3)):
3243
found = True

cwltool/docker_uid.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from __future__ import print_function
2-
import subprocess
32

3+
import subprocess
44
from typing import Text
55

66

0 commit comments

Comments
 (0)