planemo package

Subpackages

Submodules

planemo.autoupdate module

Autoupdate older conda dependencies in the requirements section.

planemo.autoupdate.autoupdate_tool(ctx: PlanemoCliContext, tool_path: str, modified_files: Set[Any], **kwds) Set[str] | None[source]

Autoupdate an XML file

planemo.autoupdate.autoupdate_wf(ctx: PlanemoCliContext, config: LocalGalaxyConfig, wf: Runnable) Dict[str, Any][source]
planemo.autoupdate.check_conda(package_name: str, ctx: PlanemoCliContext, **kwds) str[source]

Get the most up-to-date conda version for a package.

planemo.autoupdate.create_requirement_dict(xml_files: Dict[str, ElementTree], skip_reqs: List[str]) Tuple[Dict[str, Dict[str, Dict[str, str | None]]], Tuple[str, str] | None][source]

Create dict with requirements and find main requirement

planemo.autoupdate.create_token_dict(ctx: PlanemoCliContext, xml_files: Dict[str, ElementTree], main_req: Tuple[str, str], **kwds) Tuple[Dict[str, Dict[str, Dict[str, str | None]]], DefaultDict[str, List[Dict[str, str]]], str | None, str | None][source]

Create dict with relevant tokens and check conda requirements for main

planemo.autoupdate.find_macros(xml_tree: ElementTree) List[Any][source]

Get macros from the XML tree

planemo.autoupdate.fix_workflow_ga(original_wf: Dict[str, Any], updated_wf: Dict[str, Any]) Dict[str, Any][source]
planemo.autoupdate.fix_workflow_gxformat2(original_wf: Dict[str, Any], updated_wf: Dict[str, Any]) Dict[str, Any][source]
planemo.autoupdate.get_newest_tool_id(tool_ids: List[str]) str[source]
planemo.autoupdate.get_requirements(xml_tree: ElementTree) Tuple[Dict[str, Dict[str, str | None]], str | None][source]

Get requirements from the XML tree

planemo.autoupdate.get_tokens(xml_tree: ElementTree) Dict[str, Dict[str, str | None]][source]

Get tokens from the XML tree

planemo.autoupdate.get_tools_to_update(ctx: PlanemoCliContext, workflow: Runnable, tools_to_skip: List[str]) Dict[str, Dict[str, str]][source]
planemo.autoupdate.outdated_tools(ctx: PlanemoCliContext, wf_dict: Dict[str, Any], ts: ToolShedInstance, tools_to_skip: List[str]) Dict[str, Dict[str, str]][source]

tools_to_skip should be a list of base tool ids.

planemo.autoupdate.perform_required_update(ctx: PlanemoCliContext, xml_files: Dict[str, ElementTree], tool_path: str, requirements: Dict[str, Dict[str, Dict[str, str | None]]], tokens: Dict[str, Dict[str, Dict[str, str | None]]], xml_to_update: DefaultDict[str, List[Dict[str, str]]], wrapper_version_token: str | int | None, **kwds) Set[str][source]

Carry out the update, if requirements are out-of-date

planemo.autoupdate.update_xml(tool_path: str, xml_tree: ElementTree, tags_to_update: List[Dict[str, str]], wrapper_version_token: str | int | None, is_macro: bool = False) None[source]

Write modified XML to tool_path

planemo.ci module

Utilities for dealing with continous integration systems.

planemo.ci.filter_paths(ctx, raw_paths, path_type='repo', **kwds)[source]

Filter paths.

path_type is repo or file.

planemo.ci.group_paths(paths)[source]
planemo.ci.metadata_file_in_path(diff_dir)[source]
planemo.ci.print_as_yaml(item, **kwds)[source]
planemo.ci.print_path_list(paths, **kwds)[source]

planemo.cli module

The module describes a CLI framework extending click.

class planemo.cli.PlanemoCliContext[source]

Bases: PlanemoContext

Describe context of Planemo CLI computation.

Extend PlanemoContext with operations for CLI concerns (exit code) and for interacting with the click library.

exit(exit_code: int)[source]

Exit planemo with the supplied exit code.

planemo.cli.command_function(f: Callable) Callable[source]

Extension point for processing kwds after click callbacks.

planemo.cli.list_cmds() List[str][source]

List planemo commands from commands folder.

planemo.cli.name_to_command(name: str) Command[source]

Convert a subcommand name to the cli function for that command.

Command <X> is defined by the method ‘planemo.commands.cmd_<x>:cli’, this method uses __import__ to load and return that method.

planemo.conda module

Planemo specific utilities for dealing with conda.

The extend galaxy-tool-util’s features with planemo specific idioms.

planemo.conda.build_conda_context(ctx: PlanemoCliContext, **kwds) CondaContext[source]

