cwltool.main

Entry point for cwltool.

Module Contents

Classes

ProvLogFormatter

Enforce ISO8601 with both T and Z.

Functions

append_word_to_default_user_agent(word)

Append the specified word to the requests http user agent string if it's not already there.

generate_example_input(inptype, default)

Convert a single input schema into an example.

realize_input_schema(input_types, schema_defs)

Replace references to named typed with the actual types.

generate_input_template(tool)

Generate an example input object for the given CWL process.

load_job_order(args, stdin, fetcher_constructor, ...)

init_job_order(job_order_object, args, process, ...[, ...])

make_relative(base, obj)

Relativize the location URI of a File or Directory object.

printdeps(obj, document_loader, stdout, relative_deps, uri)

Print a JSON representation of the dependencies of the CWL document.

prov_deps(obj, document_loader, uri[, basedir])

find_deps(obj, document_loader, uri[, basedir, nestdirs])

Find the dependencies of the CWL document.

print_pack(loadingContext, uri)

Return a CWL serialization of the CWL document in JSON.

supported_cwl_versions(enable_dev)

setup_schema(args, custom_schema_callback)

setup_provenance(args, runtimeContext[, argsl])

setup_loadingContext(loadingContext, runtimeContext, args)

Prepare a LoadingContext from the given arguments.

make_template(tool, target)

Make a template CWL input object for the give Process.

inherit_reqshints(tool, parent)

Copy down requirements and hints from ancestors of a given process.

choose_target(args, tool, loading_context)

Walk the Workflow, extract the subset matches all the args.targets.

choose_step(args, tool, loading_context)

Walk the given Workflow and extract just args.single_step.

choose_process(args, tool, loadingContext)

Walk the given Workflow and extract just args.single_process.

check_working_directories(runtimeContext)

Make any needed working directories.

print_targets(tool, stdout, loading_context[, prefix])

Recursively find targets for --subgraph and friends.

main([argsl, args, job_order_object, stdin, stdout, ...])

find_default_container(builder[, default_container, ...])

Find a container.

windows_check()

See if we are running on MS Windows and warn about the lack of support.

run(*args, **kwargs)

Run cwltool.

Attributes

docker_exe

ProvOut

cwltool.main.docker_exe: str
cwltool.main.append_word_to_default_user_agent(word)

Append the specified word to the requests http user agent string if it’s not already there.

Parameters:

word (str) –

Return type:

None

cwltool.main.generate_example_input(inptype, default)

Convert a single input schema into an example.

Parameters:
  • inptype (Optional[cwltool.utils.CWLOutputType]) –

  • default (Optional[cwltool.utils.CWLOutputType]) –

Return type:

Tuple[Any, str]

cwltool.main.realize_input_schema(input_types, schema_defs)

Replace references to named typed with the actual types.

Parameters:
  • input_types (MutableSequence[Union[str, cwltool.utils.CWLObjectType]]) –

  • schema_defs (MutableMapping[str, cwltool.utils.CWLObjectType]) –

Return type:

MutableSequence[Union[str, cwltool.utils.CWLObjectType]]

cwltool.main.generate_input_template(tool)

Generate an example input object for the given CWL process.

Parameters:

tool (cwltool.process.Process) –

Return type:

cwltool.utils.CWLObjectType

cwltool.main.load_job_order(args, stdin, fetcher_constructor, overrides_list, tool_file_uri)
Parameters:
  • args (argparse.Namespace) –

  • stdin (IO[Any]) –

  • fetcher_constructor (Optional[schema_salad.utils.FetcherCallableType]) –

  • overrides_list (List[cwltool.utils.CWLObjectType]) –

  • tool_file_uri (str) –

Return type:

Tuple[Optional[cwltool.utils.CWLObjectType], str, schema_salad.ref_resolver.Loader]

cwltool.main.init_job_order(job_order_object, args, process, loader, stdout, print_input_deps=False, relative_deps='primary', make_fs_access=StdFsAccess, input_basedir='', secret_store=None, input_required=True, runtime_context=None)
Parameters:
Return type:

