Warning

This document is for an in-development version of Galaxy. You can alternatively view this page in the latest release if it exists or view the top of the latest release's documentation.

galaxy.tools.deps.resolvers package

The module defines the abstract interface for dealing tool dependency resolution plugins.

class galaxy.tools.deps.resolvers.DependencyResolver[source]

Bases: galaxy.util.dictifiable.Dictifiable

Abstract description of a technique for resolving container images for tool execution.

dict_collection_visible_keys = ['resolver_type', 'resolves_simple_dependencies', 'can_uninstall_dependencies']
disabled = False
resolves_simple_dependencies = True
can_uninstall_dependencies = False
config_options = {}
resolve(requirement, **kwds)[source]

Given inputs describing dependency in the abstract yield a Dependency object.

The Dependency object describes various attributes (script, bin, version) used to build scripts with the dependency availble. Here script is the env.sh file to source before running a job, if that is not found the bin directory will be appended to the path (if it is not None). Finally, version is the resolved tool dependency version (which may differ from requested version for instance if the request version is ‘default’.)

class galaxy.tools.deps.resolvers.MultipleDependencyResolver[source]

Bases: object

Variant of DependencyResolver that can optionally resolve multiple dependencies together.

resolve_all(requirements, **kwds)[source]

Given multiple requirements yields a list of Dependency objects if and only if they may all be resolved together.

Unsuccessfull attempts should return an empty list.

Parameters:
  • requirements – list of tool requirements
  • type – [ToolRequirement] or ToolRequirements
Returns:

list of resolved dependencies

Return type:

[Dependency]

class galaxy.tools.deps.resolvers.ListableDependencyResolver[source]

Bases: object

Mix this into a DependencyResolver and implement to indicate the dependency resolver can iterate over its dependencies and generate requirements.

list_dependencies()[source]

List the “simple” requirements that may be resolved “exact”-ly by this dependency resolver.

class galaxy.tools.deps.resolvers.MappableDependencyResolver[source]

Bases: object

Mix this into a DependencyResolver to allow mapping files.

Mapping files allow adapting generic requirements to specific local implementations.

class galaxy.tools.deps.resolvers.RequirementMapping(from_name, from_version, to_name, to_version)[source]

Bases: object

__init__(from_name, from_version, to_name, to_version)[source]
matches_requirement(requirement)[source]

Check if supplied ToolRequirement matches this mapping description.

For it to match - the names must match. Additionally if the requirement is created with a version or with unversioned being set to True additional checks are needed. If a version is specified, it must match the supplied version exactly. If unversioned is True, then the supplied requirement must be unversioned (i.e. its version must be set to None).

apply(requirement)[source]
static from_dict(raw_mapping)[source]
class galaxy.tools.deps.resolvers.SpecificationAwareDependencyResolver[source]

Bases: object

Mix this into a DependencyResolver to implement URI specification matching.

Allows adapting generic requirements to more specific URIs - to tailor name or version to specified resolution system.

class galaxy.tools.deps.resolvers.SpecificationPatternDependencyResolver[source]

Bases: galaxy.tools.deps.resolvers.SpecificationAwareDependencyResolver

Implement the SpecificationAwareDependencyResolver with a regex pattern.

class galaxy.tools.deps.resolvers.InstallableDependencyResolver[source]

Bases: object

Mix this into a DependencyResolver and implement to indicate the dependency resolver can attempt to install new dependencies.

install_dependency(name, version, type, **kwds)[source]

Attempt to install this dependency if a recipe to do so has been registered in some way.

class galaxy.tools.deps.resolvers.Dependency[source]

Bases: galaxy.util.dictifiable.Dictifiable

dict_collection_visible_keys = ['dependency_type', 'exact', 'name', 'version', 'cacheable']
cacheable = False
shell_commands()[source]

Return shell commands to enable this dependency.

exact

Return true if version information wasn’t discarded to resolve the dependency.

resolver_msg

Return a message describing this dependency

class galaxy.tools.deps.resolvers.ContainerDependency(container_description, name, version)[source]

Bases: galaxy.tools.deps.resolvers.Dependency

dict_collection_visible_keys = ['dependency_type', 'exact', 'name', 'version', 'cacheable', 'environment_path']
__init__(container_description, name, version)[source]
name
version
exact
shell_commands
class galaxy.tools.deps.resolvers.NullDependency(version=None, name=None)[source]

Bases: galaxy.tools.deps.resolvers.Dependency

dependency_type = None
exact = True
__init__(version=None, name=None)[source]
resolver_msg

Return a message describing this dependency

shell_commands()[source]
exception galaxy.tools.deps.resolvers.DependencyException[source]

Bases: exceptions.Exception

Submodules

galaxy.tools.deps.resolvers.brewed_tool_shed_packages module

