-
Notifications
You must be signed in to change notification settings - Fork 991
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Infrastructure for parsing CWL tools.
- Loading branch information
Showing
7 changed files
with
736 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
from .parser import tool_proxy | ||
from .runtime_actions import handle_outputs | ||
from .representation import to_cwl_job, to_galaxy_parameters | ||
|
||
from .cwltool_deps import ( | ||
needs_shell_quoting, | ||
shellescape, | ||
) | ||
|
||
|
||
__all__ = [ | ||
'tool_proxy', | ||
'handle_outputs', | ||
'to_cwl_job', | ||
'to_galaxy_parameters', | ||
'needs_shell_quoting', | ||
'shellescape', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
""" This module contains logic for dealing with cwltool as an optional | ||
dependency for Galaxy and/or applications which use Galaxy as a library. | ||
""" | ||
|
||
try: | ||
import requests | ||
except ImportError: | ||
requests = None | ||
|
||
try: | ||
from cwltool import ( | ||
main, | ||
workflow, | ||
job, | ||
) | ||
except ImportError: | ||
main = None | ||
workflow = None | ||
job = None | ||
|
||
try: | ||
import shellescape | ||
except ImportError: | ||
shellescape = None | ||
|
||
if job is not None: | ||
needs_shell_quoting = job.needs_shell_quoting | ||
else: | ||
needs_shell_quoting = None | ||
|
||
|
||
def ensure_cwltool_available(): | ||
if main is None or workflow is None or shellescape is None: | ||
message = "This feature requires cwltool and dependencies to be available, they are not." | ||
if requests is None: | ||
message += " Library 'requests' unavailable." | ||
if shellescape is None: | ||
message += " Library 'shellescape' unavailable." | ||
raise ImportError(message) | ||
|
||
|
||
__all__ = [ | ||
'main', | ||
'workflow', | ||
'ensure_cwltool_available', | ||
'shellescape', | ||
'needs_shell_quoting', | ||
] |
Oops, something went wrong.