-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #213 from jmchilton/shed_install
Implement shed serve and test commands, other enhancements.
- Loading branch information
Showing
30 changed files
with
759 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
""" | ||
""" | ||
import time | ||
import click | ||
|
||
from planemo.cli import pass_context | ||
from planemo import options | ||
from planemo import galaxy_serve | ||
from planemo import shed | ||
from planemo import io | ||
|
||
|
||
@click.command("shed_serve") | ||
@options.shed_read_options() | ||
@options.galaxy_run_options() | ||
@click.option( | ||
"--skip_dependencies", | ||
is_flag=True, | ||
help="Do not install shed dependencies as part of repository installation." | ||
) | ||
@pass_context | ||
def cli(ctx, paths, **kwds): | ||
""" Serve a transient Galaxy instance after installing repositories | ||
from a remote Tool Shed. | ||
""" | ||
install_args_list = shed.install_arg_lists(ctx, paths, **kwds) | ||
with galaxy_serve.shed_serve(ctx, install_args_list, **kwds) as config: | ||
gx_url = "http://localhost:%d/" % config.port | ||
io.info("Galaxy running with tools installed at %s" % gx_url) | ||
time.sleep(1000000) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
""" | ||
""" | ||
import socket | ||
import sys | ||
|
||
import click | ||
|
||
from planemo.cli import pass_context | ||
from planemo import options | ||
from planemo import galaxy_serve | ||
from planemo import shed | ||
from planemo import galaxy_test | ||
|
||
|
||
@click.command("shed_test") | ||
@options.shed_read_options() | ||
@options.galaxy_target_options() | ||
@options.test_options() | ||
@click.option( | ||
"--skip_dependencies", | ||
is_flag=True, | ||
help="Do not install shed dependencies as part of repository installation." | ||
) | ||
@pass_context | ||
def cli(ctx, paths, **kwds): | ||
""" Serve a transient Galaxy instance after installing repositories | ||
from a remote Tool Shed. | ||
""" | ||
galaxy_test.process_defaults(ctx, kwds) | ||
install_args_list = shed.install_arg_lists(ctx, paths, **kwds) | ||
port = get_free_port() | ||
kwds["port"] = port | ||
return_code = 1 | ||
with galaxy_serve.shed_serve(ctx, install_args_list, **kwds) as config: | ||
config.kill() | ||
return_code = galaxy_test.run_in_config( | ||
ctx, | ||
config, | ||
installed=True, | ||
**kwds | ||
) | ||
if return_code: | ||
sys.exit(return_code) | ||
|
||
|
||
def get_free_port(): | ||
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | ||
sock.bind(('localhost', 0)) | ||
port = sock.getsockname()[1] | ||
sock.close() | ||
return port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.