Skip to content

Commit

Permalink
Run Travis CI tests in OS X based environment (PR #26)
Browse files Browse the repository at this point in the history
* PoC of running tests under MacOS
* reusable YAML anchors reduce config duplication dramatically
* completely pyenv based python installations
  • Loading branch information
webknjaz committed May 2, 2017
2 parents f51c709 + 1fc31ef commit ef8b31b
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 30 deletions.
104 changes: 86 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@ python:
- 3.6
- nightly
_base_envs:
- &pypy_base
python: pypy
env:
- PYPY_VERSION=pypy2-5.7.1
- PYENV_ROOT="$HOME/.pyenv"
- PATH="$PYENV_ROOT/bin:$PATH"
- &linux_base
os: linux
dist: trusty
sudo: required
addons:
Expand All @@ -34,8 +30,14 @@ _base_envs:
- libncursesw5-dev
- xz-utils
- tk-dev
- &pyenv_base
python: pypy
env:
- PYTHON_VERSION=pypy2-5.7.1
- &env_pyenv PYENV_ROOT="$HOME/.pyenv"
- &env_path PATH="$PYENV_ROOT/bin:$PATH"
before_install:
- |
- &ensure_pyenv_installed |
if [ -f "$PYENV_ROOT/bin/pyenv" ]
then
eval "$(pyenv init -)"
Expand All @@ -47,26 +49,91 @@ _base_envs:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
- pyenv install --skip-existing --keep --verbose "$PYPY_VERSION"
- pyenv shell "$PYPY_VERSION"
- python --version
- &install_python pyenv install --skip-existing --keep --verbose "$PYTHON_VERSION"
- &switch_python pyenv shell "$PYTHON_VERSION"
- &python_version python --version
- &linux_python_base
<<: *linux_base
<<: *pyenv_base
- &osx_python_base
<<: *pyenv_base
os: osx
language: generic
before_install:
- brew update
- brew install readline xz
- *ensure_pyenv_installed
- *install_python
- *switch_python
- *python_version
before_cache:
- brew --cache
matrix:
fast_finish: true
allow_failures:
- env: TOXENV=pre-commit-pep257
include:
- <<: *pypy_base
- <<: *linux_python_base
python: pypy
env:
- PYPY_VERSION=pypy2-5.7.1
- PYENV_ROOT="$HOME/.pyenv"
- PATH="$PYENV_ROOT/bin:$PATH"
- <<: *pypy_base
- PYTHON_VERSION=pypy2-5.7.1
- *env_pyenv
- *env_path
- <<: *linux_python_base
python: pypy3
env:
- PYPY_VERSION=pypy3.5-5.7.1-beta
- PYENV_ROOT="$HOME/.pyenv"
- PATH="$PYENV_ROOT/bin:$PATH"
- PYTHON_VERSION=pypy3.5-5.7.1-beta
- *env_pyenv
- *env_path
- <<: *osx_python_base
python: 2.6
env:
- PYTHON_VERSION=2.6.9
- *env_pyenv
- *env_path
- <<: *osx_python_base
python: 2.7
env:
- PYTHON_VERSION=2.7.13
- *env_pyenv
- *env_path
- <<: *osx_python_base
python: 3.3
env:
- PYTHON_VERSION=3.3.6
- *env_pyenv
- *env_path
- <<: *osx_python_base
python: 3.4
env:
- PYTHON_VERSION=3.4.6
- *env_pyenv
- *env_path
- <<: *osx_python_base
python: 3.5
env:
- PYTHON_VERSION=3.5.3
- *env_pyenv
- *env_path
- <<: *osx_python_base
python: 3.6
env:
- PYTHON_VERSION=3.6.1
- *env_pyenv
- *env_path
- <<: *osx_python_base
python: nightly
env:
- PYTHON_VERSION=3.7-dev
- *env_pyenv
- *env_path
- <<: *osx_python_base
python: pypy2-5.7.1
env:
- PYTHON_VERSION=pypy2-5.7.1
- *env_pyenv
- *env_path
# pypy3.5-5.7.1-beta fails under OS X because it's unsupported (PR #26)
- python: 3.6
env: TOXENV=pre-commit
- python: 3.6
Expand All @@ -75,6 +142,7 @@ cache:
pip: true
directories:
- $HOME/.pre-commit
- $HOME/Library/Caches/Homebrew
before_install:
- "if [[ $TRAVIS_PYTHON_VERSION == 'pypy3' ]]; then . .travis/replace-pypy3 ; fi"
install:
Expand Down
12 changes: 0 additions & 12 deletions .travis/replace-pypy3

This file was deleted.

0 comments on commit ef8b31b

Please sign in to comment.