From c0d4de52e28135b002ab18ff59ac0fb6fd827a4f 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 0a2c18cf..1b933e80 100755 --- a/bin/genenetwork2 +++ b/bin/genenetwork2 @@ -149,6 +149,8 @@ fi # We may change this one: export PYTHONPATH=$PYTHON_GN_PATH:$GN2_BASE_DIR/wqflask:$GN3_PYTHONPATH:$PYTHONPATH +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