This dependency resolver resolves tool shed dependencies (those defined tool_dependencies.xml) installed using Platform Homebrew and converted via shed2tap (e.g. https://github.com/jmchilton/homebrew-toolshed).

class galaxy.tools.deps.resolvers.brewed_tool_shed_packages.HomebrewToolShedDependencyResolver(dependency_manager, **kwds)[source]

Bases: galaxy.tools.deps.resolvers.DependencyResolver, galaxy.tools.deps.resolvers.resolver_mixins.UsesHomebrewMixin, galaxy.tools.deps.resolvers.resolver_mixins.UsesToolDependencyDirMixin, galaxy.tools.deps.resolvers.resolver_mixins.UsesInstalledRepositoriesMixin

resolver_type = 'tool_shed_tap'
__init__(dependency_manager, **kwds)[source]
resolve(requirement, **kwds)[source]

galaxy.tools.deps.resolvers.conda module

This is still an experimental module and there will almost certainly be backward incompatible changes coming.

class galaxy.tools.deps.resolvers.conda.CondaDependencyResolver(dependency_manager, **kwds)[source]

Bases: galaxy.tools.deps.resolvers.DependencyResolver, galaxy.tools.deps.resolvers.MultipleDependencyResolver, galaxy.tools.deps.resolvers.ListableDependencyResolver, galaxy.tools.deps.resolvers.InstallableDependencyResolver, galaxy.tools.deps.resolvers.SpecificationPatternDependencyResolver, galaxy.tools.deps.resolvers.MappableDependencyResolver

dict_collection_visible_keys = ['resolver_type', 'resolves_simple_dependencies', 'can_uninstall_dependencies', 'conda_prefix', 'versionless', 'ensure_channels', 'auto_install']
resolver_type = 'conda'
config_options = {'auto_init': True, 'auto_install': False, 'copy_dependencies': False, 'debug': None, 'ensure_channels': 'iuc,conda-forge,bioconda,defaults', 'exec': None, 'prefix': None, 'use_local': False}
__init__(dependency_manager, **kwds)[source]
clean(**kwds)[source]
uninstall(requirements)[source]

Uninstall requirements installed by install_all or multiple install statements.

uninstall_environments(environments)[source]
install_all(conda_targets)[source]
resolve_all(requirements, **kwds)[source]

Some combinations of tool requirements need to be resolved all at once, so that Conda can select a compatible combination of dependencies. This method returns a list of MergedCondaDependency instances (one for each requirement) if all requirements have been successfully resolved, or an empty list if any of the requirements could not be resolved.

Parameters specific to this resolver are:

preserve_python_environment: Boolean, controls whether the python environment should be maintained during job creation for tools
that rely on galaxy being importable.
install: Controls if requirements should be installed. If install is True and the requirements are not installed
an attempt is made to install the requirements. If install is None requirements will only be installed if conda_auto_install has been activated and the requirements are not yet installed. If install is False will not install requirements.
merged_environment_name(conda_targets)[source]
resolve(requirement, **kwds)[source]
unused_dependency_paths(toolbox_requirements_status)[source]

Identify all local environments that are not needed to build requirements_status.

We try to resolve the requirements, and we note every environment_path that has been taken.

list_dependencies()[source]
install_dependency(name, version, type, **kwds)[source]

Returns True on (seemingly) successfull installation

prefix

galaxy.tools.deps.resolvers.galaxy_packages module

class galaxy.tools.deps.resolvers.galaxy_packages.GalaxyPackageDependency(script, path, name, type, version, exact=True)[source]

Bases: galaxy.tools.deps.resolvers.Dependency

dict_collection_visible_keys = ['dependency_type', 'exact', 'name', 'version', 'cacheable', 'script', 'path', 'version', 'name']
dependency_type = 'galaxy_package'
__init__(script, path, name, type, version, exact=True)[source]
exact
shell_commands()[source]
class galaxy.tools.deps.resolvers.galaxy_packages.ToolShedDependency(script, path, name, type, version, exact=True)[source]

Bases: galaxy.tools.deps.resolvers.galaxy_packages.GalaxyPackageDependency

dependency_type = 'tool_shed_package'
class galaxy.tools.deps.resolvers.galaxy_packages.GalaxyPackageDependencyResolver(dependency_manager, **kwds)[source]

Bases: galaxy.tools.deps.resolvers.galaxy_packages.BaseGalaxyPackageDependencyResolver, galaxy.tools.deps.resolvers.ListableDependencyResolver, galaxy.tools.deps.resolvers.MappableDependencyResolver

resolver_type = 'galaxy_packages'
__init__(dependency_manager, **kwds)[source]
resolve(requirement, **kwds)[source]
list_dependencies()[source]

galaxy.tools.deps.resolvers.homebrew module

This file implements a brew resolver for Galaxy requirements. In order for Galaxy to pick up on recursively defined and versioned brew dependencies recipes should be installed using the experimental brew-vinstall external command.

More information here:

https://github.com/jmchilton/brew-tests https://github.com/Homebrew/homebrew-science/issues/1191

This is still an experimental module and there will almost certainly be backward incompatible changes coming.

class galaxy.tools.deps.resolvers.homebrew.HomebrewDependencyResolver(dependency_manager, **kwds)[source]

Bases: galaxy.tools.deps.resolvers.DependencyResolver, galaxy.tools.deps.resolvers.resolver_mixins.UsesHomebrewMixin

resolver_type = 'homebrew'
__init__(dependency_manager, **kwds)[source]
resolve(requirement, **kwds)[source]

galaxy.tools.deps.resolvers.lmod module

This is a prototype dependency resolver to be able to use the “LMOD environment modules system” from TACC to solve package requirements

LMOD official website: https://www.tacc.utexas.edu/research-development/tacc-projects/lmod

LMOD @ Github: https://github.com/TACC/Lmod

class galaxy.tools.deps.resolvers.lmod.LmodDependencyResolver(dependency_manager, **kwds)[source]

Bases: galaxy.tools.deps.resolvers.DependencyResolver, galaxy.tools.deps.resolvers.MappableDependencyResolver

Dependency resolver based on the LMOD environment modules system

dict_collection_visible_keys = ['resolver_type', 'resolves_simple_dependencies', 'can_uninstall_dependencies', 'base_path', 'modulepath']
resolver_type = 'lmod'
__init__(dependency_manager, **kwds)[source]
resolve(requirement, **kwds)[source]

galaxy.tools.deps.resolvers.modules module

This file contains the outline of an implementation to load environment modules (http://modules.sourceforge.net/).

This is a community contributed feature and the core Galaxy team does utilize it, hence support for it will be minimal. The Galaxy team eagerly welcomes community contribution and maintenance however.

class galaxy.tools.deps.resolvers.modules.ModuleDependencyResolver(dependency_manager, **kwds)[source]

Bases: galaxy.tools.deps.resolvers.DependencyResolver, galaxy.tools.deps.resolvers.MappableDependencyResolver

dict_collection_visible_keys = ['resolver_type', 'resolves_simple_dependencies', 'can_uninstall_dependencies', 'base_path', 'modulepath']
resolver_type = 'modules'
__init__(dependency_manager, **kwds)[source]
resolve(requirement, **kwds)[source]

galaxy.tools.deps.resolvers.resolver_mixins module

class galaxy.tools.deps.resolvers.resolver_mixins.UsesHomebrewMixin[source]

Bases: object

class galaxy.tools.deps.resolvers.resolver_mixins.UsesToolDependencyDirMixin[source]

Bases: object

class galaxy.tools.deps.resolvers.resolver_mixins.UsesInstalledRepositoriesMixin[source]

Bases: object

class galaxy.tools.deps.resolvers.resolver_mixins.HomebrewDependency(commands, exact=True)[source]

Bases: galaxy.tools.deps.resolvers.Dependency

__init__(commands, exact=True)[source]
exact
shell_commands()[source]

galaxy.tools.deps.resolvers.tool_shed_packages module

class galaxy.tools.deps.resolvers.tool_shed_packages.ToolShedPackageDependencyResolver(dependency_manager, **kwds)[source]

Bases: galaxy.tools.deps.resolvers.galaxy_packages.BaseGalaxyPackageDependencyResolver, galaxy.tools.deps.resolvers.resolver_mixins.UsesInstalledRepositoriesMixin

resolver_type = 'tool_shed_packages'
dependency_type

alias of galaxy.tools.deps.resolvers.galaxy_packages.ToolShedDependency

resolves_simple_dependencies = False
__init__(dependency_manager, **kwds)[source]

galaxy.tools.deps.resolvers.unlinked_tool_shed_packages module

Backup resolvers for when dependencies can not be loaded from the database. Mainly suited for testing stage.

Ideally all dependencies will be stored in the database
when a tool is added from a Tool Shed.

That should remain the preferred way of locating dependencies.

In cases where that is not possible
for example during testing this resolver can act as a backup.
This resolver looks not just for manually added dependencies
but also ones added from a Tool Shed.

This tool is still under development so the default behaviour could change. It has been tested when placed in the same directory as galaxy_packages.py

At the time of writing July 3 2015 this resolver has to be plugged in. See bottom for instructions on how to add this resolver.

class galaxy.tools.deps.resolvers.unlinked_tool_shed_packages.UnlinkedToolShedPackageDependencyResolver(dependency_manager, **kwds)[source]

Bases: galaxy.tools.deps.resolvers.galaxy_packages.BaseGalaxyPackageDependencyResolver

dict_collection_visible_keys = ['resolver_type', 'resolves_simple_dependencies', 'can_uninstall_dependencies', 'base_path', 'versionless', 'preferred_owners', 'select_by_owner']
resolver_type = 'unlinked_tool_shed_packages'
__init__(dependency_manager, **kwds)[source]