Build a galaxy-tool-util CondaContext tailored to planemo use.

Using planemo’s common command-line/global config options.

planemo.conda.collect_conda_target_lists(ctx: PlanemoCliContext, paths: Iterable[str], recursive: bool = False, found_tool_callback=None) List[FrozenSet[CondaTarget]][source]

Load CondaTarget lists from supplied artifact sources.

If a tool contains more than one requirement, the requirements will all appear together as one list element of the output list.

planemo.conda.collect_conda_target_lists_and_tool_paths(ctx: PlanemoCliContext, paths: Iterable[str], recursive: bool = False, found_tool_callback=None) Tuple[List[FrozenSet[CondaTarget]], List[List[str]]][source]

Load CondaTarget lists from supplied artifact sources.

If a tool contains more than one requirement, the requirements will all appear together as one list element of the output list.

planemo.conda.collect_conda_targets(ctx, paths, recursive=False, found_tool_callback=None)[source]

Load CondaTarget objects from supplied artifact sources.

If a tool contains more than one requirement, the requirements will each appear once in the output.

planemo.conda.tool_source_conda_targets(tool_source)[source]

Load CondaTarget object from supplied abstract tool source.

planemo.config module

Module defines abstractions for configuring Planemo.

planemo.config.global_config_path(config_path: str | None = None) str[source]
planemo.config.planemo_option(*args, **kwargs) Callable[source]

Extend click.option with planemo-config aware configuration.

This extends click.option to use a callback when assigning default values, add use_global_config keyword argument to allow reading defaults from ~/.planemo.yml, and tracks how parameters are specified using the Planemo Context object.

planemo.config.read_global_config(config_path: str | None) Dict[str, Any][source]

planemo.context module

Define the context around Planemo computation.

Abstractions for cross cutting concerns (logging, workspace management, etc.).

class planemo.context.PlanemoContext[source]

Bases: PlanemoContextInterface

Implementation of PlanemoContextInterface

cache_download(url, destination)[source]

Use workspace to cache download of url.

property galaxy_profiles_directory: str

Create a return a directory for storing Galaxy profiles.

get_option_source(param_name: str) OptionSource[source]

Return OptionSource value indicating how the option was set.

property global_config: Dict[str, Any]

Read Planemo’s global configuration.

As defined most simply by ~/.planemo.yml.

log(msg: str, *args) None[source]

Log a message.

planemo_directory: str | None
set_option_source(param_name: str, option_source: OptionSource, force: bool = False) None[source]

Specify how an option was set.

vlog(msg: str, *args, **kwds) None[source]

Log a message only if verbose is enabled.

property workspace: str

Create and return Planemo’s workspace.

By default this will be ~/.planemo.

class planemo.context.PlanemoContextInterface[source]

Bases: object

Interface Planemo operations use to access workspace context.

abstract cache_download(url, destination)[source]

Use workspace to cache download of url.

abstract property galaxy_profiles_directory

Create a return a directory for storing Galaxy profiles.

abstract get_option_source(param_name)[source]

Return OptionSource value indicating how the option was set.

abstract property global_config

Read Planemo’s global configuration.

abstract log(msg, *args)[source]

Log a message.

abstract set_option_source(param_name, option_source, force=False)[source]

Specify how an option was set.

abstract vlog(msg, *args, **kwds)[source]

Log a message only if verbose is enabled.

abstract property workspace

Create and return Planemo’s workspace.

planemo.context.configure_standard_planemo_logging(verbose: bool) None[source]

Configure Planemo’s default logging rules.

planemo.deps module

Abstractions for building dependency resolution configurations.

planemo.deps.ensure_dependency_resolvers_conf_configured(ctx, kwds, resolvers_conf=None)[source]

Use supplied CLI options (kwds) to find or build a dependency resolvers file.

Set new path in kwds if needed.

planemo.docker module

Docker utilities for planemo.

Built on Galaxy abstractions in galaxy.tools.deps.dockerfiles and galaxy.tools.deps.docker_util.

planemo.docker.docker_host_args(**kwds)[source]

planemo.exit_codes module

Numeric constants for planemo exit codes.

exception planemo.exit_codes.ExitCodeException(exit_code)[source]

Bases: Exception

Exception used by planemo framework to track exit codes for CLI.

planemo.git module

Utilities for interacting with git using planemo abstractions.

planemo.git.add(ctx: PlanemoCliContext, repo_path: str, file_path: str) None[source]
planemo.git.branch(ctx, repo_path, branch, from_branch=None)[source]
planemo.git.checkout(ctx, remote_repo, local_path, branch=None, remote='origin', from_branch='master')[source]

Checkout a new branch from a remote repository.

planemo.git.clone(*args, **kwds) None[source]

