language: python
cache: pip

jobs:
  include:
    - python: "2.7"
      dist: trusty
      sudo: false
      env: WITH_EXTRAS=""
    - python: "2.7"
      dist: trusty
      sudo: false
      env: WITH_EXTRAS="fast,icu"
      addons:
        apt:
          packages:
          - libicu-dev
          - language-pack-de
          - language-pack-en
    - python: "3.4"
      dist: trusty
      sudo: false
      env: WITH_EXTRAS=""
    - python: "3.5"
      dist: trusty
      sudo: false
      env: WITH_EXTRAS=""
    - python: "3.6"
      dist: trusty
      sudo: false
      env: WITH_EXTRAS=""
    - python: "3.6"
      dist: trusty
      sudo: false
      env: WITH_EXTRAS="fast,icu"
      addons:
        apt:
          packages:
          - libicu-dev
          - language-pack-de
          - language-pack-en
    - python: "3.7"
      dist: xenial
      sudo: true
      env: WITH_EXTRAS=""
    - stage: code-quality
      python: "3.6"
      dist: trusty
      sudo: false
      install: pip install flake8 flake8-import-order flake8-bugbear pep8-naming
      script: flake8

install:
- pip install -U pip
- pip install tox-travis codacy-coverage codecov

script:
- tox

stages:
- code-quality
- test

after_success:
- coverage xml
- python-codacy-coverage -r coverage.xml
- codecov

dist: xenial
sudo: false
language: python
cache: pip

jobs:
  include:
    - python: "2.7"
      env: WITH_EXTRAS=""
    - python: "2.7"
      env: WITH_EXTRAS="fast,icu"
      addons:
        apt:
          packages:
          - libicu-dev
          - language-pack-de
          - language-pack-en
    - python: "3.4"
      env: WITH_EXTRAS=""
    - python: "3.5"
      env: WITH_EXTRAS=""
    - python: "3.6"
      env: WITH_EXTRAS=""
    - python: "3.6"
      env: WITH_EXTRAS="fast,icu"
      addons:
        apt:
          packages:
          - libicu-dev
          - language-pack-de
          - language-pack-en
    - python: "3.7"
      env: WITH_EXTRAS=""
    - stage: code-quality
      python: "3.6"
      install: pip install flake8 flake8-import-order flake8-bugbear pep8-naming
      script: flake8

install:
- pip install -U pip
- pip install tox-travis codacy-coverage codecov

script:
- tox

stages:
- code-quality
- test

after_success:
- coverage xml
- python-codacy-coverage -r coverage.xml
- codecov

Use `dist: xenial` in Travis to simplify configuration
Use `dist: xenial` in Travis to simplify configuration

Can remove all `sudo` declarations.

Travis officially added support for Xenial on 2018-11-08.

https://blog.travis-ci.com/2018-11-08-xenial-release
