language: python
python: 2.7

sudo: false

env:
    - TOXENV=py27
    - TOXENV=precise
    - TOXENV=py34
    - TOXENV=pypy

matrix:
    allow_failures:

        - env: TOXENV=py34
          python: 2.7

        - env: TOXENV=pypy
          python: 2.7

install:
    - pip install -U tox codecov

script:
    - tox

after_success:
    - codecov

notifications:
    irc:
        channels:
            - "irc.freenode.org#scrapy"
        use_notice: true
        skip_join: true

language: python
python: 2.7

sudo: false

env:
    - TOXENV=py27
    - TOXENV=precise
    - TOXENV=py34
    - TOXENV=pypy

matrix:
    allow_failures:

        - env: TOXENV=py34
          python: 2.7

        - env: TOXENV=pypy
          python: 2.7

install:
    - |
      if [ "$TOXENV" = "pypy" ]; then
        export PYENV_ROOT="$HOME/.pyenv"
        if [ -f "$PYENV_ROOT/bin/pyenv" ]; then
          pushd "$PYENV_ROOT" && git pull && popd
        else
          rm -rf "$PYENV_ROOT" && git clone --depth 1 https://github.com/yyuu/pyenv.git "$PYENV_ROOT"
        fi
        # get latest PyPy from pyenv directly (thanks to natural version sort option -V)
        export PYPY_VERSION=`"$PYENV_ROOT/bin/pyenv" install --list |grep -o -E 'pypy-[0-9][\.0-9]*$' |sort -V |tail -1`
        "$PYENV_ROOT/bin/pyenv" install --skip-existing "$PYPY_VERSION"
        virtualenv --python="$PYENV_ROOT/versions/$PYPY_VERSION/bin/python" "$HOME/virtualenvs/$PYPY_VERSION"
        source "$HOME/virtualenvs/$PYPY_VERSION/bin/activate"
      fi
    - pip install -U tox codecov

script:
    - tox

after_success:
    - codecov

notifications:
    irc:
        channels:
            - "irc.freenode.org#scrapy"
        use_notice: true
        skip_join: true

Install newer pypy version on Travis
Install newer pypy version on Travis
