sudo: false

language: python

env:
    - TOX_ENV=py27
    - TOX_ENV=py33
    - TOX_ENV=py34
    - TOX_ENV=pypy
    - TOX_ENV=pypy3
    - TOX_ENV=cover
    - TOX_ENV=flake8
    - TOX_ENV=docs

matrix:
    include:
        # Python 3.5 needs to be explicitly requested with python: for now.
        # See travis-ci/travis-ci#4794 and travis-ci/travis-ci#521.
        - python: 3.5
          env:
              - TOX_ENV=py35


install:
    - pip install tox
    - pip install cython
script:
    - tox -e $TOX_ENV

sudo: false

language: python

env:
    - TOX_ENV=py27
    - TOX_ENV=py33
    - TOX_ENV=py34
    - TOX_ENV=pypy
    - TOX_ENV=pypy3
    - TOX_ENV=cover
    - TOX_ENV=flake8
    - TOX_ENV=docs

matrix:
    include:
        # Python 3.5 needs to be explicitly requested with python: for now.
        # See travis-ci/travis-ci#4794 and travis-ci/travis-ci#521.
        - python: 3.5
          env:
              - TOX_ENV=py35


install:
    - pip install tox
    - pip install cython
    - |
        # If we're testing pypy on Travis, make sure to get a newer version of
        # PyPy since Travis uses 2.5.
        #
        # Adapted from https://github.com/travis-ci/travis-ci/issues/5027#issuecomment-170939193
        if [ "$TOX_ENV" = "pypy" ]; then
            export PYENV_ROOT="$HOME/.pyenv"
            if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
                cd "$PYENV_ROOT" && git pull
            else
                rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT"
            fi
            export PYPY_VERSION="4.0.1"
            "$PYENV_ROOT/bin/pyenv" install "pypy-$PYPY_VERSION"
            export PATH="$PYENV_ROOT/versions/pypy-$PYPY_VERSION/bin:$PATH"
        fi
script:
    - tox -e $TOX_ENV

Install newer PyPy on Travis
Install newer PyPy on Travis
