sudo: false
language: python
cache: pip
python:
  - "3.5"
  - "3.6"
  - "nightly"
  - "pypy3.5"
  - "pypy3"
matrix:
  allow_failures:
    - python: "nightly"
  include:
    - { python: "3.7", dist: xenial, sudo: true }
install:
  - pip install --upgrade coveralls pytest "pytest-cov>=2.5.1" dataclasses
  # mypy can't be installed on pypy
  - if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then pip install mypy ; fi
  # Black is Python 3.6+-only
  - if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* &&  "${TRAVIS_PYTHON_VERSION}" != "3.5"* ]] ; then pip install black ; fi
script:
  - py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
  - if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then mypy injector ; fi
  - if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* && "${TRAVIS_PYTHON_VERSION}" != "3.5"* ]] ; then black --check . ; fi
after_success:
  - coveralls

sudo: false
language: python
cache: pip
python:
  - "3.5"
  - "3.6"
  - "3.7"
  - "nightly"
  - "pypy3.5"
  - "pypy3"
matrix:
  allow_failures:
    - python: "nightly"
install:
  - pip install --upgrade coveralls pytest "pytest-cov>=2.5.1" dataclasses
  # mypy can't be installed on pypy
  - if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then pip install mypy ; fi
  # Black is Python 3.6+-only
  - if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* &&  "${TRAVIS_PYTHON_VERSION}" != "3.5"* ]] ; then pip install black ; fi
script:
  - py.test -vv --cov=injector --cov-branch --cov-report html --cov-report term
  - if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* ]] ; then mypy injector ; fi
  - if [[ "${TRAVIS_PYTHON_VERSION}" != "pypy"* && "${TRAVIS_PYTHON_VERSION}" != "3.5"* ]] ; then black --check . ; fi
after_success:
  - coveralls

Use less convoluted way to use Python 3.7 in CI
Use less convoluted way to use Python 3.7 in CI

This seems to be all right now, no need for distro switch
