Debian Codegraph @

script/setup

raw symbols SCIP
1 #!/usr/bin/env bash
2 set -eo pipefail
3
4 # Directory of *this* script
5 this_dir="$( cd "$( dirname "$0" )" && pwd )"
6
7 # Base directory of repo
8 base_dir="$(realpath "${this_dir}/..")"
9
10 # Path to virtual environment
11 : "${venv:=${base_dir}/venv}"
12
13 # Python binary to use
14 : "${PYTHON=python3}"
15
16 python_version="$(${PYTHON} --version)"
17
18 # Create virtual environment
19 if [ ! -n "$DEVCONTAINER" ] && [ ! -n "$CI" ]; then
20 echo "Creating virtual environment at ${venv} (${python_version})"
21 rm -rf "${venv}"
22 "${PYTHON}" -m venv "${venv}"
23 source "${venv}/bin/activate"
24 fi
25
26
27 # Install Python dependencies
28 echo 'Installing Python dependencies'
29 pip3 install --upgrade pip
30 pip3 install --upgrade wheel setuptools
31
32 pip3 install -e "${base_dir}[dev]"
33
34 # -----------------------------------------------------------------------------
35
36 echo "OK"