Clone a git repository.

See command_clone() for description of arguments.

planemo.git.command_clone(ctx: PlanemoCliContext, src: str, dest: str, mirror: bool = False, branch: str | None = None, depth: int | None = None) List[str][source]

Produce a command-line string to clone a repository.

Take in ctx to allow more configurability down the road.

planemo.git.commit(ctx: PlanemoCliContext, repo_path: str, message: str = '') None[source]
planemo.git.diff(ctx: PlanemoCliContext, directory: str, range: str) List[str][source]

Produce a list of diff-ed files for commit range.

planemo.git.git_env_for(path: str) Dict[str, str][source]

Setup env dictionary to target specified git repo with git commands.

planemo.git.init(ctx: PlanemoCliContext, repo_path: str) None[source]
planemo.git.is_rev_dirty(ctx: PlanemoCliContext, directory: str) bool[source]

Check if specified git repository has uncommitted changes.

planemo.git.ls_remote(ctx: PlanemoCliContext, remote_repo: str) Dict[str, str][source]

Return a dictionary with refs as key and commits as value.

planemo.git.push(ctx: PlanemoCliContext, repo_path: str, to: str | None = None, branch: str | None = None, force: bool = False) None[source]
planemo.git.rev(ctx: PlanemoCliContext, directory: str) str[source]

Raw revision for git directory specified.

Throws RuntimeError if not a git directory.

planemo.git.rev_if_git(ctx: PlanemoCliContext, directory: str) str | None[source]

Determine git revision (or None).

planemo.github_util module

Utilities for interacting with Github.

planemo.github_util.add_dir_contents_to_repo(ctx, from_dir, target_dir, target_repository_path, version, dry_run, branch='main', notes='')[source]
planemo.github_util.clone_fork_branch(ctx, target, path, remote_name='planemo-remote', **kwds)[source]

Clone, fork, and branch a repository ahead of building a pull request.

planemo.github_util.create_release(ctx, from_dir, target_dir, owner, repo, version, dry_run, branch, notes='', **kwds)[source]
planemo.github_util.ensure_gh(ctx, **kwds)[source]

Ensure gh is available for planemo

This method will ensure gh is installed at the correct version.

For more information on gh checkout https://cli.github.com/

planemo.github_util.fork(ctx, path, remote_name='planemo-remote', **kwds)[source]

Fork the target repository using gh.

planemo.github_util.get_gh_env(ctx, path=None, dry_run=False, **kwds)[source]

Return a environment dictionary to run gh with given user and repository target.

planemo.github_util.get_github_config(ctx, allow_anonymous=False)[source]

Return a planemo.github_util.GithubConfig for given configuration.

planemo.github_util.get_or_create_repository(ctx, owner, repo, dry_run=True, **kwds)[source]

Clones or creates a repository and returns path on disk

planemo.github_util.publish_as_gist_file(ctx, path, name='index')[source]

Publish a gist.

More information on gists at http://gist.github.com/.

planemo.glob module

planemo.glob.glob(*args, **kwds) List[str][source]

planemo.io module

Planemo I/O abstractions and utilities.

planemo.io.args_to_str(args)[source]

Collapse list of arguments in a commmand-line string.

planemo.io.can_write_to_path(path: str, **kwds)[source]

Implement -f/–force logic.

If supplied path exists, print an error message and return False unless –force caused the ‘force’ keyword argument to be True.

planemo.io.captured_io_for_xunit(kwds, captured_io)[source]

Capture Planemo I/O and timing for outputting to an xUnit report.

planemo.io.coalesce_return_codes(ret_codes, assert_at_least_one=False)[source]
planemo.io.communicate(cmds, **kwds)[source]

Execute shell command and wait for output.

With click-aware I/O handling, pretty display of the command being executed, and formatted exception if the exit code is not 0.

planemo.io.conditionally_captured_io(capture, tee=False)[source]

If capture is True, capture stdout and stderr for logging.

planemo.io.error(message, *args)[source]

Print stylized error message to the screen.

planemo.io.filter_paths(paths, cwd=None, **kwds)[source]
planemo.io.find_matching_directories(path, pattern, recursive)[source]

Find directories below supplied path with file matching pattern.

Returns an empty list if no matches are found, and if recursive is False only the top directory specified by path will be considered.

planemo.io.info(message, *args)[source]

Print stylized info message to the screen.

planemo.io.kill_pid_file(pid_file: str)[source]

Kill process group corresponding to specified pid file.

planemo.io.kill_posix(pid: int)[source]

Kill process group corresponding to specified pid.

planemo.io.open_file_or_standard_output(path, *args, **kwds)[source]

Open file but respect ‘-’ as referring to stdout.

planemo.io.ps1_for_path(path, base='PS1')[source]

