blob: a046a5d8959309d2cb0f1a375d9ee2ef78e2ecf1 [file] [log] [blame]
David Reid6b609bb2013-11-06 11:44:15 -08001#!/bin/bash
2
3set -e
4set -x
5
Alex Gaynor84d14af2015-02-22 15:33:01 -08006if [[ "$(uname -s)" == 'Darwin' ]]; then
Alex Gaynore6ce9b12015-05-18 16:54:25 -04007 brew update || brew update
Terry Chia3c4a94a2014-10-25 21:03:15 +08008
Terry Chiac69fa6e2014-10-30 10:37:32 +08009 if [[ "${OPENSSL}" != "0.9.8" ]]; then
Alex Gaynor9c346522015-05-18 18:54:26 -040010 brew outdated openssl || brew upgrade openssl
Terry Chia26d3a7c2014-10-26 18:40:01 +080011 fi
Terry Chia3c4a94a2014-10-25 21:03:15 +080012
Alex Gaynor8f6096c2014-09-26 10:05:48 -040013 if which pyenv > /dev/null; then
Terry Chiaad32c362014-10-27 10:23:32 +080014 eval "$(pyenv init -)"
Alex Gaynor8f6096c2014-09-26 10:05:48 -040015 fi
16
Alex Gaynor80b84f52014-12-05 17:44:40 -080017 case "${TOXENV}" in
Terry Chiaf67fcf92014-10-29 10:52:21 +080018 py26)
19 curl -O https://bootstrap.pypa.io/get-pip.py
Paul Kehrere6a52842015-03-26 22:48:53 -050020 python get-pip.py --user
Terry Chiaf67fcf92014-10-29 10:52:21 +080021 ;;
22 py27)
23 curl -O https://bootstrap.pypa.io/get-pip.py
Paul Kehrere6a52842015-03-26 22:48:53 -050024 python get-pip.py --user
Terry Chiaf67fcf92014-10-29 10:52:21 +080025 ;;
Terry Chiaf67fcf92014-10-29 10:52:21 +080026 py33)
Alex Gaynor9c346522015-05-18 18:54:26 -040027 brew outdated pyenv || brew upgrade pyenv
Terry Chiaf67fcf92014-10-29 10:52:21 +080028 pyenv install 3.3.6
29 pyenv global 3.3.6
30 ;;
31 py34)
Alex Gaynor9c346522015-05-18 18:54:26 -040032 brew outdated pyenv || brew upgrade pyenv
Terry Chiaf67fcf92014-10-29 10:52:21 +080033 pyenv install 3.4.2
34 pyenv global 3.4.2
35 ;;
Terry Chiaf67fcf92014-10-29 10:52:21 +080036 pypy)
Alex Gaynor9c346522015-05-18 18:54:26 -040037 brew outdated pyenv || brew upgrade pyenv
Alex Gaynor74b0ea52015-06-02 05:30:41 -040038 pyenv install pypy-2.6.0
39 pyenv global pypy-2.6.0
Terry Chiaf67fcf92014-10-29 10:52:21 +080040 ;;
Paul Kehrerad230672014-12-23 09:43:58 -060041 pypy3)
Alex Gaynor9c346522015-05-18 18:54:26 -040042 brew outdated pyenv || brew upgrade pyenv
Paul Kehrerad230672014-12-23 09:43:58 -060043 pyenv install pypy3-2.4.0
44 pyenv global pypy3-2.4.0
45 ;;
Terry Chiaf67fcf92014-10-29 10:52:21 +080046 docs)
47 curl -O https://bootstrap.pypa.io/get-pip.py
Paul Kehrere6a52842015-03-26 22:48:53 -050048 python get-pip.py --user
Terry Chiaf67fcf92014-10-29 10:52:21 +080049 ;;
Paul Kehrer0b06e552014-01-07 21:41:15 -060050 esac
Terry Chiada157492014-10-26 21:56:21 +080051 pyenv rehash
Alex Gaynor63d95d02015-05-15 07:13:21 -040052 python -m pip install --user virtualenv
Paul Kehrer0b06e552014-01-07 21:41:15 -060053else
Paul Kehrer81f32762015-06-06 22:18:22 -050054 # temporary pyenv installation to get pypy-2.6 before container infra upgrade
55 if [[ "${TOXENV}" == "pypy" ]]; then
56 git clone https://github.com/yyuu/pyenv.git ~/.pyenv
57 PYENV_ROOT="$HOME/.pyenv"
58 PATH="$PYENV_ROOT/bin:$PATH"
59 eval "$(pyenv init -)"
60 pyenv install pypy-2.6.0
61 pyenv global pypy-2.6.0
62 fi
Paul Kehrere6a52842015-03-26 22:48:53 -050063 pip install virtualenv
Paul Kehrer0b06e552014-01-07 21:41:15 -060064fi
65
Paul Kehrere6a52842015-03-26 22:48:53 -050066python -m virtualenv ~/.venv
Paul Kehrer0b06e552014-01-07 21:41:15 -060067source ~/.venv/bin/activate
David Reidf0943932013-11-06 13:47:36 -080068pip install tox coveralls