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.

tool_shed.galaxy_install.tool_dependencies.recipe package

Submodules

tool_shed.galaxy_install.tool_dependencies.recipe.asynchronous_reader module

class tool_shed.galaxy_install.tool_dependencies.recipe.asynchronous_reader.AsynchronousReader(fd, queue)[source]

Bases: threading.Thread

A helper class to implement asynchronous reading of a stream in a separate thread. Read lines are pushed onto a queue to be consumed in another thread.

__init__(fd, queue)[source]

This constructor should always be called with keyword arguments. Arguments are:

group should be None; reserved for future extension when a ThreadGroup class is implemented.

target is the callable object to be invoked by the run() method. Defaults to None, meaning nothing is called.

name is the thread name. By default, a unique name is constructed of the form “Thread-N” where N is a small decimal number.

args is the argument tuple for the target invocation. Defaults to ().

kwargs is a dictionary of keyword arguments for the target invocation. Defaults to {}.

If a subclass overrides the constructor, it must make sure to invoke the base class constructor (Thread.__init__()) before doing anything else to the thread.

run()[source]

Read lines and put them on the queue.

installation_complete()[source]

Make sure there is more installation and compilation logging content expected.

tool_shed.galaxy_install.tool_dependencies.recipe.env_file_builder module

class tool_shed.galaxy_install.tool_dependencies.recipe.env_file_builder.EnvFileBuilder(install_dir)[source]

Bases: object

__init__(install_dir)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

append_line(make_executable=True, **kwd)[source]
static create_or_update_env_shell_file(install_dir, env_var_dict)[source]
file_append(text, file_path, make_executable=True)[source]

Append a line to a file unless the line already exists in the file. This method creates the file if it doesn’t exist. If make_executable is True, the permissions on the file are set to executable by the owner.

handle_action_shell_file_paths(action_dict)[source]

tool_shed.galaxy_install.tool_dependencies.recipe.install_environment module

class tool_shed.galaxy_install.tool_dependencies.recipe.install_environment.InstallEnvironment(app, tool_shed_repository_install_dir, install_dir)[source]

Bases: object

Object describing the environment built up as part of the process of building and installing a package.

__init__(app, tool_shed_repository_install_dir, install_dir)[source]

The value of the received tool_shed_repository_install_dir is the root installation directory of the repository containing the tool dependency, and the value of the received install_dir is the root installation directory of the tool dependency.

add_env_shell_file_paths(paths)[source]
build_command(command, action_type='shell_command')[source]

Build command line for execution from simple command, but configuring environment described by this object.

close_file_descriptor(fd)[source]

Attempt to close a file descriptor.

enqueue_output(stdout, stdout_queue, stderr, stderr_queue)[source]

This method places streamed stdout and stderr into a threaded IPC queue target. Received data is printed and saved to that thread’s queue. The calling thread can then retrieve the data using thread.stdout and thread.stderr.

environment_commands(action_type)[source]

Build a list of commands used to construct the environment described by this object.

environment_dict(action_type='template_command')[source]
handle_command(tool_dependency, cmd, return_output=False, job_name='')[source]

Handle a command and log the results.

handle_complex_command(command, job_name='')[source]

Wrap subprocess.Popen in such a way that the stderr and stdout from running a shell command will be captured and logged in nearly real time. This is similar to fabric.local, but allows us to retain control over the process. This method is named “complex” because it uses queues and threads to execute a command while capturing and displaying the output.

log_results(command, fabric_AttributeString, file_path)[source]

Write attributes of fabric.operations._AttributeString to a specified log file.

use_tmp_dir(**kwds)[source]

tool_shed.galaxy_install.tool_dependencies.recipe.recipe_manager module

class tool_shed.galaxy_install.tool_dependencies.recipe.recipe_manager.StepManager(app)[source]

Bases: object

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

get_step_handler_by_type(type)[source]
execute_step(tool_dependency, package_name, actions, action_type, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]
load_step_handlers()[source]
prepare_step(tool_dependency, action_type, action_elem, action_dict, install_environment, is_binary_download)[source]

Prepare the recipe step for later execution. This generally alters the received action_dict with new information needed during this step’s execution.

class tool_shed.galaxy_install.tool_dependencies.recipe.recipe_manager.TagManager(app)[source]

Bases: object

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

get_tag_handler_by_tag(tag)[source]
process_tag_set(tool_shed_repository, tool_dependency, package_elem, package_name, package_version, from_tool_migration_manager=False, tool_dependency_db_records=None)[source]
load_tag_handlers()[source]

tool_shed.galaxy_install.tool_dependencies.recipe.step_handler module

