from planemo.exit_codes import EXIT_CODE_UNKNOWN_FILE_TYPE, ExitCodeException from planemo.galaxy.workflows import describe_outputs from planemo.io import error from planemo.test import check_output TEST_SUFFIXES = ["-tests", "_tests", "-test", "_test"] TEST_EXTENSIONS = [".yml", ".yaml", ".json"] TEST_FILE_NOT_LIST_MESSAGE = ("Invalid test definition file [%s] - file must " "contain a list of tests") TEST_FIELD_MISSING_MESSAGE = ("Invalid test definition [test #%d in %s] -" "defintion must field [%s].") RunnableType = aenum.Enum( "RunnableType", 'galaxy_tool galaxy_datamanager galaxy_workflow cwl_tool cwl_workflow directory' ) @property def _runnable_type_has_tools(runnable_type): return runnable_type.name in [ "galaxy_tool", "galaxy_datamanager", "cwl_tool", "directory" ] @property def _runnable_type_is_single_artifact(runnable_type): return runnable_type.name not in ["directory"]
"""Module defines abstractions for configuring Planemo.""" import os import aenum import click import yaml PLANEMO_CONFIG_ENV_PROP = "PLANEMO_GLOBAL_CONFIG_PATH" DEFAULT_CONFIG = {} VALUE_UNSET = object() OptionSource = aenum.Enum("OptionSource", 'cli profile global_config default') def _default_callback( default, use_global_config=False, resolve_path=False, ): def callback(ctx, param, value): planemo_ctx = ctx.obj param_name = param.name if value is not None: result = value option_source = OptionSource.cli else: result, option_source = _find_default( planemo_ctx, param,