-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathactivate.sh
More file actions
40 lines (38 loc) · 1.56 KB
/
Copy pathactivate.sh
File metadata and controls
40 lines (38 loc) · 1.56 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# Activate the Python environment that has PyAutoCTI installed.
#
# Most users just `pip install autocti` (see the ac_setup_environment skill) into a
# virtual environment. By default this looks for a `.venv` created inside the project
# (what ac_setup_environment makes); edit VENV to point elsewhere, e.g. ~/venv/PyAuto.
#
# Resolving relative to this file (not the current directory) means it works both for a
# local `source activate.sh` and for the HPC scripts' `source $PROJECT_PATH/activate.sh`.
HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VENV=$HERE/.venv
if [ -f "$VENV/bin/activate" ]; then
source "$VENV/bin/activate"
elif [ -n "${PYAUTO_HPC_BASE:-}" ] && [ -f "$PYAUTO_HPC_BASE/PyAuto/bin/activate" ]; then
# Shared / HPC checkout: point PYAUTO_HPC_BASE at the directory that holds a
# `PyAuto/` virtualenv alongside editable PyAuto* source checkouts, e.g.
# export PYAUTO_HPC_BASE=/path/to/your/PyAuto
BASE="$PYAUTO_HPC_BASE"
source "$BASE/PyAuto/bin/activate"
export PYTHONPATH=$BASE:\
$BASE/PyAutoNerves:\
$BASE/PyAutoFit:\
$BASE/PyAutoArray:\
$BASE/PyAutoGalaxy:\
$BASE/PyAutoCTI
else
echo "No local .venv found (set PYAUTO_HPC_BASE for a shared/HPC PyAuto checkout)." >&2
fi
# Developer setup only: if you run against editable source checkouts of the PyAuto*
# libraries instead of a pip install, drop the line above and add their parent directory
# to PYTHONPATH, e.g.:
#
# SRC=~/Code/PyAutoLabs
# export PYTHONPATH=$SRC:\
# $SRC/PyAutoNerves:\
# $SRC/PyAutoFit:\
# $SRC/PyAutoArray:\
# $SRC/PyAutoGalaxy:\
# $SRC/PyAutoCTI