-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
34 lines (27 loc) · 699 Bytes
/
setup.sh
File metadata and controls
34 lines (27 loc) · 699 Bytes
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
#!/usr/bin/env bash
set -euo pipefail
# Setup local development environment for ClimateDataFetcher.
# Usage:
# bash setup.sh
# bash setup.sh --with-geotiff
WITH_GEOTIFF=0
if [[ "${1:-}" == "--with-geotiff" ]]; then
WITH_GEOTIFF=1
fi
if command -v python3 >/dev/null 2>&1; then
PYTHON=python3
elif command -v python >/dev/null 2>&1; then
PYTHON=python
else
echo "Error: Python was not found in PATH."
exit 1
fi
echo "Creating virtual environment at .venv"
"$PYTHON" -m venv .venv
source .venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -e ".[dev]"
if [[ "$WITH_GEOTIFF" -eq 1 ]]; then
python -m pip install -e ".[geotiff]"
fi
echo "Setup complete."