This document is for an old release 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.
Source code for galaxy.tools.deps.resolvers.unlinked_tool_shed_packages
""" 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. """ import logging from os import listdir from os.path import ( exists, getmtime, join ) from . import ( Dependency, NullDependency ) from .galaxy_packages import BaseGalaxyPackageDependencyResolver log = logging.getLogger(__name__) MANUAL = "manual" PREFERRED_OWNERS = MANUAL + ",iuc,devteam" class CandidateDependency(Dependency): dict_collection_visible_keys = Dependency.dict_collection_visible_keys + ['dependency', 'path', 'owner'] dependency_type = 'unlinked_tool_shed_package' @property def exact(self): return self.dependency.exact def __init__(self, dependency, path, owner=MANUAL): self.dependency = dependency self.path = path self.owner = owner def shell_commands(self): """ Return shell commands to enable this dependency. """ return self.dependency.shell_commands() __all__ = ('UnlinkedToolShedPackageDependencyResolver', ) """ At the time of writing July 3 2015 this resolver has to be plugged in. Adding resolver instructions: 1. create a dependency_resolvers_config.xml file <dependency_resolvers> <tool_shed_packages /> <galaxy_packages /> <galaxy_packages versionless="true" /> <unlinked_tool_shed_packages /> </dependency_resolvers> 1a. ALWAYS add <tool_shed_packages /> first!!!! 1b. <galaxy_packages /> is optional as this resolver will also find dependency found by that resolver 1bi Current default is to use a dependency to find that way first! 1bii So an alternative version of dependency_resolvers_config.xml <dependency_resolvers> <tool_shed_packages /> <unlinked_tool_shed_packages /> <unlinked_tool_shed_packages versionless="true" /> </dependency_resolvers> 1c. See __init__ for optional config values 1ci versionless currently is handled by the super class GalaxyPackageDependencyResolver 2. Add a parameter to config.ini dependency_resolvers_config_file = ./config/dependency_resolvers_config.xml 2a. File name/path can be different 2b. config key must be dependency_resolvers_config_file 3. For planemo it may be required to specify: --dependency_resolvers_config_file (xml file described in 1 above) --tool_dependency_dir (root of dependencies typically galaxy/dependency_dir) See planemo test --help for more information """