class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download[source]

Bases: object

url_download(install_dir, downloaded_file_name, download_url, extract=True, checksums={})[source]

The given download_url can have an extension like #md5#, #sha256#, (or #md5= to support pypi defaults).

Alternatively, to not break HTTP spec, you can specify md5 and sha256 as keys in the <action /> element.

This indicates a checksum which will be checked after download. If the checksum does not match an exception is thrown.

get_elem_checksums(elem)[source]
get_dict_checksums(dct)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep[source]

Bases: object

Abstract class that defines a standard format for handling recipe steps when installing packages.

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]
prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.AssertDirectoryExecutable(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

assert_directory_executable(full_path)[source]

Return True if a symbolic link or directory exists and is executable, but if full_path is a file, return False.

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Make sure a symbolic link or directory on disk exists and is executable, but is not a file. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.AssertDirectoryExists(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

assert_directory_exists(full_path)[source]

Return True if a symbolic link or directory exists, but if full_path is a file, return False.

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Make sure a a symbolic link or directory on disk exists, but is not a file. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.AssertFileExecutable(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

assert_file_executable(full_path)[source]

Return True if a symbolic link or file exists and is executable, but if full_path is a directory, return False.

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Make sure a symbolic link or file on disk exists and is executable, but is not a directory. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.AssertFileExists(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

assert_file_exists(full_path)[source]

Return True if a symbolic link or file exists, but if full_path is a directory, return False.

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Make sure a symbolic link or file on disk exists, but is not a directory. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Autoconf(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Handle configure, make and make install in a shell, allowing for configuration options. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.ChangeDirectory(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Change the working directory in a shell. Since this class is not used in the initial download stage, no recipe step filtering is performed here and a None value is return for filtered_actions. However, the new dir value is returned since it is needed for later steps.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Chmod(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Change the mode setting for certain files in the installation environment. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.DownloadBinary(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download, tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

download_binary(url, work_dir, checksums)[source]

Download a pre-compiled binary from the specified URL.

filter_actions_after_binary_installation(actions)[source]

Filter out actions that should not be processed if a binary download succeeded.

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Download a binary file. If the value of initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.DownloadByUrl(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download, tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Download a file via HTTP. If the value of initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.DownloadFile(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download, tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Download a file. If the value of initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.MakeDirectory(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Make a directory on disk. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

make_directory(full_path)[source]
prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.MakeInstall(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Execute a make_install command in a shell. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.MoveDirectoryFiles(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Move a directory of files. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

move_directory_files(current_dir, source_dir, destination_dir)[source]
prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.MoveFile(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Move a file on disk. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RegexReplace(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Search and replace text in a file using regular expressions. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

This step supports the full range of python’s regular expression engine, including backreferences in the replacement text. Example:

<action type="regex_replace" filename="Makefile">
    <regex>^CFLAGS(\s*)=\s*-g\s*-Wall\s*-O2\s*$$</regex>
    <replacement>CFLAGS\1= -g -Wall -O2 -I$$(NCURSES_INCLUDE_PATH)/ncurses/ -I$$(NCURSES_INCLUDE_PATH) -L$$(NCURSES_LIB_PATH)</replacement>
</action>

Before:

CFLAGS  = -g -Wall -O2

After:

CFLAGS  = -g -Wall -O2 -I$(NCURSES_INCLUDE_PATH)/ncurses/ -I$(NCURSES_INCLUDE_PATH) -L$(NCURSES_LIB_PATH)
prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]

Populate action_dict with the provided filename, regex, and replacement text.

class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.SetEnvironment(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Configure an install environment. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

handle_environment_variables(install_environment, tool_dependency, env_var_dict, set_prior_environment_commands)[source]

This method works with a combination of three tool dependency definition tag sets, which are defined in the tool_dependencies.xml file in the order discussed here. The example for this discussion is the tool_dependencies.xml file contained in the osra repository, which is available at:

https://testtoolshed.g2.bx.psu.edu/view/bgruening/osra

The first tag set defines a complex repository dependency like this. This tag set ensures that changeset revision XXX of the repository named package_graphicsmagick_1_3 owned by YYY in the tool shed ZZZ has been previously installed:

<tool_dependency>
    <package name="graphicsmagick" version="1.3.18">
        <repository changeset_revision="XXX" name="package_graphicsmagick_1_3" owner="YYY" prior_installation_required="True" toolshed="ZZZ" />
    </package>
    ...

By the way, there is an env.sh file associated with version 1.3.18 of the graphicsmagick package which looks something like this (we’ll reference this file later in this discussion):

GRAPHICSMAGICK_ROOT_DIR=/<my configured tool dependency path>/graphicsmagick/1.3.18/YYY/package_graphicsmagick_1_3/XXX/gmagick;
export GRAPHICSMAGICK_ROOT_DIR

The second tag set defines a specific package dependency that has been previously installed (guaranteed by the tag set discussed above) and compiled, where the compiled dependency is needed by the tool dependency currently being installed (osra version 2.0.0 in this case) and complied in order for its installation and compilation to succeed. This tag set is contained within the <package name=”osra” version=”2.0.0”> tag set, which implies that version 2.0.0 of the osra package requires version 1.3.18 of the graphicsmagick package in order to successfully compile. When this tag set is handled, one of the effects is that the env.sh file associated with graphicsmagick version 1.3.18 is “sourced”, which undoubtedly sets or alters certain environment variables (e.g. PATH, PYTHONPATH, etc):

<!-- populate the environment variables from the dependent repositories -->
<action type="set_environment_for_install">
    <repository changeset_revision="XXX" name="package_graphicsmagick_1_3" owner="YYY" toolshed="ZZZ">
        <package name="graphicsmagick" version="1.3.18" />
    </repository>
</action>

The third tag set enables discovery of the same required package dependency discussed above for correctly compiling the osra version 2.0.0 package, but in this case the package can be discovered at tool execution time. Using the $ENV[] option as shown in this example, the value of the environment variable named GRAPHICSMAGICK_ROOT_DIR (which was set in the environment using the second tag set described above) will be used to automatically alter the env.sh file associated with the osra version 2.0.0 tool dependency when it is installed into Galaxy. * Refer to where we discussed the env.sh file for version 1.3.18 of the graphicsmagick package above:

<action type="set_environment">
    <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$ENV[GRAPHICSMAGICK_ROOT_DIR]/lib/</environment_variable>
    <environment_variable action="prepend_to" name="LD_LIBRARY_PATH">$INSTALL_DIR/potrace/build/lib/</environment_variable>
    <environment_variable action="prepend_to" name="PATH">$INSTALL_DIR/bin</environment_variable>
    <!-- OSRA_DATA_FILES is only used by the galaxy wrapper and is not part of OSRA -->
    <environment_variable action="set_to" name="OSRA_DATA_FILES">$INSTALL_DIR/share</environment_variable>
</action>

The above tag will produce an env.sh file for version 2.0.0 of the osra package when it it installed into Galaxy that looks something like this. Notice that the path to the gmagick binary is included here since it expands the defined $ENV[GRAPHICSMAGICK_ROOT_DIR] value in the above tag set:

LD_LIBRARY_PATH=/<my configured tool dependency path>/graphicsmagick/1.3.18/YYY/package_graphicsmagick_1_3/XXX/gmagick/lib/:$LD_LIBRARY_PATH;
export LD_LIBRARY_PATH
LD_LIBRARY_PATH=/<my configured tool dependency path>/osra/1.4.0/YYY/depends_on/XXX/potrace/build/lib/:$LD_LIBRARY_PATH;
export LD_LIBRARY_PATH
PATH=/<my configured tool dependency path>/osra/1.4.0/YYY/depends_on/XXX/bin:$PATH;
export PATH
OSRA_DATA_FILES=/<my configured tool dependency path>/osra/1.4.0/YYY/depends_on/XXX/share;
export OSRA_DATA_FILES
prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.SetEnvironmentForInstall(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Configure an environment for compiling a package. Since this class is not used in the initial download stage, no recipe step filtering is performed here, and None values are always returned for filtered_actions and dir.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.SetupPerlEnvironment(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download, tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Initialize the environment for installing Perl packages. The class is called during the initial download stage when installing packages, so the value of initial_download will generally be True. However, the parameter value allows this class to also be used in the second stage of the installation, although it may never be necessary. If initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.SetupREnvironment(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download, tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Initialize the environment for installing R packages. The class is called during the initial download stage when installing packages, so the value of initial_download will generally be True. However, the parameter value allows this class to also be used in the second stage of the installation, although it may never be necessary. If initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.SetupRubyEnvironment(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download, tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Initialize the environment for installing Ruby packages. The class is called during the initial download stage when installing packages, so the value of initial_download will generally be True. However, the parameter value allows this class to also be used in the second stage of the installation, although it may never be necessary. If initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.SetupPythonEnvironment(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download, tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Initialize the environment for installing Python packages. The class is called during the initial download stage when installing packages, so the value of initial_download will generally be True. However, the parameter value allows this class to also be used in the second stage of the installation, although it may never be necessary. If initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.SetupVirtualEnv(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.Download, tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Initialize a virtual environment for installing packages. If initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

install_virtualenv(install_environment, venv_dir)[source]
prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.ShellCommand(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Execute a command in a shell. If the value of initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.TemplateCommand(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.step_handler.RecipeStep

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

execute_step(tool_dependency, package_name, actions, action_dict, filtered_actions, env_file_builder, install_environment, work_dir, current_dir=None, initial_download=False)[source]

Execute a template command in a shell. If the value of initial_download is True, the recipe steps will be filtered and returned and the installation directory (i.e., dir) will be defined and returned. If we’re not in the initial download stage, these actions will not occur, and None values will be returned for them.

prepare_step(tool_dependency, action_elem, action_dict, install_environment, is_binary_download)[source]

tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler module

class tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.RecipeTag[source]

Bases: object

Abstract class that defines a standard format for handling recipe tags when installing packages.

process_tag_set(tool_shed_repository, tool_dependency, package_elem, package_name, package_version, from_tool_migration_manager=False, tool_dependency_db_records=None)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.SyncDatabase[source]

Bases: object

sync_database_with_file_system(app, tool_shed_repository, tool_dependency_name, tool_dependency_version, tool_dependency_install_dir, tool_dependency_type='package')[source]

The installation directory defined by the received tool_dependency_install_dir exists, so check for the presence of INSTALLATION_LOG. If the files exists, we’ll assume the tool dependency is installed, but not necessarily successfully (it could be in an error state on disk. However, we can justifiably assume here that no matter the state, an associated database record will exist.

class tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.Install(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.RecipeTag, tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.SyncDatabase

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

process_tag_set(tool_shed_repository, tool_dependency, package_elem, package_name, package_version, from_tool_migration_manager=False, tool_dependency_db_records=None)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.Package(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.RecipeTag

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

process_tag_set(tool_shed_repository, tool_dependency, package_elem, package_name, package_version, from_tool_migration_manager=False, tool_dependency_db_records=None)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.ReadMe(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.RecipeTag

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

process_tag_set(tool_shed_repository, tool_dependency, package_elem, package_name, package_version, from_tool_migration_manager=False, tool_dependency_db_records=None)[source]
class tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.Repository(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.RecipeTag, tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.SyncDatabase

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

create_temporary_tool_dependencies_config(tool_shed_url, name, owner, changeset_revision)[source]

Make a call to the tool shed to get the required repository’s tool_dependencies.xml file.

create_tool_dependency_with_initialized_env_sh_file(dependent_install_dir, tool_shed_repository, required_repository, package_name, package_version, tool_dependencies_config)[source]

Create or get a tool_dependency record that is defined by the received package_name and package_version. An env.sh file will be created for the tool_dependency in the received dependent_install_dir.

get_required_repository_package_env_sh_path(package_name, package_version, required_repository)[source]

Return path to env.sh file in required repository if the required repository has been installed.

handle_complex_repository_dependency_for_package(elem, package_name, package_version, tool_shed_repository, from_tool_migration_manager=False)[source]

Inspect the repository defined by a complex repository dependency definition and take certain steps to enable installation of the received package name and version to proceed. The received elem is the <repository> tag set which defines the complex repository dependency. The received tool_shed_repository is the installed tool shed repository for which the tool dependency defined by the received package_name and package_version is being installed.

process_tag_set(tool_shed_repository, tool_dependency, package_elem, package_name, package_version, from_tool_migration_manager=False, tool_dependency_db_records=None)[source]
remove_file(file_name)[source]

Attempt to remove a file from disk.

class tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.SetEnvironment(app)[source]

Bases: tool_shed.galaxy_install.tool_dependencies.recipe.tag_handler.RecipeTag

__init__(app)[source]

x.__init__(…) initializes x; see help(type(x)) for signature

process_tag_set(tool_shed_repository, tool_dependency, package_elem, package_name, package_version, from_tool_migration_manager=False, tool_dependency_db_records=None)[source]
set_environment(elem, tool_shed_repository, attr_tups_of_dependencies_for_install)[source]

Create a ToolDependency to set an environment variable. This is different from the process used to set an environment variable that is associated with a package. An example entry in a tool_dependencies.xml file is:

<set_environment version="1.0">
    <environment_variable name="R_SCRIPT_PATH" action="set_to">$REPOSITORY_INSTALL_DIR</environment_variable>
</set_environment>
This method must also handle the sub-element tag::
<environment_variable name=”R_SCRIPT_PATH” action=”set_to”>$REPOSITORY_INSTALL_DIR</environment_variable>