From 2cc711262fc0353efcbe6f7b4d855fe3bd404c10 Mon Sep 17 00:00:00 2001 From: Paul Kehrer Date: Wed, 22 Jun 2016 20:32:40 -0500 Subject: [PATCH] add OS X to travis configs (#71) * add OS X (no wait, mac OS) to travis configs * pypy and pyenv are not the same thing --- .travis.yml | 8 ++++++++ .travis/install.sh | 29 ++++++++++++++++++++++++++--- .travis/run.sh | 13 +++++++++++-- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1656377f..456aba7c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/.travis/install.sh b/.travis/install.sh index c37edaae..551241c7 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -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 diff --git a/.travis/run.sh b/.travis/run.sh index 40a07509..06117978 100755 --- a/.travis/run.sh +++ b/.travis/run.sh @@ -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