From a771de4f99b7e0e4fb0b70ffd39817bc94bdf7b3 Mon Sep 17 00:00:00 2001 From: Frederick Muriuki Muriithi Date: Fri, 10 Dec 2021 09:52:38 +0300 Subject: Automate setting of the development GN3 repo * When developing the GN2 code, there are times we need to use the latest code in GN3, and rather than manually editing the `bin/genenetwork` file every time we need that, this commit enables the use of an environment variable. In this case, launching the application with something like: $ env GN3_DEV_REPO_PATH="$HOME/genenetwork3" ...\ ./bin/genenetwork2 ./the_settings.py -gunicorn-dev will add the path to the development version to the PYTHONPATH. If the GN3_DEV_REPO_PATH variable is not set, then the PYTHONPATH is not altered, and would be as if there is no development version of GN3 in use. --- bin/genenetwork2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/genenetwork2 b/bin/genenetwork2 index 024f34d2..e6eb56a6 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -100,6 +100,8 @@ if [ -z $GEMMA_WRAPPER_COMMAND ]; then export GEMMA_WRAPPER_COMMAND="$GN2_PROFILE/bin/gemma-wrapper" fi +export PYTHONPATH="${GN3_DEV_REPO_PATH:+$GN3_DEV_REPO_PATH:}:${PYTHONPATH}" + # Our UNIX TMPDIR defaults to /tmp - change this on a shared server if [ -z $TMPDIR ]; then TMPDIR="/tmp" -- cgit v1.2.3