Used by environment commands to build a PS1 shell variables for tool or directory of tools.

planemo.io.real_io()[source]

Ensure stdout and stderr have supported fileno() method.

nosetests replaces these streams with StringIO objects that may not work the same in every situtation - subprocess.Popen() calls in particular.

planemo.io.shell(cmds, **kwds)[source]

Print and execute shell command.

planemo.io.shell_join(*args)[source]

Join potentially empty commands together with ‘&&’.

planemo.io.stop_gravity(virtual_env, gravity_state_dir, env)[source]
planemo.io.tee_captured_output(output)[source]

tee captured standard output and standard error if needed.

For messages captured with Capturing, send them to their correct locations so as to not interfere with normal user experience.

planemo.io.temp_directory(prefix='planemo_tmp_', dir=None, **kwds)[source]
planemo.io.untar_to(url, tar_args=None, path=None, dest_dir=None)[source]
planemo.io.wait_on(function, desc, timeout=5, polling_backoff=0)[source]

Wait on given function’s readiness.

Grow the polling interval incrementally by the polling_backoff.

planemo.io.warn(message, *args)[source]

Print stylized warning message to the screen.

planemo.io.write_file(path, content, force=True)[source]

planemo.lint module

Utilities to help linting various targets.

planemo.lint.build_lint_args(ctx, **kwds)[source]

Handle common report, error, and skip linting arguments.

planemo.lint.handle_lint_complete(lint_ctx, lint_args, failed=False)[source]

Complete linting of a target and decide exit code.

planemo.lint.lint_dois(tool_xml, lint_ctx)[source]

Find referenced DOIs and check they have valid with https://doi.org.

planemo.lint.lint_urls(root, lint_ctx)[source]

Find referenced URLs and verify they are valid.

planemo.lint.lint_xsd(lint_ctx, schema_path, path)[source]

Lint XML at specified path with supplied schema.

planemo.mulled module

Planemo specific utilities for dealing with mulled containers.

The extend galaxy-tool-util’s features with planemo specific idioms.

planemo.mulled.build_involucro_context(ctx, **kwds)[source]

Build a galaxy-tool-util InvolucroContext tailored to planemo use.

Using planemo’s common command-line/global config options.

planemo.mulled.build_mull_target_kwds(ctx, **kwds)[source]

Adapt Planemo’s CLI and workspace configuration to galaxy-tool-util’s mulled_build options.

planemo.mulled.collect_mulled_target_lists(ctx, paths: Iterable[str], recursive: bool = False) List[List[CondaTarget]][source]
planemo.mulled.conda_to_mulled_targets(conda_targets: Iterable[CondaTarget]) List[CondaTarget][source]

planemo.network_util module

planemo.network_util.get_free_port() int[source]
planemo.network_util.wait_http_service(url, timeout=None)[source]
planemo.network_util.wait_net_service(server, port, timeout=None)[source]

Wait for network service to appear.

Parameters:

timeout (int) – in seconds, if None or 0 wait forever

Returns:

A bool - if timeout is None may return only True or throw an unhandled network exception.

planemo.options module

Click definitions for various shared options and arguments.

class planemo.options.ProjectOrRepositry(**kwds)[source]

Bases: Path

convert(value, param, ctx)[source]

Convert the value to the correct type. This is not called if the value is None (the missing value).

This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.

The param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Parameters:
  • value – The value to convert.

  • param – The parameter that is using this type to convert its value. May be None.

  • ctx – The current context that arrived at this value. May be None.

class planemo.options.UriLike(exists: bool = False, file_okay: bool = True, dir_okay: bool = True, writable: bool = False, readable: bool = True, resolve_path: bool = False, allow_dash: bool = False, path_type: Type[Any] | None = None, executable: bool = False)[source]

Bases: Path

convert(value, param, ctx)[source]

Convert the value to the correct type. This is not called if the value is None (the missing value).

This must accept string values from the command line, as well as values that are already the correct type. It may also convert other compatible types.

The param and ctx arguments may be None in certain situations, such as when converting prompt input.

If the value cannot be converted, call fail() with a descriptive message.

Parameters:
  • value – The value to convert.

  • param – The parameter that is using this type to convert its value. May be None.

  • ctx – The current context that arrived at this value. May be None.

