comparison env/lib/python3.7/site-packages/planemo/commands/cmd_brew.py @ 5:9b1c78e6ba9c draft default tip

"planemo upload commit 6c0a8142489327ece472c84e558c47da711a9142"
author shellac
date Mon, 01 Jun 2020 08:59:25 -0400
parents 79f47841a781
children
comparison
equal deleted inserted replaced
4:79f47841a781 5:9b1c78e6ba9c
1 """Module describing the planemo ``brew`` command."""
2 import click
3 from galaxy.tool_util.deps import (
4 brew_exts,
5 brew_util,
6 )
7 from galaxy.tool_util.deps.requirements import parse_requirements_from_xml
8 from galaxy.tool_util.loader_directory import load_tool_elements_from_path
9 from galaxy.util import bunch
10
11 from planemo import options
12 from planemo.cli import command_function
13
14
15 @click.command('brew')
16 @options.optional_tools_arg()
17 @options.brew_option()
18 @command_function
19 def cli(ctx, path, brew=None):
20 """Install tool requirements using brew.
21
22 An experimental approach to versioning brew recipes will be used.
23 See full discussion on the homebrew-science issues page here -
24 https://github.com/Homebrew/homebrew-science/issues/1191. Information
25 on the implementation can be found at
26 https://github.com/jmchilton/platform-brew
27 until a more permanent project home is setup.
28 """
29 for (tool_path, tool_xml) in load_tool_elements_from_path(path):
30 ctx.log('Brewing requirements from tool %s',
31 click.format_filename(tool_path))
32 mock_args = bunch.Bunch(brew=brew)
33 brew_context = brew_exts.BrewContext(mock_args)
34 requirements, containers = parse_requirements_from_xml(tool_xml)
35
36 for recipe_context in brew_util.requirements_to_recipe_contexts(
37 requirements,
38 brew_context
39 ):
40 brew_exts.versioned_install(recipe_context)