language: "python"
sudo: false
dist: trusty
cache:
  directories:
    - $HOME/.cache/pip

branches:
  only:
    - master

env:
  - TOXENV=py27-twlatest
  - TOXENV=py27-twtrunk
  - TOXENV=py27-twlowest
  - TOXENV=pypy-twlatest
  - TOXENV=pypy-twtrunk
  - TOXENV=pypy-twlowest
  # Test inplace on one variant
  - TOXENV=py27-twlatest DEVELOP=--develop

matrix:
  allow_failures:
    - env: TOXENV=py27-twtrunk
    - env: TOXENV=pypy-twtrunk

install:
  # Install a newer PyPy version
  - |
    if [ "${TOXENV::5}" == "pypy-" ]; then
      # Travis's pyenv is too old for pyenv update
      ls -la $HOME/.pyenv
      eval "$(pyenv init -)"
      pyenv --version
      pyenv commands
      pyenv help
      pyenv update
      pyenv install pypy-5.7.0
      pyenv global pypy-5.7.0
    fi
  - pip install -U pip setuptools wheel
  - pip install tox codecov

script:
  - tox ${DEVELOP}

after_success:
  - codecov

notifications:
  email: false
  irc:
     channels: "chat.freenode.net#divmod"
     template:
       - "%{repository}@%{branch} - %{author}: %{message} (%{build_url})"
     use_notice: true

language: "python"
sudo: false
dist: trusty
cache:
  directories:
    - $HOME/.cache/pip

branches:
  only:
    - master

env:
  - TOXENV=py27-twlatest
  - TOXENV=py27-twtrunk
  - TOXENV=py27-twlowest
  - TOXENV=pypy-twlatest
  - TOXENV=pypy-twtrunk
  - TOXENV=pypy-twlowest
  # Test inplace on one variant
  - TOXENV=py27-twlatest DEVELOP=--develop

matrix:
  allow_failures:
    - env: TOXENV=py27-twtrunk
    - env: TOXENV=pypy-twtrunk

install:
  # Install a newer PyPy version
  - |
    if [ "${TOXENV::5}" == "pypy-" ]; then
      git clone --depth 1 https://github.com/yyuu/pyenv.git ~/updated-pyenv
      PYENV_ROOT="$HOME/updated-pyenv"
      PATH="$PYENV_ROOT/bin:$PATH"
      eval "$(pyenv init -)"
      pyenv install pypy-5.7.0
      pyenv global pypy-5.7.0
    fi
  - pip install -U pip setuptools wheel
  - pip install tox codecov

script:
  - tox ${DEVELOP}

after_success:
  - codecov

notifications:
  email: false
  irc:
     channels: "chat.freenode.net#divmod"
     template:
       - "%{repository}@%{branch} - %{author}: %{message} (%{build_url})"
     use_notice: true

Install our own pyenv somewhere else, since Travis has their own.
Install our own pyenv somewhere else, since Travis has their own.
