-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup-devenv.sh
More file actions
executable file
·56 lines (41 loc) · 1.6 KB
/
setup-devenv.sh
File metadata and controls
executable file
·56 lines (41 loc) · 1.6 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#!/bin/bash
# This script serves as a reference for how to set up a developer environment.
# Some packages, like GDAL, must be installed prior to running this script.
# On Ubuntu these packages are likely installed via '$ apt' or '$ apt-get',
# and on MacOS Homebrew is a common choice. Developers should read through
# this script, and the other scripts it invokes, and determine if it is
# appropriate to execute for their environment. At a high-level the steps
# should be matched, but the specific commands may need to be modified.
set -x
set -o errexit
set -o pipefail
set -o nounset
VENV_PATH="venv"
# Do not attempt to modify an existing virtual environment. We do not know what
# it contains.
if [ -d "${VENV_PATH}" ]; then
echo "Virtual environment already exists: ${VENV_PATH}"
exit 0
fi
# Create virtual environment.
python3 -m venv "${VENV_PATH}"
# Activate virtual environment. SUPER CRITICAL that this activation happens.
# Some shell scripts assume they are in an isolated environment.
source "${VENV_PATH}/bin/activate"
if [ "${VIRTUAL_ENV}" == "" ]; then
echo "ERROR: Virtual environment did not activate: ${VENV_PATH}"
exit 1
fi
# Useful for debugging
which python3
python3 --version
# Install and upgrade packaging dependencies. The presence of 'wheel' triggers
# a lot of the emerging Python packaging ecosystem changes (PEP-517).
python3 -m pip install setuptools wheel --upgrade
# Install ISOFIT.
python3 -m pip install -e ".[dev]"
# Install commit hooks.
python3 -m pre_commit install
# Download and unpack additional dependencies.
./download-and-unpack-sRTMnet.sh
./download-and-build-6s.sh