Skip to content
Commits on Source (3)
......@@ -29,7 +29,7 @@ PYSOURCES=$(wildcard ${MODULE}/**.py tests/*.py) setup.py
DEVPKGS=pep8 diff_cover autopep8 pylint coverage pydocstyle flake8 pytest isort mock
DEBDEVPKGS=pep8 python-autopep8 pylint python-coverage pydocstyle sloccount \
python-flake8 python-mock shellcheck
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --date=`git log --first-parent \
VERSION=1.0.$(shell date +%Y%m%d%H%M%S --utc --date=`git log --first-parent \
--max-count=1 --format=format:%cI`)
mkfile_dir := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
......@@ -190,4 +190,3 @@ FORCE:
# Example `make print-VERSION`
# From https://www.cmcrossroads.com/article/printing-value-makefile-variable
print-% : ; @echo $* = $($*)
Metadata-Version: 1.1
Name: cwltool
Version: 1.0.20180225105849
Version: 1.0.20180302231433
Summary: Common workflow language reference implementation
Home-page: https://github.com/common-workflow-language/cwltool
Author: Common workflow language working group
......@@ -616,7 +616,6 @@ Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
......
Metadata-Version: 1.1
Name: cwltool
Version: 1.0.20180225105849
Version: 1.0.20180302231433
Summary: Common workflow language reference implementation
Home-page: https://github.com/common-workflow-language/cwltool
Author: Common workflow language working group
......@@ -616,7 +616,6 @@ Classifier: Operating System :: Microsoft :: Windows :: Windows 8.1
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
......
......@@ -120,54 +120,75 @@ def scanner(scan): # type: (Text) -> List[int]
return None
def next_seg(remain, obj): # type: (Text, Any) -> Any
if remain:
m = segment_re.match(remain)
def next_seg(parsed_string, remaining_string, current_value): # type: (Text, Text, Any) -> Any
if remaining_string:
m = segment_re.match(remaining_string)
next_segment_str = m.group(0)
key = None # type: Union[Text, int]
if m.group(0)[0] == '.':
key = m.group(0)[1:]
elif m.group(0)[1] in ("'", '"'):
key = m.group(0)[2:-2].replace("\\'", "'").replace('\\"', '"')
if next_segment_str[0] == '.':
key = next_segment_str[1:]
elif next_segment_str[1] in ("'", '"'):
key = next_segment_str[2:-2].replace("\\'", "'").replace('\\"', '"')
if key:
if isinstance(obj, list) and key == "length" and not remain[m.end(0):]:
return len(obj)
if not isinstance(obj, dict):
raise WorkflowException(" is a %s, cannot index on string '%s'" % (type(obj).__name__, key))
if key not in obj:
raise WorkflowException(" does not contain key '%s'" % key)
if isinstance(current_value, list) and key == "length" and not remaining_string[m.end(0):]:
return len(current_value)
if not isinstance(current_value, dict):
raise WorkflowException("%s is a %s, cannot index on string '%s'" % (parsed_string, type(current_value).__name__, key))
if key not in current_value:
raise WorkflowException("%s does not contain key '%s'" % (parsed_string, key))
else:
try:
key = int(m.group(0)[1:-1])
key = int(next_segment_str[1:-1])
except ValueError as v:
raise WorkflowException(u(str(v)))
if not isinstance(obj, list):
raise WorkflowException(" is a %s, cannot index on int '%s'" % (type(obj).__name__, key))
if key >= len(obj):
raise WorkflowException(" list index %i out of range" % key)
if not isinstance(current_value, list):
raise WorkflowException("%s is a %s, cannot index on int '%s'" % (parsed_string, type(current_value).__name__, key))
if key >= len(current_value):
raise WorkflowException("%s list index %i out of range" % (parsed_string, key))
try:
return next_seg(remain[m.end(0):], obj[key])
except WorkflowException as w:
raise WorkflowException("%s%s" % (m.group(0), w))
return next_seg(parsed_string + remaining_string, remaining_string[m.end(0):], current_value[key])
except KeyError:
raise WorkflowException("%s doesn't have property %s" % (parsed_string, key))
else:
return obj
return current_value
def evaluator(ex, jslib, obj, fullJS=False, timeout=None, force_docker_pull=False, debug=False, js_console=False):
# type: (Text, Text, Dict[Text, Any], bool, int, bool, bool, bool) -> JSON
m = param_re.match(ex)
expression_parse_exception = None
expression_parse_succeeded = False
if m:
if m.end(1)+1 == len(ex) and m.group(1) == "null":
first_symbol = m.group(1)
first_symbol_end = m.end(1)
if first_symbol_end + 1 == len(ex) and first_symbol == "null":
return None
try:
return next_seg(m.group(0)[m.end(1) - m.start(0):-1], obj[m.group(1)])
except Exception as w:
raise WorkflowException("%s%s" % (m.group(1), w))
elif fullJS:
if obj.get(first_symbol) is None:
raise WorkflowException("%s is not defined" % first_symbol)
return next_seg(first_symbol, ex[first_symbol_end:-1], obj[first_symbol])
except WorkflowException as w:
expression_parse_exception = w
else:
expression_parse_succeeded = True
if fullJS and not expression_parse_succeeded:
return sandboxjs.execjs(ex, jslib, timeout=timeout, force_docker_pull=force_docker_pull, debug=debug, js_console=js_console)
else:
if expression_parse_exception is not None:
raise sandboxjs.JavascriptException(
"Syntax error in parameter reference '%s': %s. This could be due to using Javascript code without specifying InlineJavascriptRequirement." % \
(ex[1:-1], expression_parse_exception))
else:
raise sandboxjs.JavascriptException(
"Syntax error in parameter reference '%s' or used Javascript code without specifying InlineJavascriptRequirement.",
"Syntax error in parameter reference '%s'. This could be due to using Javascript code without specifying InlineJavascriptRequirement." % \
ex)
......
......@@ -292,7 +292,8 @@ def execjs(js, jslib, timeout=None, force_docker_pull=False, debug=False, js_con
info = u"returncode was: %s\nscript was:\n%s\nstdout was: %s\nstderr was: %s\n" %\
(nodejs.returncode, fn_linenum(), stdfmt(stdoutdata.decode('utf-8')), stdfmt(stderrdata.decode('utf-8')))
else:
info = stdfmt(stderrdata.decode('utf-8'))
info = u"Javascript expression was: %s\nstdout was: %s\nstderr was: %s" %\
(js, stdfmt(stdoutdata.decode('utf-8')), stdfmt(stderrdata.decode('utf-8')))
if nodejs.poll() not in (None, 0):
if killed:
......
cwltool (1.0.20180302231433-1) unstable; urgency=medium
* New upstream release
-- Michael R. Crusoe <michael.crusoe@gmail.com> Mon, 05 Mar 2018 06:44:41 -0800
cwltool (1.0.20180225105849-2) unstable; urgency=medium
* Fix FTBFS. (Closes: #891752)
......
......@@ -13,6 +13,6 @@ addopts = --ignore cwltool/schemas
testpaths = tests
[egg_info]
tag_build = .20180225105849
tag_build = .20180302231433
tag_date = 0
......@@ -88,7 +88,6 @@ setup(name='cwltool',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
......