planemo.options.alias_option(required=False)[source]
planemo.options.brew_dependency_resolution()[source]
planemo.options.brew_option()[source]
planemo.options.build_cwl_option()[source]
planemo.options.check_uploads_ok_option()[source]
planemo.options.ci_chunk_count_option()[source]
planemo.options.ci_chunk_option()[source]
planemo.options.ci_find_options()[source]
planemo.options.ci_group_tools_option()[source]
planemo.options.ci_output_option()[source]
planemo.options.conda_auto_init_option()[source]
planemo.options.conda_auto_install_option()[source]
planemo.options.conda_dependency_resolution()[source]
planemo.options.conda_ensure_channels_option()[source]
planemo.options.conda_exec_option()[source]
planemo.options.conda_global_option()[source]
planemo.options.conda_prefix_option()[source]
planemo.options.conda_target_options(include_local=True)[source]
planemo.options.conda_use_local_option()[source]
planemo.options.cwltool_no_container_option()[source]

Annotate click command as consume the –no_container option.

This option is for the CWL CLI runner interface.

planemo.options.daemon_option()[source]
planemo.options.database_connection_option()[source]
planemo.options.database_identifier_argument()[source]
planemo.options.database_source_options()[source]

Database connection options for commands that utilize a database.

planemo.options.database_type_option()[source]
planemo.options.dependencies_script_options()[source]
planemo.options.dependency_resolvers_option()[source]
planemo.options.docker_cmd_option()[source]
planemo.options.docker_config_options()[source]
planemo.options.docker_enable_option()[source]
planemo.options.docker_extra_volume_option()[source]
planemo.options.docker_galaxy_image_option()[source]
planemo.options.docker_host_option()[source]
planemo.options.docker_run_extra_arguments_option()[source]
planemo.options.docker_sudo_cmd_option()[source]
planemo.options.docker_sudo_option()[source]
planemo.options.dry_run()[source]
planemo.options.enable_cwl_option()[source]
planemo.options.engine_options()[source]
planemo.options.extra_tools_option()[source]
planemo.options.fail_level_option()[source]
planemo.options.file_path_option()[source]
planemo.options.filter_changed_in_commit_option()[source]
planemo.options.filter_exclude_from_option()[source]
planemo.options.filter_exclude_option()[source]
planemo.options.force_option(what='files')[source]

Annotate click command as consume the -f/–force option.

planemo.options.from_invocation()[source]
planemo.options.galaxy_admin_key_option()[source]
planemo.options.galaxy_branch_option()[source]
planemo.options.galaxy_config_options()[source]
planemo.options.galaxy_cwl_root_option()[source]
planemo.options.galaxy_docker_options()[source]
planemo.options.galaxy_email_option()[source]
planemo.options.galaxy_host_option()[source]
planemo.options.galaxy_port_option()[source]
planemo.options.galaxy_python_version()[source]
planemo.options.galaxy_root_option()[source]
planemo.options.galaxy_run_options()[source]
planemo.options.galaxy_serve_options()[source]
planemo.options.galaxy_source_option()[source]
planemo.options.galaxy_startup_timeout_option()[source]
planemo.options.galaxy_target_options()[source]
planemo.options.galaxy_url_option(required: bool = False)[source]
planemo.options.galaxy_user_key_option(required: bool = False)[source]
planemo.options.github_branch()[source]
planemo.options.github_namespace()[source]
planemo.options.history_name()[source]
planemo.options.ignore_dependency_problems_option()[source]

Annotate click command as consume the –ignore_dependency_problems option.

planemo.options.install_galaxy_option()[source]
planemo.options.install_repository_dependencies_option()[source]
planemo.options.install_resolver_dependencies_option()[source]
planemo.options.install_tool_dependencies_option()[source]
planemo.options.job_config_option()[source]
planemo.options.lint_biocontainers_option()[source]
planemo.options.lint_xsd_option()[source]
planemo.options.merge_test_json()[source]
planemo.options.mulled_action_option()[source]
planemo.options.mulled_conda_option()[source]
planemo.options.mulled_containers_option()[source]
planemo.options.mulled_namespace_option()[source]
planemo.options.mulled_options()[source]
planemo.options.no_cache_galaxy_option()[source]
planemo.options.no_cleanup_option()[source]
planemo.options.no_dependency_resolution()[source]
planemo.options.no_wait_option()[source]
planemo.options.non_strict_cwl_option()[source]

Annotate click command as consume the –non_strict_cwl option.

planemo.options.optional_project_arg(exists=True, default='.')[source]
planemo.options.optional_tools_arg(multiple=False, allow_uris=False, metavar='TOOL_PATH')[source]

Decorate click method as optionally taking in the path to a tool or directory of tools. If no such argument is given the current working directory will be treated as a directory of tools.

planemo.options.optional_tools_or_packages_arg(multiple=False)[source]

Decorate click method as optionally taking in the path to a tool or directory of tools or a Conda package. If no such argument is given the current working directory will be treated as a directory of tools.

