-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup_ci.sh
executable file
·39 lines (32 loc) · 1010 Bytes
/
setup_ci.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
#!/bin/bash -e
# Set up an environment to run tests under Travis CI (see toplevel .travis.yml)
# or GitHub Actions (see toplevel .github/workflows/build.yml)
if [ $# -ne 2 ]; then
echo "Usage: $0 imp_branch python_version"
exit 1
fi
imp_branch=$1
python_version=$2
# get conda-forge, not main, packages
conda config --remove channels defaults
conda config --add channels conda-forge
if [ ${imp_branch} = "develop" ]; then
IMP_CONDA="imp-nightly"
else
IMP_CONDA="imp"
fi
if [ ${python_version} = "2.7" ]; then
pip="pip<=19.3.1"
else
pip="pip"
fi
conda create --yes -q -n python${python_version} -c salilab python=${python_version} scipy matplotlib ${pip} ${IMP_CONDA}
eval "$(conda shell.bash hook)"
conda activate python${python_version}
if [ ${python_version} = "2.7" ]; then
# pytest-flake8 1.1.0 tries to import contextlib.redirect_stdout, which
# isn't present in Python 2
pip install pytest-cov coverage 'pytest-flake8<1.1'
else
pip install pytest-cov coverage pytest-flake8
fi