comparison env/lib/python3.9/site-packages/galaxy/tool_util/deps/brew_util.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 """ brew_exts defines generic extensions to Homebrew this file
2 builds on those abstraction and provides Galaxy specific functionality
3 not useful to the brew external commands.
4 """
5 from ..deps import brew_exts
6
7 DEFAULT_TAP = "homebrew/science"
8
9
10 class HomebrewRecipe:
11
12 def __init__(self, recipe, version, tap):
13 self.recipe = recipe
14 self.version = version
15 self.tap = tap
16
17
18 def requirements_to_recipes(requirements):
19 return filter(None, map(requirement_to_recipe, requirements))
20
21
22 def requirement_to_recipe(requirement):
23 if requirement.type != "package":
24 return None
25 # TOOD: Allow requirements to annotate optionalbrew specific
26 # adaptions.
27 recipe_name = requirement.name
28 recipe_version = requirement.version
29 return HomebrewRecipe(recipe_name, recipe_version, tap=DEFAULT_TAP)
30
31
32 def requirements_to_recipe_contexts(requirements, brew_context):
33 def to_recipe_context(homebrew_recipe):
34 return brew_exts.RecipeContext(
35 homebrew_recipe.recipe,
36 homebrew_recipe.version,
37 brew_context
38 )
39 return map(to_recipe_context, requirements_to_recipes(requirements))