planemo.options.paste_test_data_paths_option()[source]
planemo.options.pid_file_option()[source]
planemo.options.postgres_datatype_type_option()[source]
planemo.options.profile_database_options()[source]
planemo.options.profile_name_argument()[source]
planemo.options.profile_option(required=False)[source]
planemo.options.publish_dockstore_option()[source]
planemo.options.recipe_arg(multiple=True)[source]
planemo.options.recursive_option(help='Recursively perform command for subdirectories.')[source]
planemo.options.recursive_shed_option()[source]
planemo.options.report_level_option()[source]
planemo.options.report_xunit()[source]
planemo.options.required_invocation_id_arg()[source]
planemo.options.required_job_arg()[source]

Decorate click method as requiring the path to a single tool.

planemo.options.required_new_job_arg()[source]
planemo.options.required_runnable_arg()[source]
planemo.options.required_tool_arg(allow_uris=False)[source]

Decorate click method as requiring the path to a single tool.

planemo.options.required_workflow_arg()[source]
planemo.options.run_download_outputs_option()[source]
planemo.options.run_engine_option()[source]

Annotate click command as consume the –engine option.

planemo.options.run_history_tags_option()[source]
planemo.options.run_output_directory_option()[source]
planemo.options.run_output_json_option()[source]
planemo.options.serve_engine_option()[source]

Annotate click command as consume the –engine option.

This variant of the engine command is restricted to engines that can serve Galaxy servers.

planemo.options.shed_check_diff_option()[source]
planemo.options.shed_dependency_resolution()[source]
planemo.options.shed_email_option()[source]
planemo.options.shed_fail_fast_option()[source]
planemo.options.shed_force_create_option()[source]
planemo.options.shed_install_option()[source]
planemo.options.shed_key_from_env_option()[source]
planemo.options.shed_key_option()[source]
planemo.options.shed_message_option()[source]
planemo.options.shed_name_option()[source]
planemo.options.shed_owner_option()[source]
planemo.options.shed_password_option()[source]
planemo.options.shed_project_arg(multiple=True)[source]
planemo.options.shed_publish_options()[source]

Common options for commands that require publishing to a a shed.

planemo.options.shed_read_options()[source]

Common options that require read access to mapped repositories in a shed.

planemo.options.shed_realization_options()[source]
planemo.options.shed_repo_options()[source]
planemo.options.shed_skip_metadata()[source]
planemo.options.shed_skip_upload()[source]
planemo.options.shed_target_option()[source]
planemo.options.shed_target_options()[source]

Common options for commands that require read-only interactions with a shed.

planemo.options.shed_tools_conf_option()[source]
planemo.options.shed_tools_directory_option()[source]
planemo.options.shed_upload_options()[source]
planemo.options.simultaneous_upload_option()[source]
planemo.options.single_user_mode_option()[source]
planemo.options.skip_client_build_option()[source]

Annotate click command as consume the –skip_client_build option.

planemo.options.skip_install_option()[source]
planemo.options.skip_option()[source]
planemo.options.skip_venv_option()[source]

Annotate click command as consume the –skip_venv option.

planemo.options.split_job_and_test()[source]
planemo.options.test_data_option()[source]

Annotate click command as consume the –test_data option.

planemo.options.test_index_option()[source]
planemo.options.test_options()[source]
planemo.options.test_output_options()[source]
planemo.options.test_report_options()[source]
planemo.options.tool_data_path_option()[source]
planemo.options.tool_data_table_option()[source]
planemo.options.tool_dependency_dir_option()[source]
planemo.options.tool_init_autopygen_option(prompt=False)[source]
planemo.options.tool_init_cite_url_option()[source]
planemo.options.tool_init_command_option()[source]
planemo.options.tool_init_container_option()[source]
planemo.options.tool_init_description_option()[source]
planemo.options.tool_init_doi_option()[source]
planemo.options.tool_init_example_command_option(help="Example to command with paths to build Cheetah template from (e.g. 'seqtk seq -A 2.fastq > 2.fasta'). Option cannot be used with --command, should be used --example_input and --example_output.")[source]
planemo.options.tool_init_example_input_option()[source]
planemo.options.tool_init_example_output_option()[source]
planemo.options.tool_init_help_from_command_option()[source]
planemo.options.tool_init_help_text_option()[source]
planemo.options.tool_init_id_option(prompt=True)[source]
planemo.options.tool_init_input_option()[source]
planemo.options.tool_init_macros_option()[source]
planemo.options.tool_init_name_option(prompt=True, help='Name for new tool (user facing)')[source]
planemo.options.tool_init_named_output_option()[source]
planemo.options.tool_init_output_option()[source]
planemo.options.tool_init_requirement_option(help="Add a tool requirement package (e.g. 'seqtk' or 'seqtk@1.68').")[source]
planemo.options.tool_init_test_case_option()[source]
planemo.options.tool_init_tool_option()[source]
planemo.options.tool_init_version_command_option()[source]
planemo.options.tool_init_version_option()[source]
planemo.options.tool_test_json(var='path')[source]
planemo.options.training_fill_data_library_options()[source]
planemo.options.training_generate_tuto_from_wf_options()[source]
planemo.options.training_init_options()[source]
planemo.options.training_topic_name_option()[source]
planemo.options.training_topic_option()[source]
planemo.options.training_tutorial_name_option()[source]
planemo.options.training_tutorial_name_req_option()[source]
planemo.options.training_tutorial_option()[source]
planemo.options.training_tutorial_worflow_option()[source]
planemo.options.training_zenodo_option()[source]
planemo.options.validate_shed_target_callback(ctx, param, value)[source]
planemo.options.workflow_output_artifact()[source]

