language: python
cache: pip
matrix:
  include:
  - python: pypy3
    env: TOXENV=pypy3
  - python: pypy
    env: TOXENV=pypy
  - python: 3.7
    env: TOXENV=py37
    dist: xenial
    sudo: true
  - python: 3.6
    env: TOXENV=py36
  - python: 3.5
    env: TOXENV=py35
  - python: 3.4
    env: TOXENV=py34
  - python: 2.7
    env: TOXENV=py27
install:
- travis_retry pip install coveralls tox
script:
- travis_retry tox
after_success:
- coveralls
deploy:
  provider: pypi
  user: "matt.bachmann"
  password:
    secure: bKbDC6D6Dg+fape6GLETBsslac7KscsyXihh/DgGuUyay/fpXr1rI0biq8SVR1pQ02SmZea/gECgyjH5mt2H5IVKgvxx79iY4IM5zEGp6XtveDlQ+fzEUBwRnSndsT9rtWV1szizQ6UIx8pBnt/A5bJgIEcUWj57ckt+IH0U0iM=
  on:
    tags: true
    condition: "$TOXENV = py37"

language: python
cache: pip
dist: xenial
matrix:
  include:
  - python: pypy3
    env: TOXENV=pypy3
  - python: pypy
    env: TOXENV=pypy
  - python: 3.7
    env: TOXENV=py37
  - python: 3.6
    env: TOXENV=py36
  - python: 3.5
    env: TOXENV=py35
  - python: 3.4
    env: TOXENV=py34
  - python: 2.7
    env: TOXENV=py27
install:
- travis_retry pip install coveralls tox
script:
- travis_retry tox
after_success:
- coveralls
deploy:
  provider: pypi
  user: "matt.bachmann"
  password:
    secure: bKbDC6D6Dg+fape6GLETBsslac7KscsyXihh/DgGuUyay/fpXr1rI0biq8SVR1pQ02SmZea/gECgyjH5mt2H5IVKgvxx79iY4IM5zEGp6XtveDlQ+fzEUBwRnSndsT9rtWV1szizQ6UIx8pBnt/A5bJgIEcUWj57ckt+IH0U0iM=
  on:
    tags: true
    condition: "$TOXENV = py37"

Use dist:xenial for all builds
Use dist:xenial for all builds

This will soon be the new default on Travis

This also allows us to not require 'sudo' anymore
