From 985bd0dffd779b55813f6dc1c6bae663e959bd9c Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Wed, 16 Nov 2016 11:41:13 -0500 Subject: [PATCH] Because common_startup is executed and not sourced, this block needs to remain in run.sh --- run.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/run.sh b/run.sh index eb250800cdf..039047a87b8 100755 --- a/run.sh +++ b/run.sh @@ -60,6 +60,16 @@ done ./scripts/common_startup.sh $common_startup_args || exit 1 +# If there is a .venv/ directory, assume it contains a virtualenv that we +# should run this instance in. +GALAXY_VIRTUAL_ENV="${GALAXY_VIRTUAL_ENV:-.venv}" +if [ -d "$GALAXY_VIRTUAL_ENV" -a -z "$skip_venv" ]; +then + [ -n "$PYTHONPATH" ] && { echo 'Unsetting $PYTHONPATH'; unset PYTHONPATH; } + echo "Activating virtualenv at $GALAXY_VIRTUAL_ENV" + . "$GALAXY_VIRTUAL_ENV/bin/activate" +fi + # If you are using --skip-venv we assume you know what you are doing but warn # in case you don't. [ -n "$PYTHONPATH" ] && echo 'WARNING: $PYTHONPATH is set, this can cause problems importing Galaxy dependencies'