cwltool.utils.CWLObjectType

cwltool.main.make_relative(base, obj)

Relativize the location URI of a File or Directory object.

Parameters:
  • base (str) –

  • obj (cwltool.utils.CWLObjectType) –

Return type:

None

cwltool.main.printdeps(obj, document_loader, stdout, relative_deps, uri, basedir=None, nestdirs=True)

Print a JSON representation of the dependencies of the CWL document.

Parameters:
Return type:

None

cwltool.main.prov_deps(obj, document_loader, uri, basedir=None)
Parameters:
Return type:

cwltool.utils.CWLObjectType

cwltool.main.find_deps(obj, document_loader, uri, basedir=None, nestdirs=True)

Find the dependencies of the CWL document.

Parameters:
Return type:

cwltool.utils.CWLObjectType

cwltool.main.print_pack(loadingContext, uri)

Return a CWL serialization of the CWL document in JSON.

Parameters:
Return type:

str

cwltool.main.supported_cwl_versions(enable_dev)
Parameters:

enable_dev (bool) –

Return type:

List[str]

cwltool.main.setup_schema(args, custom_schema_callback)
Parameters:
Return type:

None

class cwltool.main.ProvLogFormatter

Bases: logging.Formatter

Inheritance diagram of cwltool.main.ProvLogFormatter

Enforce ISO8601 with both T and Z.

formatTime(record, datefmt=None)

Override the default formatTime to include the timezone.

Parameters:
Return type:

str

cwltool.main.ProvOut
cwltool.main.setup_provenance(args, runtimeContext, argsl=None)
Parameters:
Return type:

Tuple[ProvOut, logging.StreamHandler[ProvOut]]

cwltool.main.setup_loadingContext(loadingContext, runtimeContext, args)

Prepare a LoadingContext from the given arguments.

Parameters:
Return type:

cwltool.context.LoadingContext

cwltool.main.make_template(tool, target)

Make a template CWL input object for the give Process.

Parameters:
Return type:

None

cwltool.main.inherit_reqshints(tool, parent)

Copy down requirements and hints from ancestors of a given process.

Parameters:
Return type:

None

cwltool.main.choose_target(args, tool, loading_context)

Walk the Workflow, extract the subset matches all the args.targets.

Parameters:
Return type:

Optional[cwltool.process.Process]

cwltool.main.choose_step(args, tool, loading_context)

Walk the given Workflow and extract just args.single_step.

Parameters:
Return type:

Optional[cwltool.process.Process]

cwltool.main.choose_process(args, tool, loadingContext)

Walk the given Workflow and extract just args.single_process.

Parameters:
Return type:

Optional[cwltool.process.Process]

cwltool.main.check_working_directories(runtimeContext)

Make any needed working directories.

Parameters:

runtimeContext (cwltool.context.RuntimeContext) –

Return type:

Optional[int]

cwltool.main.print_targets(tool, stdout, loading_context, prefix='')

Recursively find targets for –subgraph and friends.

Parameters:
Return type:

None

cwltool.main.main(argsl=None, args=None, job_order_object=None, stdin=sys.stdin, stdout=None, stderr=sys.stderr, versionfunc=versionstring, logger_handler=None, custom_schema_callback=None, executor=None, loadingContext=None, runtimeContext=None, input_required=True)
Parameters:
Return type:

int

cwltool.main.find_default_container(builder, default_container=None, use_biocontainers=None, container_image_cache_path=None)

Find a container.

Parameters:
  • builder (cwltool.utils.HasReqsHints) –

  • default_container (Optional[str]) –

  • use_biocontainers (Optional[bool]) –

  • container_image_cache_path (Optional[str]) –

Return type:

Optional[str]

cwltool.main.windows_check()

See if we are running on MS Windows and warn about the lack of support.

Return type:

None

cwltool.main.run(*args, **kwargs)

Run cwltool.

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

int