Skip to content

Commit 9f3957d

Browse files
committed
Add --skip_venv flag for conda, other cases.
Fixes #377 ... or makes it possible to fix it anyway. To preserve conda's environment for test execution run planemo, first install Galaxy's depndencies into the conda environment using: % cd $GALAXY_ROOT % pip install requirements.txt % pip install -r lib/galaxy/dependencies/dev-requirements.txt Then run planemo test, serve, etc... with the --skip_venv flag. % planemo test --skip_venv .
1 parent cd7cabc commit 9f3957d

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

planemo/galaxy_run.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,9 @@
3333

3434

3535
def setup_venv(ctx, kwds):
36+
if kwds.get("skip_venv", False):
37+
return ""
38+
3639
create_template_params = {
3740
'create_virtualenv': create_command("$GALAXY_VIRTUAL_ENV")
3841
}
@@ -67,7 +70,7 @@ def shell_if_wheels(command):
6770

6871
def setup_common_startup_args():
6972
return set_variable_if_wheels(
70-
"COMMON_STARTUP_ARGS", "--skip-venv --dev-wheels"
73+
"COMMON_STARTUP_ARGS", "--dev-wheels"
7174
)
7275

7376

planemo/galaxy_serve.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,6 @@ def serve(ctx, paths, **kwds):
1717

1818
with galaxy_config.galaxy_config(ctx, paths, **kwds) as config:
1919
# TODO: Allow running dockerized Galaxy here instead.
20-
setup_common_startup_args = galaxy_run.set_variable_if_wheels(
21-
"COMMON_STARTUP_ARGS", "--skip-venv"
22-
)
2320
setup_venv_command = galaxy_run.setup_venv(ctx, kwds)
2421
run_script = os.path.join(config.galaxy_root, "run.sh")
2522
run_script += " $COMMON_STARTUP_ARGS"
@@ -33,7 +30,6 @@ def serve(ctx, paths, **kwds):
3330
cd_to_galaxy_command = "cd %s" % config.galaxy_root
3431
cmd = io.shell_join(
3532
cd_to_galaxy_command,
36-
setup_common_startup_args,
3733
setup_venv_command,
3834
run_script,
3935
)

planemo/options.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ def force_option(what="files"):
1818
)
1919

2020

21+
def skip_venv_option():
22+
return click.option(
23+
"--skip_venv",
24+
is_flag=True,
25+
help=("Do not create or source a virtualenv environment for Galaxy, "
26+
"this should be used or instance to preserve an externally "
27+
"configured virtual environment or conda environment.")
28+
)
29+
30+
2131
def test_data_option():
2232
return click.option(
2333
"--test_data",
@@ -643,6 +653,7 @@ def galaxy_target_options():
643653
install_galaxy_option(),
644654
galaxy_branch_option(),
645655
galaxy_source_option(),
656+
skip_venv_option(),
646657
no_cache_galaxy_option(),
647658
no_cleanup_option(),
648659
job_config_option(),

0 commit comments

Comments
 (0)