diff -Nru cwltool-1.0.20180225105849/cwltool/expression.py cwltool-1.0.20180302231433/cwltool/expression.py --- cwltool-1.0.20180225105849/cwltool/expression.py 2018-02-28 12:07:17.000000000 +0000 +++ cwltool-1.0.20180302231433/cwltool/expression.py 2018-03-05 14:23:09.000000000 +0000 @@ -120,55 +120,76 @@ 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: - raise sandboxjs.JavascriptException( - "Syntax error in parameter reference '%s' or used Javascript code without specifying InlineJavascriptRequirement.", - ex) + 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'. This could be due to using Javascript code without specifying InlineJavascriptRequirement." % \ + ex) def interpolate(scan, rootvars, diff -Nru cwltool-1.0.20180225105849/cwltool/sandboxjs.py cwltool-1.0.20180302231433/cwltool/sandboxjs.py --- cwltool-1.0.20180225105849/cwltool/sandboxjs.py 2018-02-28 12:07:17.000000000 +0000 +++ cwltool-1.0.20180302231433/cwltool/sandboxjs.py 2018-03-05 14:23:09.000000000 +0000 @@ -292,7 +292,8 @@ 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: diff -Nru cwltool-1.0.20180225105849/cwltool.egg-info/PKG-INFO cwltool-1.0.20180302231433/cwltool.egg-info/PKG-INFO --- cwltool-1.0.20180225105849/cwltool.egg-info/PKG-INFO 2018-02-28 12:07:34.000000000 +0000 +++ cwltool-1.0.20180302231433/cwltool.egg-info/PKG-INFO 2018-03-05 14:23:26.000000000 +0000 @@ -1,6 +1,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: 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 diff -Nru cwltool-1.0.20180225105849/debian/changelog cwltool-1.0.20180302231433/debian/changelog --- cwltool-1.0.20180225105849/debian/changelog 2018-02-28 12:48:16.000000000 +0000 +++ cwltool-1.0.20180302231433/debian/changelog 2018-03-05 14:44:41.000000000 +0000 @@ -1,3 +1,9 @@ +cwltool (1.0.20180302231433-1) unstable; urgency=medium + + * New upstream release (Closes: #891752) + + -- Michael R. Crusoe Mon, 05 Mar 2018 06:44:41 -0800 + cwltool (1.0.20180225105849-1) unstable; urgency=medium * New upstream release diff -Nru cwltool-1.0.20180225105849/debian/copyright cwltool-1.0.20180302231433/debian/copyright --- cwltool-1.0.20180225105849/debian/copyright 2018-02-11 15:52:56.000000000 +0000 +++ cwltool-1.0.20180302231433/debian/copyright 2018-03-05 14:44:41.000000000 +0000 @@ -3,11 +3,11 @@ Source: https://pypi.python.org/pypi/cwltool Files: * -Copyright: No copyright declared +Copyright: 2014-2018 CWL, a project of Software Freedom Conservancy License: Apache-2.0 Files: debian/* -Copyright: © 2016 Michael R. Crusoe +Copyright: © 2016 Michael R. Crusoe License: Apache-2.0 License: Apache-2.0 diff -Nru cwltool-1.0.20180225105849/debian/rules cwltool-1.0.20180302231433/debian/rules --- cwltool-1.0.20180225105849/debian/rules 2018-02-28 11:28:06.000000000 +0000 +++ cwltool-1.0.20180302231433/debian/rules 2018-03-05 14:44:41.000000000 +0000 @@ -3,8 +3,6 @@ DH_VERBOSE := 1 export PYBUILD_NAME=cwltool -export PYBUILD_BEFORE_TEST={interpreter} {dir}/setup.py develop -export PYBUILD_TEST_ARGS=-k 'not test_http_path_mapping and not test_pack' --ignore cwltool/schemas/ --pyarg cwltool export HOME=$(shell echo $$PWD"/fakehome") %: @@ -17,3 +15,12 @@ override_dh_installman: debian/cwltool.1 dh_installman + +override_dh_auto_test: + dh_auto_install + PYBUILD_SYSTEM=custom \ + PYBUILD_TEST_ARGS="cd {dir}; export PATH={destdir}/usr/bin:$$PATH ; \ + cd {build_dir}; export PYTHONPATH=$$(pwd); {interpreter} -m pytest \ + -k 'not test_http_path_mapping and not test_pack' \ + --ignore cwltool/schemas/ --pyarg cwltool" dh_auto_test + diff -Nru cwltool-1.0.20180225105849/Makefile cwltool-1.0.20180302231433/Makefile --- cwltool-1.0.20180225105849/Makefile 2018-02-28 12:07:17.000000000 +0000 +++ cwltool-1.0.20180302231433/Makefile 2018-03-05 14:23:09.000000000 +0000 @@ -29,7 +29,7 @@ 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 @@ # Example `make print-VERSION` # From https://www.cmcrossroads.com/article/printing-value-makefile-variable print-% : ; @echo $* = $($*) - diff -Nru cwltool-1.0.20180225105849/PKG-INFO cwltool-1.0.20180302231433/PKG-INFO --- cwltool-1.0.20180225105849/PKG-INFO 2018-02-28 12:07:34.000000000 +0000 +++ cwltool-1.0.20180302231433/PKG-INFO 2018-03-05 14:23:26.000000000 +0000 @@ -1,6 +1,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: 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 diff -Nru cwltool-1.0.20180225105849/setup.cfg cwltool-1.0.20180302231433/setup.cfg --- cwltool-1.0.20180225105849/setup.cfg 2018-02-28 12:07:34.000000000 +0000 +++ cwltool-1.0.20180302231433/setup.cfg 2018-03-05 14:23:26.000000000 +0000 @@ -13,6 +13,6 @@ testpaths = tests [egg_info] -tag_build = .20180225105849 +tag_build = .20180302231433 tag_date = 0 diff -Nru cwltool-1.0.20180225105849/setup.py cwltool-1.0.20180302231433/setup.py --- cwltool-1.0.20180225105849/setup.py 2018-02-28 12:07:17.000000000 +0000 +++ cwltool-1.0.20180302231433/setup.py 2018-03-05 14:23:10.000000000 +0000 @@ -88,7 +88,6 @@ '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',