planemo package

Subpackages

Submodules

planemo.autoupdate module

Autoupdate older conda dependencies in the requirements section.

planemo.autoupdate.autoupdate_tool(ctx, tool_path, modified_files={}, **kwds)[source]

Autoupdate an XML file

planemo.autoupdate.check_conda(tool_name, ctx, **kwds)[source]

Get the most up-to-date conda version for a tool requirement

planemo.autoupdate.create_requirement_dict(xml_files, skip_reqs)[source]

Create dict with requirements and find main requirement

planemo.autoupdate.create_token_dict(ctx, xml_files, main_req, **kwds)[source]

Create dict with relevant tokens and check conda requirements for main

planemo.autoupdate.find_macros(xml_tree)[source]

Get macros from the XML tree

planemo.autoupdate.get_requirements(xml_tree)[source]

Get requirements from the XML tree

planemo.autoupdate.get_tokens(xml_tree)[source]

Get tokens from the XML tree

planemo.autoupdate.perform_required_update(ctx, xml_files, tool_path, requirements, tokens, xml_to_update, wrapper_version_token, **kwds)[source]

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

planemo.autoupdate.update_xml(tool_path, xml_tree, tags_to_update, wrapper_version_token, is_macro=False)[source]

Write modified XML to tool_path

planemo.bioblend module

Planemo layer for ensuring bioblend available.

planemo.bioblend.ensure_module()[source]

Throw an exception if bioblend is not available to Planemo.

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.

planemo.cli.command_function(f)[source]

Extension point for processing kwds after click callbacks.

planemo.cli.list_cmds()[source]

List planemo commands from commands folder.

planemo.cli.name_to_command(name)[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.

class planemo.cli.PlanemoCliContext[source]

Bases: planemo.context.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)[source]

