dist: xenial
language: python

jobs:
  fast_finish: true
  include:
  - python: pypy3
  - python: 3.5
  - python: 3.6
  - python: 3.7
  - &latest_py3
    python: 3.8
  - <<: *latest_py3
    env: LANG=C
  - python: 3.8-dev
  - python: 3.9-dev
  - <<: *latest_py3
    env: TOXENV=docs
  - arch: ppc64le
    python: pypy3
  - arch: ppc64le
    python: 3.5
  - &latest_py3_ppc
    arch: ppc64le
    python: 3.8
  - <<: *latest_py3_ppc
    env: LANG=C
  - arch: ppc64le
    python: 3.9-dev
  allow_failures:
  # suppress failures due to pypa/setuptools#2000
  - python: pypy3
  - <<: *latest_py3
    env: TOXENV=docs


cache: pip

before_install:
- python tools/ppc64le-patch.py

install:

# ensure we have recent pip/setuptools/wheel
- pip install --disable-pip-version-check --upgrade pip setuptools wheel
# need tox to get started
- pip install --upgrade tox tox-venv

# Output the env, to verify behavior
- pip freeze --all
- env

- "! grep pyc setuptools.egg-info/SOURCES.txt"

script:
  - export NETWORK_REQUIRED=1
  - tox

after_success:
  - export TRAVIS_JOB_NAME="${TRAVIS_PYTHON_VERSION} (LANG=$LANG)" CODECOV_ENV=TRAVIS_JOB_NAME
  - tox -e coverage,codecov
