Skip to content

Commit feec475

Browse files
authored
Merge branch 'master' into py3
2 parents 7458114 + c823085 commit feec475

20 files changed

+204
-450
lines changed

MANIFEST.in

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,19 @@
1-
include gittaggers.py ez_setup.py Makefile cwltool.py
1+
include gittaggers.py Makefile cwltool.py
2+
include tests/*
3+
include tests/wf/*
4+
include cwltool/schemas/v1.0/*.yml
5+
include cwltool/schemas/draft-2/*.yml
6+
include cwltool/schemas/draft-3/*.yml
7+
include cwltool/schemas/draft-3/*.md
8+
include cwltool/schemas/draft-3/salad/schema_salad/metaschema/*.yml
9+
include cwltool/schemas/draft-3/salad/schema_salad/metaschema/*.md
10+
include cwltool/schemas/v1.0/*.yml
11+
include cwltool/schemas/v1.0/*.md
12+
include cwltool/schemas/v1.0/salad/schema_salad/metaschema/*.yml
13+
include cwltool/schemas/v1.0/salad/schema_salad/metaschema/*.md
14+
include cwltool/schemas/v1.1.0-dev1/*.yml
15+
include cwltool/schemas/v1.1.0-dev1/*.md
16+
include cwltool/schemas/v1.1.0-dev1/salad/schema_salad/metaschema/*.yml
17+
include cwltool/schemas/v1.1.0-dev1/salad/schema_salad/metaschema/*.md
18+
include cwltool/cwlNodeEngine.js
19+
global-exclude *.pyc

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -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 pep257 flake8
29+
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pep257 flake8 pytest
3030
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pep257 sloccount python-flake8
3131
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --date=`git log --first-parent \
3232
--max-count=1 --format=format:%cI`)
@@ -50,7 +50,7 @@ install-deb-dep:
5050

5151
## install : install the ${MODULE} module and schema-salad-tool
5252
install: FORCE
53-
./setup.py build install
53+
pip install .
5454

5555
## dist : create a module package for distribution
5656
dist: dist/${MODULE}-$(VERSION).tar.gz

cwltool/draft2tool.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from .utils import aslist
2727

2828
ACCEPTLIST_EN_STRICT_RE = re.compile(r"^[a-zA-Z0-9._+-]+$")
29-
ACCEPTLIST_EN_RELAXED_RE = re.compile(r"^[ a-zA-Z0-9._+-]+$") # with spaces
29+
ACCEPTLIST_EN_RELAXED_RE = re.compile(r"^[ #a-zA-Z0-9._+-]+$") # with spaces and hashes
3030
ACCEPTLIST_RE = ACCEPTLIST_EN_STRICT_RE
3131

3232
from .flatten import flatten
@@ -355,9 +355,10 @@ def rm_pending_output_callback(output_callbacks, jobcachepending,
355355
"writable": t.get("writable")
356356
}
357357
else:
358-
if t["entryname"]:
358+
if t["entryname"] or t["writable"]:
359359
t = copy.deepcopy(t)
360-
t["entry"]["basename"] = t["entryname"]
360+
if t["entryname"]:
361+
t["entry"]["basename"] = t["entryname"]
361362
t["entry"]["writable"] = t.get("writable")
362363
ls[i] = t["entry"]
363364
j.generatefiles[u"listing"] = ls
@@ -462,6 +463,9 @@ def collect_output(self, schema, builder, outdir, fs_access, compute_checksum=Tr
462463
for g in fs_access.glob(fs_access.join(outdir, gb))])
463464
except (OSError, IOError) as e:
464465
_logger.warn(Text(e))
466+
except:
467+
_logger.error("Unexpected error from fs_access", exc_info=True)
468+
raise
465469

466470
for files in r:
467471
if files["class"] == "Directory" and "listing" not in files:

cwltool/pathmapper.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -148,21 +148,21 @@ def __init__(self, referenced_files, basedir, stagedir, separateDirs=True):
148148
self.separateDirs = separateDirs
149149
self.setup(dedup(referenced_files), basedir)
150150

151-
def visitlisting(self, listing, stagedir, basedir):
152-
# type: (List[Dict[Text, Any]], Text, Text) -> None
151+
def visitlisting(self, listing, stagedir, basedir, copy=False):
152+
# type: (List[Dict[Text, Any]], Text, Text, bool) -> None
153153
for ld in listing:
154154
tgt = os.path.join(stagedir, ld["basename"])
155155
if ld["class"] == "Directory":
156-
self.visit(ld, stagedir, basedir, copy=ld.get("writable", False))
156+
self.visit(ld, stagedir, basedir, copy=ld.get("writable", copy))
157157
else:
158-
self.visit(ld, stagedir, basedir, copy=ld.get("writable", False))
158+
self.visit(ld, stagedir, basedir, copy=ld.get("writable", copy))
159159

160160
def visit(self, obj, stagedir, basedir, copy=False):
161161
# type: (Dict[Text, Any], Text, Text, bool) -> None
162162
tgt = os.path.join(stagedir, obj["basename"])
163163
if obj["class"] == "Directory":
164164
self._pathmap[obj["location"]] = MapperEnt(obj["location"], tgt, "Directory")
165-
self.visitlisting(obj.get("listing", []), tgt, basedir)
165+
self.visitlisting(obj.get("listing", []), tgt, basedir, copy=copy)
166166
elif obj["class"] == "File":
167167
path = obj["location"]
168168
if path in self._pathmap:
@@ -185,7 +185,7 @@ def visit(self, obj, stagedir, basedir, copy=False):
185185
st = os.lstat(deref)
186186

187187
self._pathmap[path] = MapperEnt(deref, tgt, "File")
188-
self.visitlisting(obj.get("secondaryFiles", []), stagedir, basedir)
188+
self.visitlisting(obj.get("secondaryFiles", []), stagedir, basedir, copy=copy)
189189

190190
def setup(self, referenced_files, basedir):
191191
# type: (List[Any], Text) -> None

cwltool/resolver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@ def tool_resolver(document_loader, uri):
2929
ret = r(document_loader, uri)
3030
if ret is not None:
3131
return ret
32-
return file_uri(os.path.abspath(uri))
32+
return file_uri(os.path.abspath(uri), split_frag=True)

cwltool/stdfsaccess.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import glob
22
import os
3+
import urllib
34

45
from schema_salad.ref_resolver import file_uri
56
from typing import BinaryIO, Text
@@ -30,7 +31,7 @@ def isdir(self, fn): # type: (Text) -> bool
3031
return os.path.isdir(self._abs(fn))
3132

3233
def listdir(self, fn): # type: (Text) -> List[Text]
33-
return [abspath(l, fn) for l in os.listdir(self._abs(fn))]
34+
return [abspath(urllib.quote(str(l)), fn) for l in os.listdir(self._abs(fn))]
3435

3536
def join(self, path, *paths): # type: (Text, *Text) -> Text
3637
return os.path.join(path, *paths)

cwltool/workflow.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
_logger = logging.getLogger("cwltool")
2121

22-
WorkflowStateItem = namedtuple('WorkflowStateItem', ['parameter', 'value'])
22+
WorkflowStateItem = namedtuple('WorkflowStateItem', ['parameter', 'value', 'success'])
2323

2424

2525
def defaultMakeTool(toolpath_object, # type: Dict[Text, Any]
@@ -161,7 +161,7 @@ def object_from_state(state, parms, frag_only, supportsMultipleInput, sourceFiel
161161
"declared.")
162162
connections = aslist(inp[sourceField])
163163
for src in connections:
164-
if src in state and state[src] is not None:
164+
if src in state and state[src] is not None and (state[src].success == "success" or incomplete):
165165
if not match_types(
166166
inp["type"], state[src], iid, inputobj,
167167
inp.get("linkMerge", ("merge_nested"
@@ -232,7 +232,7 @@ def receive_output(self, step, outputparms, jobout, processStatus):
232232
for i in outputparms:
233233
if "id" in i:
234234
if i["id"] in jobout:
235-
self.state[i["id"]] = WorkflowStateItem(i, jobout[i["id"]])
235+
self.state[i["id"]] = WorkflowStateItem(i, jobout[i["id"]], processStatus)
236236
else:
237237
_logger.error(u"[%s] Output is missing expected field %s", step.name, i["id"])
238238
processStatus = "permanentFail"
@@ -359,9 +359,9 @@ def job(self, joborder, output_callback, **kwargs):
359359
with SourceLine(self.tool["inputs"], e, WorkflowException):
360360
iid = shortname(i["id"])
361361
if iid in joborder:
362-
self.state[i["id"]] = WorkflowStateItem(i, copy.deepcopy(joborder[iid]))
362+
self.state[i["id"]] = WorkflowStateItem(i, copy.deepcopy(joborder[iid]), "success")
363363
elif "default" in i:
364-
self.state[i["id"]] = WorkflowStateItem(i, copy.deepcopy(i["default"]))
364+
self.state[i["id"]] = WorkflowStateItem(i, copy.deepcopy(i["default"]), "success")
365365
else:
366366
raise WorkflowException(
367367
u"Input '%s' not in input object and does not have a default value." % (i["id"]))

cwltool_module.Dockerfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ RUN apt-get update -qq && apt-get install -qqy \
88
python-setuptools gcc python-dev
99

1010
# Install cwltool
11-
ADD setup.py README.rst ez_setup.py cwltool/ /root/cwltool/
11+
ADD setup.py README.rst cwltool/ /root/cwltool/
1212
ADD cwltool/ /root/cwltool/cwltool
1313
ADD cwltool/schemas/ /root/cwltool/cwltool/schemas
14-
RUN cd /root/cwltool && ./ez_setup.py && easy_install .
14+
ADD tests/ /root/cwltool/tests
15+
RUN cd /root/cwltool && python setup.py install

0 commit comments

Comments
 (0)