Exit planemo with the supplied exit code.

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, **kwds)[source]

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

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

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.collect_conda_target_lists(ctx, paths, recursive=False, found_tool_callback=None)[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, paths, recursive=False, found_tool_callback=None)[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.tool_source_conda_targets(tool_source)[source]

Load CondaTarget object from supplied abstract tool source.

planemo.conda_lint module

Logic for linting conda recipes.

planemo.conda_lint.lint_recipes_on_paths(ctx, paths, **kwds)[source]

Apply conda linting procedure to recipes on supplied paths.

planemo.config module

Module defines abstractions for configuring Planemo.

planemo.config.global_config_path(config_path=None)[source]
planemo.config.read_global_config(config_path: str)[source]
planemo.config.planemo_option(*args, **kwargs)[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.context module

Define the context around Planemo computation.

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

planemo.context.configure_standard_planemo_logging(verbose)[source]

Configure Planemo’s default logging rules.

class planemo.context.PlanemoContextInterface[source]

Bases: object

Interface Planemo operations use to access workspace context.

cache_download(url, destination)[source]

Use workspace to cache download of url.

galaxy_profiles_directory

Create a return a directory for storing Galaxy profiles.

get_option_source(param_name)[source]

Return OptionSource value indicating how the option was set.

global_config

Read Planemo’s global configuration.

log(msg, *args)[source]

Log a message.

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

Specify how an option was set.

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

Log a message only if verbose is enabled.

workspace

Create and return Planemo’s workspace.

class planemo.context.PlanemoContext[source]

Bases: planemo.context.PlanemoContextInterface

Implementation of PlanemoContextInterface

cache_download(url, destination)[source]

Use workspace to cache download of url.

galaxy_profiles_directory

Create a return a directory for storing Galaxy profiles.

get_option_source(param_name)[source]

Return OptionSource value indicating how the option was set.

global_config

Read Planemo’s global configuration.

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

log(msg, *args)[source]

Log a message.

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

Specify how an option was set.

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

Log a message only if verbose is enabled.

workspace

Create and return Planemo’s workspace.

By default this will be ~/.planemo.

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, repo_path, file_path)[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)[source]

Clone a git repository.

See command_clone() for description of arguments.

planemo.git.command_clone(ctx, src, dest, mirror=False, branch=None)[source]

Produce a command-line string to clone a repository.

Take in ctx to allow more configurability down the road.

planemo.git.commit(ctx, repo_path, message='')[source]
planemo.git.diff(ctx, directory, range)[source]

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

planemo.git.git_env_for(path)[source]

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

planemo.git.init(ctx, repo_path)[source]
planemo.git.is_rev_dirty(ctx, directory)[source]

Check if specified git repository has uncommitted changes.

planemo.git.ls_remote(ctx, remote_repo)[source]

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

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

Raw revision for git directory specified.

Throws RuntimeError if not a git directory.

planemo.git.rev_if_git(ctx, directory)[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, 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, 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_github_config(ctx, allow_anonymous=False)[source]

Return a planemo.github_util.GithubConfig for given configuration.

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_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)[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.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, recursive=False)[source]
planemo.mulled.conda_to_mulled_targets(conda_targets)[source]

planemo.network_util module

planemo.network_util.get_free_port()[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: click.types.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: Optional[Type[CT_co]] = None)[source]

Bases: click.types.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_copy_dependencies_option()[source]
planemo.options.conda_debug_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_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.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_target_options()[source]
planemo.options.galaxy_url_option()[source]
planemo.options.galaxy_user_key_option()[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_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)[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.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_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_options()[source]
planemo.options.test_report_options()[source]
planemo.options.tool_data_table_option()[source]
planemo.options.tool_dependency_dir_option()[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_datatype_option()[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.

planemo.runnable.cases(runnable)[source]

Build a list of TestCase objects for specified runnable.

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

Bases: planemo.runnable.RunResponse

Description of an error while attempting to execute a Runnable.

end_datetime

End datetime of run.

error_message

Error message describing the problem with execution of the runnable.

invocation_details

If workflow invocation details are available, return as dictionary.

job_info

Return potentially null stored job_info dict.

log

Return potentially null stored log text.

start_datetime

Start datetime of run.

was_successful

Return False to indicate this run was successful.

planemo.runnable.for_path(path, temp_path=None, return_all=False)[source]

Produce a class:Runnable for supplied path.

planemo.runnable.for_paths(paths, temp_path=None)[source]

Return a specialized list of Runnable objects for paths.

planemo.runnable.get_outputs(runnable, gi=None)[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.

class planemo.runnable.Runnable[source]

Bases: tuple

Abstraction describing tools and workflows.

data_manager_conf_path

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

has_path
has_tools

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

is_remote_workflow_uri
is_single_artifact

Boolean indicating if this runnable is a single artifact.

Currently only directories are considered not a single artifact.

path
test_data_search_path

During testing, path to search for test data files.

tool_data_search_path

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

type

Alias for field number 1

uri

Alias for field number 0

class planemo.runnable.RunnableType[source]

Bases: enum.Enum

An enumeration.

cwl_tool = 4
cwl_workflow = 5
directory = 6
galaxy_datamanager = 2
galaxy_tool = 1
galaxy_workflow = 3
has_tools
is_cwl_artifact
is_galaxy_artifact
is_single_artifact
test_data_in_parent_dir
class planemo.runnable.RunResponse[source]

Bases: object

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

end_datetime

End datetime of run.

invocation_details

If workflow invocation details are available, return as dictionary.

job_info

If job information is available, return as dictionary.

log

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

start_datetime

Start datetime of run.

was_successful

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.RunnableOutput[source]

Bases: object

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

get_id

An identifier that describes this output.

class planemo.runnable.SuccessfulRunResponse[source]

Bases: planemo.runnable.RunResponse

Description of the results of an engine executing a Runnable.

outputs_dict

Return a dict of output descriptions.

was_successful()[source]

Return True to indicate this run was successful.

class planemo.runnable.TestCase(runnable, tests_directory, output_expectations, job_path, job, index, doc)[source]

Bases: planemo.runnable.AbstractTestCase

Describe an abstract test case for a specified runnable.

input_ids

Labels of inputs specified in test description.

structured_test_data(run_response)[source]

Check a test case against outputs dictionary.

tested_output_ids

Labels of outputs checked in test description.

planemo.runnable_resolve module

planemo.runnable_resolve.for_runnable_identifier(ctx, runnable_identifier, kwds, temp_path=None, return_all=False)[source]

Convert URI, path, or alias into Runnable.

planemo.runnable_resolve.for_runnable_identifiers(ctx, runnable_identifiers, kwds, temp_path=None)[source]

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

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.

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

Build up a ToolDescription() from supplid arguments.

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

Bases: object

An description of the tool and related files to create.

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, recursive, register_load_errors=False)[source]

Generate a list for tool sources found down specified path.

planemo.tools.yield_tool_sources(ctx, path, recursive=False, yield_load_errors=True)[source]

Walk single path and yield ToolSource objects discovered.

planemo.tools.yield_tool_sources_on_paths(ctx, paths, recursive=False, yield_load_errors=True, exclude_deprecated=False)[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, galaxy_python_version=None)[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, skip_types=None, object_name=None)[source]

Bases: galaxy.tool_util.lint.LintContext

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

Return a list of potential workflow files in a directory.

planemo.workflow_lint.find_workflow_descriptions(directory)[source]
planemo.workflow_lint.generate_dockstore_yaml(directory)[source]
planemo.workflow_lint.lint_workflow_artifacts_on_paths(ctx, paths, lint_args)[source]
planemo.workflow_lint.looks_like_a_workflow(path)[source]

Return boolean indicating if this path looks like a workflow.

Module contents