forked from conda/conda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
travis-bootstrap-conda.sh
56 lines (45 loc) · 1.78 KB
/
travis-bootstrap-conda.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
51
52
53
54
55
56
#!/bin/bash
# NOTE: this script should be sourced instead of executed
travis_build_and_upload() {
if [[ "$TRAVIS_BRANCH" == master && "$TRAVIS_PULL_REQUEST" == false ]]; then
set -e
conda install -y conda-build anaconda-client
conda build --python $PY_VERSION conda.recipe | tee build.log
local tarball="$(grep 'anaconda upload' build.log | tail -1 | cut -d' ' -f5)"
echo "uploading..."
echo " > anaconda upload --user conda --label dev $tarball"
anaconda --token $ANACONDA_TOKEN upload --user conda --label dev "$tarball"
fi
}
travis_bootstrap_conda() {
local py_major=${PY_VERSION:0:1}
if ! [[ -d $HOME/miniconda ]]; then
declare miniconda_url
case "$(uname -s | tr '[:upper:]' '[:lower:]')" in
linux) miniconda_url="https://repo.anaconda.com/miniconda/Miniconda${py_major}-latest-Linux-x86_64.sh";;
darwin) miniconda_url="https://repo.anaconda.com/miniconda/Miniconda${py_major}-latest-MacOSX-x86_64.sh";;
esac
curl -sS -o miniconda.sh "$miniconda_url"
bash miniconda.sh -bfp $HOME/miniconda
rm -rf miniconda.sh
fi
export PATH="$HOME/miniconda/bin:$PATH"
hash -r
conda config --set always_yes yes
conda update -q conda
# TODO: on hold until we get virtualenvs working
# declare python_version
# case "$TOXENV" in
# py27) python_version="2.7";;
# py33) python_version="3.3";;
# py34) python_version="3.4";;
# py35) python_version="3.5";;
# *) python_version="3.5";;
# esac
# conda create -q -n test-environment python="$python_version" setuptools pip virtualenv
# source activate test-environment
conda info --all
conda list
rvm get head
}
travis_bootstrap_conda