branches: {only: [master, test]}

sudo: false
language: python
cache: pip

matrix:
  include:
    - name: Style
      env: TOXENV=style
      python: "3.6"

    - name: Packaging
      env: TOXENV=packaging
      python: "3.6"

    - name: Requirements
      env: TOXENV=requirements
      python: "3.6"

    - name: PyPy
      python: "pypy"

    - name: Python 3.7
      python: "3.7"
      dist: xenial
      sudo: required

    - name: Python 3.6
      python: "3.6"

    - name: Python 3.5
      python: "3.5"

    - name: Python 3.4
      python: "3.4"

    - name: Python 2.7
      python: "2.7"

install:
  - pip install tox==3.5.2 tox-travis
  - pip install codecov
  - pip install -U pip setuptools
  - python setup.py bdist_wheel

script: tox -v --installpkg dist/*.whl

after_success:
  - codecov -e TRAVIS_PYTHON_VERSION

branches: {only: [master, test]}

sudo: false
language: python
cache: pip

matrix:
  include:
    - name: Style
      env: TOXENV=style
      python: "3.6"

    - name: Packaging
      env: TOXENV=packaging
      python: "3.6"

    - name: Requirements
      env: TOXENV=requirements
      python: "3.6"

    - name: PyPy
      python: "pypy"

    - name: Python 3.7
      python: "3.7"
      dist: xenial

    - name: Python 3.6
      python: "3.6"

    - name: Python 3.5
      python: "3.5"

    - name: Python 3.4
      python: "3.4"

    - name: Python 2.7
      python: "2.7"

install:
  - pip install tox==3.5.2 tox-travis
  - pip install codecov
  - pip install -U pip setuptools
  - python setup.py bdist_wheel

script: tox -v --installpkg dist/*.whl

after_success:
  - codecov -e TRAVIS_PYTHON_VERSION

Disable sudo for Py3.7 env
Travis: Disable sudo for Py3.7 env

Sudo shouldn't be needed anymore.
