Skip to content

Commit c1bebc2

Browse files
committed
upgrade to latest schema_salad; misc cleanups
1 parent b82ce7a commit c1bebc2

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

cwltool/provenance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -934,7 +934,7 @@ def finalize_prov_profile(self, name):
934934
self.document.serialize(provenance_file, format="rdf", rdf_format="json-ld")
935935
prov_ids.append(self.provenance_ns[filename + ".jsonld"])
936936

937-
_logger.debug("[provenance] added provenance: %s", prov_ids)
937+
_logger.debug(u"[provenance] added provenance: %s", prov_ids)
938938
return prov_ids
939939

940940

cwltool/validate_js.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@
66
from typing import (Any, Dict, List, MutableMapping, MutableSequence, Optional,
77
Tuple, Union)
88

9-
import avro.schema # always import after schema_salad, never before
109
from pkg_resources import resource_stream
1110
from ruamel.yaml.comments import CommentedMap # pylint: disable=unused-import
12-
from schema_salad.sourceline import SourceLine
13-
from schema_salad.validate import Schema # pylint: disable=unused-import
14-
from schema_salad.validate import ValidationException, validate_ex
1511
from six import string_types
1612
from typing_extensions import Text # pylint: disable=unused-import
17-
# move to a regular typing import when Python 3.3-3.6 is no longer supported
13+
from schema_salad import avro
14+
from schema_salad.sourceline import SourceLine
15+
from schema_salad.validate import Schema # pylint: disable=unused-import
16+
from schema_salad.validate import validate_ex
1817

1918
from .expression import scanner as scan_expression
2019
from .loghandler import _logger
@@ -60,8 +59,8 @@ def get_expressions(tool, # type: Union[CommentedMap, Any]
6059
if not isinstance(tool, MutableSequence):
6160
return []
6261

63-
return list(itertools.chain(*
64-
map(lambda x: get_expressions(x[1], schema.items, SourceLine(tool, x[0])), enumerate(tool)) # type: ignore # https://github.com/python/mypy/issues/4679
62+
return list(itertools.chain(
63+
*map(lambda x: get_expressions(x[1], schema.items, SourceLine(tool, x[0])), enumerate(tool)) # type: ignore # https://github.com/python/mypy/issues/4679
6564
))
6665

6766
elif isinstance(schema, avro.schema.RecordSchema):
@@ -166,7 +165,7 @@ def validate_js_expressions(tool, schema, jshint_options=None):
166165

167166
default_globals = [u"self", u"inputs", u"runtime", u"console"]
168167

169-
for i, prop in enumerate(reversed(requirements)):
168+
for prop in reversed(requirements):
170169
if prop["class"] == "InlineJavascriptRequirement":
171170
expression_lib = prop.get("expressionLib", [])
172171
break

requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ requests>=2.4.3
22
ruamel.yaml>=0.12.4,<=0.15.77
33
rdflib>=4.2.2,<4.3
44
shellescape>=3.4.1,<3.5
5-
schema-salad>=2.7.20180905124720,<3
5+
schema-salad>=2.7.20181128093206,<3
66
typing>=3.5.3; python_version<"3.6"
77
pathlib2==2.3.2; python_version<"3"
88
prov==1.5.1

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
'ruamel.yaml >= 0.12.4, <= 0.15.77',
5454
'rdflib >= 4.2.2, < 4.3.0',
5555
'shellescape >= 3.4.1, < 3.5',
56-
'schema-salad >= 2.7.20180905124720, < 3',
56+
'schema-salad >= 2.7.20181128093206, < 3',
5757
'mypy-extensions',
5858
'six >= 1.9.0', # >= 1.9.0 required by prov
5959
'psutil',

tests/test_provenance.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ def folder():
5151

5252
def cwltool(folder, *args):
5353
load_tool.loaders = {}
54-
new_args = ['--no-container', '--provenance', folder]
54+
new_args = ['--provenance', folder]
5555
new_args.extend(args)
5656
# Run within a temporary directory to not pollute git checkout
5757
with temp_dir("cwltool-run") as tmp_dir:

0 commit comments

Comments
 (0)