Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions planemo/cwl/toil.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
import json
import tempfile

try:
from toil.cwl import cwltoil
except ImportError:
cwltoil = None

from planemo.deps import ensure_dependency_resolvers_conf_configured
from planemo.io import (
error,
Expand All @@ -25,7 +20,7 @@

def run_toil(ctx, runnable: "Runnable", job_path: str, **kwds):
"""Translate planemo kwds to cwltool kwds and run cwltool main function."""
_ensure_toil_available()
cwltoil = _ensure_toil_available()

args = []
if not ctx.verbose:
Expand Down Expand Up @@ -75,5 +70,9 @@ def run_toil(ctx, runnable: "Runnable", job_path: str, **kwds):


def _ensure_toil_available():
if cwltoil is None:
try:
from toil.cwl import cwltoil

return cwltoil
except ImportError:
raise Exception(TOIL_REQUIRED_MESSAGE)