Warning
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.tool_util.deps.brew_util
""" brew_exts defines generic extensions to Homebrew this file
builds on those abstraction and provides Galaxy specific functionality
not useful to the brew external commands.
"""
from ..deps import brew_exts
DEFAULT_TAP = "homebrew/science"
[docs]class HomebrewRecipe:
[docs] def __init__(self, recipe, version, tap):
self.recipe = recipe
self.version = version
self.tap = tap
[docs]def requirements_to_recipes(requirements):
return filter(None, map(requirement_to_recipe, requirements))
[docs]def requirement_to_recipe(requirement):
if requirement.type != "package":
return None
# TOOD: Allow requirements to annotate optionalbrew specific
# adaptions.
recipe_name = requirement.name
recipe_version = requirement.version
return HomebrewRecipe(recipe_name, recipe_version, tap=DEFAULT_TAP)
[docs]def requirements_to_recipe_contexts(requirements, brew_context):
def to_recipe_context(homebrew_recipe):
return brew_exts.RecipeContext(homebrew_recipe.recipe, homebrew_recipe.version, brew_context)
return map(to_recipe_context, requirements_to_recipes(requirements))