-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure-cpu.sh
executable file
·50 lines (36 loc) · 1.21 KB
/
configure-cpu.sh
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
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env bash
# get script dir
script_dir=$( cd `dirname ${BASH_SOURCE[0]}` >/dev/null 2>&1 ; pwd -P )
pushd $script_dir > /dev/null
# git
git config filter.remove-notebook-output.clean 'jupyter nbconvert --clear-output --to=notebook --stdin --stdout --log-level=ERROR'
# C Libraries
# needed to run / debug with mod_spatialite
# also configure same path in .env (which is used by pytest):
export LD_LIBRARY_PATH=/usr/local/lib
echo "LD_LIBRARY_PATH=/usr/local/lib" > .env
echo "Python ..."
# Do not install Python if in Anaconda environment or we are on Docker container
if [[ -z "$CONDA_DEFAULT_ENV" && ! -f /.dockerenv ]]
then
# install Python 3.11.0 if not installed
pyenv install 3.11.0 --skip-existing
pyenv versions
# use Python 3 from .python-version for local development
eval "$(pyenv init -)"
fi
# create virtual environment
python3 -m venv .venv
# activate virtual environment
source .venv/bin/activate
# upgrade pip
pip install --upgrade wheel
pip install --upgrade pip
# install development and runtime packages
pip install -r dev/requirements.txt
pip install -r requirements-cpu.txt
# directories
mkdir -p ./book/data
mkdir -p ./book/models
mkdir -p ./book/scripts
popd > /dev/null