Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

Commit

Permalink
Merge pull request #134 from nsoranzo/fixes
Browse files Browse the repository at this point in the history
Fixes
  • Loading branch information
jmchilton committed Sep 13, 2018
2 parents 9cb0e7b + 5456847 commit fec5208
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 30 deletions.
4 changes: 1 addition & 3 deletions galaxy/tools/cwl/cwltool_deps.py
Expand Up @@ -28,10 +28,9 @@
pathmapper = None

try:
from cwltool.context import LoadingContext, RuntimeContext
from cwltool.context import LoadingContext # Introduced in cwltool 1.0.20180615183820
except (ImportError, SyntaxError):
LoadingContext = None
RuntimeContext = None

try:
from cwltool import load_tool
Expand Down Expand Up @@ -83,7 +82,6 @@ def ensure_cwltool_available():
'ref_resolver',
'load_tool',
'LoadingContext',
'RuntimeContext',
'workflow',
'process',
'pathmapper',
Expand Down
3 changes: 2 additions & 1 deletion galaxy/tools/cwl/schema.py
Expand Up @@ -68,7 +68,9 @@ def tool(self, **kwds):
process_definition = self.process_definition(raw_process_reference)

args = {"strict": self._strict}
make_tool = kwds.get("make_tool", default_make_tool)
if LoadingContext is not None:
args["construct_tool_object"] = make_tool
loading_context = LoadingContext(args)
tool = load_tool.make_tool(
process_definition.document_loader,
Expand All @@ -78,7 +80,6 @@ def tool(self, **kwds):
loading_context,
)
else:
make_tool = kwds.get("make_tool", default_make_tool)
tool = load_tool.make_tool(
process_definition.document_loader,
process_definition.avsc_names,
Expand Down
30 changes: 4 additions & 26 deletions galaxy/tools/linters/stdio.py
Expand Up @@ -32,34 +32,12 @@ def lint_stdio(tool_source, lint_ctx):


def _lint_exit_code(child, lint_ctx):
for key, value in child.attrib.items():
if key == "range":
# TODO: validate
pass
elif key == "level":
_lint_level(value, lint_ctx)
elif key == "description":
pass
else:
for key in child.attrib.keys():
if key not in ["description", "level", "range"]:
lint_ctx.warn("Unknown attribute [%s] encountered on exit_code tag." % key)


def _lint_regex(child, lint_ctx):
for key, value in child.attrib.items():
if key == "source":
if value not in ["stderr", "stdout", "both"]:
lint_ctx.error("Unknown error code level encountered [%s]" % value)
elif key == "level":
_lint_level(value, lint_ctx)
elif key == "match":
# TODO: validate
pass
elif key == "description":
pass
else:
for key in child.attrib.keys():
if key not in ["description", "level", "match", "source"]:
lint_ctx.warn("Unknown attribute [%s] encountered on regex tag." % key)


def _lint_level(level_value, lint_ctx):
if level_value not in ["warning", "fatal", "log"]:
lint_ctx.error("Unknown error code level encountered [%s]" % level_value)

0 comments on commit fec5208

Please sign in to comment.