Skip to content

Commit 6e99ebf

Browse files
author
Anton Khodak
committed
Put back single_job_executor with deprecation notice & better help message
1 parent 2609a92 commit 6e99ebf

File tree

1 file changed

+18
-12
lines changed

1 file changed

+18
-12
lines changed

cwltool/main.py

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,23 +9,19 @@
99
import logging
1010
import os
1111
import sys
12-
import tempfile
13-
import threading
1412
from typing import (IO, Any, AnyStr, Callable, Dict, List, Sequence, Text, Tuple,
1513
Union, cast, Mapping, MutableMapping, Iterable)
1614

1715
import pkg_resources # part of setuptools
18-
import requests
1916
import six
20-
import string
17+
import warnings
2118

2219
import ruamel.yaml as yaml
2320
import schema_salad.validate as validate
24-
from schema_salad.ref_resolver import Fetcher, Loader, file_uri, uri_file_path
21+
from schema_salad.ref_resolver import Loader, file_uri, uri_file_path
2522
from schema_salad.sourceline import strip_dup_lineno
2623

2724
from . import draft2tool, workflow
28-
from .builder import Builder
2925
from .cwlrdf import printdot, printrdf
3026
from .errors import UnsupportedRequirement, WorkflowException
3127
from .executors import SingleJobExecutor, MultithreadedJobExecutor
@@ -34,10 +30,9 @@
3430
resolve_overrides, load_overrides)
3531
from .mutation import MutationManager
3632
from .pack import pack
37-
from .pathmapper import (adjustDirObjs, adjustFileObjs, get_listing,
38-
trim_listing, visit_class)
39-
from .process import (Process, cleanIntermediate, normalizeFilesDirs,
40-
relocateOutputs, scandeps, shortname, use_custom_schema,
33+
from .pathmapper import (adjustDirObjs, trim_listing, visit_class)
34+
from .process import (Process, normalizeFilesDirs,
35+
scandeps, shortname, use_custom_schema,
4136
use_standard_schema)
4237
from .resolver import ga4gh_tool_registries, tool_resolver
4338
from .software_requirements import (DependenciesConfiguration,
@@ -46,7 +41,6 @@
4641
from .stdfsaccess import StdFsAccess
4742
from .update import ALLUPDATES, UPDATES
4843
from .utils import onWindows, windows_default_container_id
49-
from ruamel.yaml.comments import Comment, CommentedSeq, CommentedMap
5044

5145

5246
_logger = logging.getLogger("cwltool")
@@ -66,7 +60,9 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
6660
help="Do not execute jobs in a Docker container, even when specified by the CommandLineTool",
6761
dest="use_container")
6862
parser.add_argument("--parallel", action="store_true", default=False,
69-
help="Run jobs in parallel")
63+
help="[experimental] Run jobs in parallel. "
64+
"Does not currently keep track of ResourceRequirements like the number of cores"
65+
"or memory and can overload this system")
7066
parser.add_argument("--preserve-environment", type=Text, action="append",
7167
help="Preserve specific environment variable when running CommandLineTools. May be provided multiple times.",
7268
metavar="ENVVAR",
@@ -255,6 +251,16 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
255251
return parser
256252

257253

254+
def single_job_executor(t, # type: Process
255+
job_order_object, # type: Dict[Text, Any]
256+
**kwargs # type: Any
257+
):
258+
# type: (...) -> Tuple[Dict[Text, Any], Text]
259+
warnings.warn("Use of single_job_executor function is deprecated. "
260+
"Use cwltool.executors.SingleJobExecutor class instead", DeprecationWarning)
261+
executor = SingleJobExecutor()
262+
return executor(t, job_order_object, **kwargs)
263+
258264

259265
class FSAction(argparse.Action):
260266
objclass = None # type: Text

0 commit comments

Comments
 (0)