Mercurial > repos > shellac > guppy_basecaller
comparison env/lib/python3.7/site-packages/planemo/commands/cmd_serve.py @ 0:26e78fe6e8c4 draft
"planemo upload commit c699937486c35866861690329de38ec1a5d9f783"
| author | shellac |
|---|---|
| date | Sat, 02 May 2020 07:14:21 -0400 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| -1:000000000000 | 0:26e78fe6e8c4 |
|---|---|
| 1 """Module describing the planemo ``serve`` command.""" | |
| 2 import click | |
| 3 | |
| 4 from planemo import options | |
| 5 from planemo.cli import command_function | |
| 6 from planemo.galaxy import galaxy_serve | |
| 7 from planemo.runnable import for_paths | |
| 8 from planemo.tools import uris_to_paths | |
| 9 | |
| 10 | |
| 11 @click.command('serve') | |
| 12 @options.optional_tools_arg(multiple=True, allow_uris=True) | |
| 13 @options.galaxy_serve_options() | |
| 14 @options.enable_cwl_option() | |
| 15 @options.galaxy_cwl_root_option() | |
| 16 @command_function | |
| 17 def cli(ctx, uris, **kwds): | |
| 18 """Launch Galaxy instance with specified tools. | |
| 19 | |
| 20 The Galaxy tool panel will include just the referenced tool or tools (by | |
| 21 default all the tools in the current working directory) and the upload | |
| 22 tool. | |
| 23 | |
| 24 planemo will search parent directories to see if any is a Galaxy instance | |
| 25 - but one can pick the Galaxy instance to use with the ``--galaxy_root`` | |
| 26 option or force planemo to download a disposable instance with the | |
| 27 ``--install_galaxy`` flag. | |
| 28 | |
| 29 ``planemo`` will run the Galaxy instance in an existing virtualenv if one | |
| 30 exists in a ``.venv`` directory in the specified ``--galaxy_root``. | |
| 31 Otherwise, the Galaxy instance will run in a clean virtualenv created in | |
| 32 ``/tmp``. | |
| 33 | |
| 34 ``planemo`` uses temporarily generated config files and environment | |
| 35 variables to attempt to shield this execution of Galaxy from manually | |
| 36 launched runs against that same Galaxy root - but this may not be bullet | |
| 37 proof yet, so please be careful and do not try this against a production | |
| 38 Galaxy instance. | |
| 39 """ | |
| 40 paths = uris_to_paths(ctx, uris) | |
| 41 runnables = for_paths(paths) | |
| 42 kwds['galaxy_skip_client_build'] = False | |
| 43 galaxy_serve(ctx, runnables, **kwds) |
