-
Notifications
You must be signed in to change notification settings - Fork 2
/
install
executable file
·42 lines (33 loc) · 1.31 KB
/
install
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
#!/bin/bash -e
cd $(dirname $0)
# Compatibility logic for older Anaconda versions.
if [ "${CONDA_EXE} " == " " ]; then
CONDA_EXE=$((find /opt/conda/bin/conda || find ~/anaconda3/bin/conda || find /usr/local/anaconda3/bin/conda || find ~/miniconda3/bin/conda || find /root/miniconda/bin/conda) 2>/dev/null)
fi
if [ "${CONDA_EXE}_" == "_" ]; then
echo "Please install Anaconda w/ Python 3.7+ first"
echo "See: https://www.anaconda.com/distribution/"
exit 1
fi
if ! $(conda env export -n base | grep -q conda-build); then
conda install -n base -y conda-build
fi
PROJECT="$(grep "^name" environment.yml | cut -d' ' -f2)"
CONDA_BIN=$(dirname ${CONDA_EXE})
ENV_FILE=environment.yml
if conda env list | egrep -qe "^$PROJECT"; then
conda env update -f $ENV_FILE
else
conda env create -f $ENV_FILE
fi
# Add the project directory to module search paths.
source "${CONDA_BIN}/activate" $PROJECT
conda develop .
pre-commit install
# We also need dephell to convert pyproject.toml -> setup.py
if ! which dephell >/dev/null 2>&1; then
echo "dephell is not installed! We need it to convert pyproject.toml -> setup.py."
echo "See https://dephell.readthedocs.io/installation.html"
echo "Hint: to install system-wide, run: 'curl -L https://dephell.org/install | python3'"
echo "Audit install script first!"
fi