Skip to content

Commit

Permalink
add OS X to travis configs (#71)
Browse files Browse the repository at this point in the history
* add OS X (no wait, mac OS) to travis configs

* pypy and pyenv are not the same thing
  • Loading branch information
reaperhulk authored and alex committed Jun 23, 2016
1 parent bc07352 commit 2cc7112
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 5 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Expand Up @@ -32,6 +32,14 @@ matrix:
env: TOXENV=pep8
- python: 3.5
env: TOXENV=py3pep8
- language: generic
os: osx
osx_image: xcode7.3
env: TOXENV=py27
- language: generic
os: osx
osx_image: xcode7.3
env: TOXENV=py35

install: .travis/install.sh

Expand Down
29 changes: 26 additions & 3 deletions .travis/install.sh
Expand Up @@ -3,13 +3,36 @@
set -e
set -x

if [[ "${TOXENV}" == "pypy" ]]; then
install_pyenv () {
git clone https://github.com/yyuu/pyenv.git ~/.pyenv
PYENV_ROOT="$HOME/.pyenv"
PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
pyenv install pypy-2.6.0
pyenv global pypy-2.6.0
}

if [[ "$(uname -s)" == 'Darwin' ]]; then
install_pyenv
case "${TOXENV}" in
py27)
curl -O https://bootstrap.pypa.io/get-pip.py
python get-pip.py --user
;;
py35)
pyenv install 3.5.1
pyenv global 3.5.1
;;
esac
pyenv rehash
python -m pip install --user virtualenv
else
if [[ "${TOXENV}" == "pypy" ]]; then
install_pyenv
pyenv install pypy-2.6.0
pyenv global pypy-2.6.0
fi
pip install virtualenv
fi

python -m virtualenv ~/.venv
source ~/.venv/bin/activate
pip install tox
13 changes: 11 additions & 2 deletions .travis/run.sh
Expand Up @@ -3,11 +3,20 @@
set -e
set -x

if [[ "${TOXENV}" == "pypy" ]]; then
init_pyenv () {
PYENV_ROOT="$HOME/.pyenv"
PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
pyenv global pypy-2.6.0
}

if [[ "$(uname -s)" == "Darwin" ]]; then
init_pyenv
else
if [[ "${TOXENV}" == "pypy" ]]; then
init_pyenv
pyenv global pypy-2.6.0
fi
fi

source ~/.venv/bin/activate
tox

0 comments on commit 2cc7112

Please sign in to comment.