blob: 1baae5ba987ef383350885c5529dbc2861f92c60 [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
Terry Chia9f385402014-10-27 10:38:44 +080010 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)
27 brew upgrade pyenv
28 pyenv install 3.3.6
29 pyenv global 3.3.6
30 ;;
31 py34)
32 brew upgrade pyenv
33 pyenv install 3.4.2
34 pyenv global 3.4.2
35 ;;
Terry Chiaf67fcf92014-10-29 10:52:21 +080036 pypy)
37 brew upgrade pyenv
Alex Gaynorf7234492015-03-27 23:39:06 -040038 pyenv install pypy-2.5.1
39 pyenv global pypy-2.5.1
Terry Chiaf67fcf92014-10-29 10:52:21 +080040 ;;
Paul Kehrerad230672014-12-23 09:43:58 -060041 pypy3)
42 brew upgrade pyenv
43 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 Kehrere6a52842015-03-26 22:48:53 -050054 pip install virtualenv
Paul Kehrer0b06e552014-01-07 21:41:15 -060055fi
56
Paul Kehrere6a52842015-03-26 22:48:53 -050057python -m virtualenv ~/.venv
Paul Kehrer0b06e552014-01-07 21:41:15 -060058source ~/.venv/bin/activate
David Reidf0943932013-11-06 13:47:36 -080059pip install tox coveralls