planemo.runnable module

Describe artifacts that can be run, tested, and linted.

class planemo.runnable.ErrorRunResponse(error_message, job_info=None, invocation_details=None, log=None, start_datetime=None, end_datetime=None)[source]

Bases: RunResponse

Description of an error while attempting to execute a Runnable.

property end_datetime

End datetime of run.

property error_message

Error message describing the problem with execution of the runnable.

property invocation_details

If workflow invocation details are available, return as dictionary.

property job_info

Return potentially null stored job_info dict.

property log

Return potentially null stored log text.

property outputs_dict

Return a dict of output descriptions.

property start_datetime

Start datetime of run.

property was_successful

Return False to indicate this run was successful.

class planemo.runnable.RunResponse[source]

Bases: object

Description of an attempt for an engine to execute a Runnable.

property end_datetime: None

End datetime of run.

get_output(output_id)[source]

Fetch output from engine.

abstract property invocation_details

If workflow invocation details are available, return as dictionary.

abstract property job_info

If job information is available, return as dictionary.

abstract property log

If engine related log is available, return as text data.

abstract property outputs_dict

Return a dict of output descriptions.

property start_datetime: None

Start datetime of run.

structured_data(test_case: TestCase | None = None) Dict[str, Any][source]
abstract property was_successful: bool

Indicate whether an error was encountered while executing this runnable.

If successful, response should conform to the SuccessfulRunResponse interface, otherwise it will conform to the ErrorRunResponse interface.

class planemo.runnable.Runnable(uri: str, type: RunnableType)[source]

Bases: NamedTuple

Abstraction describing tools and workflows.

property data_manager_conf_path: str | None

Path of a Galaxy data manager configuration for runnable or None.

property has_path
property has_tools: property

Boolean indicating if this runnable corresponds to one or more tools.

property is_remote_workflow_uri: bool
property is_single_artifact: property

Boolean indicating if this runnable is a single artifact.

Currently only directories are considered not a single artifact.

property path: str
property test_data_search_path: str

During testing, path to search for test data files.

property tool_data_search_path: str

During testing, path to search for Galaxy tool data tables.

type: RunnableType

Alias for field number 1

uri: str

Alias for field number 0

class planemo.runnable.RunnableOutput[source]

Bases: object

Description of a single output of an execution of a Runnable.

abstract property get_id

An identifier that describes this output.

is_optional()[source]
class planemo.runnable.RunnableType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)[source]

Bases: Enum

cwl_tool = 4
cwl_workflow = 5
directory = 6
galaxy_datamanager = 2
galaxy_tool = 1
galaxy_workflow = 3
property has_tools
property is_cwl_artifact: bool
property is_galaxy_artifact: bool
property is_single_artifact
property test_data_in_parent_dir
class planemo.runnable.SuccessfulRunResponse(runnable: Runnable)[source]

Bases: RunResponse

Description of the results of an engine executing a Runnable.

property was_successful

Return True to indicate this run was successful.

class planemo.runnable.TestCase(runnable: Runnable, tests_directory: str, output_expectations: Dict[str, Any], job_path: str | None, job: Dict | None, index: int, doc: str | None)[source]

Bases: AbstractTestCase

Describe an abstract test case for a specified runnable.

property input_ids: List[str]

Labels of inputs specified in test description.

structured_test_data(run_response: RunResponse) Dict[str, Any][source]

Check a test case against outputs dictionary.

property tested_output_ids: List[str]

Labels of outputs checked in test description.

planemo.runnable.cases(runnable: Runnable) List[AbstractTestCase][source]

Build a list of TestCase objects for specified runnable.

planemo.runnable.for_path(path: str) Runnable | List[Runnable][source]

Produce a class:Runnable for supplied path.

planemo.runnable.for_paths(paths: Iterable[str]) List[Runnable][source]

Return a specialized list of Runnable objects for paths.

planemo.runnable.get_outputs(runnable: Runnable, gi: GalaxyInstance | None = None) List[RunnableOutput][source]

