build (sparkd): Automatically create py venv in build script

This commit is contained in:
John Colvin committed 2023-01-02 18:42:39 -05:00
1 parent 40d21542ae
commit 6b480afd43
2 files changed
+21

No files matched your search

+1
View File
@@ -1,4 +1,5 @@
#!/usr/bin/env bash
tools_path=$(dirname $(readlink -f $0))
eval "$tools_path/ensure_venv.sh" 1> /dev/stdout 2> /dev/stderr
eval "$tools_path/venv_exec.sh python $tools_path/py/build_sparkd.py $@" 1> /dev/stdout 2> /dev/stderr
+20
View File
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
declare tools_dir="$(readlink -f $(dirname ${BASH_SOURCE[0]}))"
declare repo_dir="$tools_dir/.."
declare venv_dir="$repo_dir/.venv"
declare venv_activate_sh="$repo_dir/.venv/bin/activate"
declare requirements_txt="$repo_dir/requirements.txt"
if [[ ! -f "$venv_activate_sh" ]]; then
echo "Creating python virtual environment '.venv'"
python3 -m pip install --upgrade pip
python3 -m venv $venv_dir
source $venv_activate_sh
echo "Upgrading pip"
python -m pip install --upgrade pip
else
source $venv_activate_sh
fi
pip install -q -r $requirements_txt