Return a list of RunnableOutput objects for this runnable.

Supply bioblend user Galaxy instance object (as gi) if additional context needed to resolve workflow details.

planemo.runnable_resolve module

planemo.runnable_resolve.for_runnable_identifier(ctx, runnable_identifier, kwds: Dict[str, Any])[source]

Convert URI, path, or alias into Runnable.

planemo.runnable_resolve.for_runnable_identifiers(ctx, runnable_identifiers, kwds: Dict[str, Any])[source]

Convert lists of URIs, paths, and/or aliases into Runnables.

planemo.runnable_resolve.install_args_list_to_runnables(ctx, install_args_list, kwds)[source]

planemo.shed_lint module

Logic related to linting shed repositories.

planemo.shed_lint.lint_repository(ctx, realized_repository, **kwds)[source]

Lint a realized shed repository.

See planemo.shed for details on constructing a realized repository data structure.

planemo.templates module

Templating abstraction around jinja2 for Planemo.

planemo.templates.render(template_str: str, **kwds)[source]

Use jinja2 to render specified template.

planemo.tool_builder module

This module contains build() to build tool descriptions.

This class is used by the tool_init command and can be used to build Galaxy and CWL tool descriptions.

class planemo.tool_builder.ToolDescription(contents, tool_files=None, test_files=None)[source]

Bases: object

An description of the tool and related files to create.

planemo.tool_builder.build(**kwds)[source]

Build up a ToolDescription() from supplid arguments.

planemo.tool_builder.write_tool_description(ctx, tool_description, **kwds)[source]

Write a tool description to the file system guided by supplied CLI kwds.

planemo.tool_lint module

planemo.tool_lint.build_tool_lint_args(ctx, **kwds)[source]
planemo.tool_lint.handle_tool_load_error(tool_path, tool_xml)[source]

Return True if tool_xml is tool load error (invalid XML), and print a helpful error message.

planemo.tool_lint.lint_tools_on_path(ctx, paths, lint_args, **kwds)[source]

planemo.tools module

Planemo-specific wrappers around galaxy-tool-util tool functionality.

planemo.tools.is_tool_load_error(obj)[source]

Predicate to determine if object loaded for tool is a tool error.

planemo.tools.load_tool_sources_from_path(path: str, recursive: bool, register_load_errors: bool = False) List[Tuple[str, ToolSource | object]][source]

Generate a list for tool sources found down specified path.

planemo.tools.yield_tool_sources(ctx: PlanemoCliContext | None, path: str, recursive: bool = False, yield_load_errors: bool = True) Iterator[Tuple[str, ToolSource | object]][source]

Walk single path and yield ToolSource objects discovered.

planemo.tools.yield_tool_sources_on_paths(ctx: PlanemoCliContext | None, paths: Iterable[str], recursive: bool = False, yield_load_errors: bool = True, exclude_deprecated: bool = False) Iterator[Tuple[str, ToolSource | object]][source]

Walk paths and yield ToolSource objects discovered.

planemo.virtualenv module

Utilities for using virtualenv as library and planemo command.

planemo.virtualenv.create_command(virtualenv_path: str, galaxy_python_version: str | None = None) str[source]

If virtualenv is on Planemo’s path use it, otherwise use the planemo subcommand virtualenv to create the virtualenv.

planemo.workflow_lint module

class planemo.workflow_lint.WorkflowLintContext(level: ~galaxy.tool_util.lint.LintLevel | str, lint_message_class: ~typing.Type[~galaxy.tool_util.lint.LintMessage] = <class 'galaxy.tool_util.lint.LintMessage'>, skip_types: ~typing.List[str] | None = None, object_name: str | None = None)[source]

Bases: LintContext

training_topic = None
planemo.workflow_lint.find_potential_workflow_files(directory: str) List[str][source]

Return a list of potential workflow files in a directory.

planemo.workflow_lint.find_repos_from_tool_id(tool_id: str, ts: ToolShedInstance) Tuple[str, Dict[str, Any]][source]

Return a string which indicates what failed and dict with all revisions for a given tool id

planemo.workflow_lint.find_workflow_descriptions(directory: str) Iterator[str][source]
planemo.workflow_lint.generate_dockstore_yaml(directory: str, publish: bool = True) str[source]
planemo.workflow_lint.is_valid_output_expectations(lint_context, output_expectations)[source]
planemo.workflow_lint.lint_workflow_artifacts_on_paths(ctx: PlanemoCliContext, paths: Iterable[str], lint_args: Dict[str, str | List[str]]) int[source]
planemo.workflow_lint.looks_like_a_workflow(path: str) bool[source]

Return boolean indicating if this path looks like a workflow.

Module contents