language: python

matrix:
  include:
    - python: 2.6
      dist: trusty
      sudo: false
    - python: 2.7
      dist: trusty
      sudo: false
    - python: 3.3
      dist: trusty
      sudo: false
    - python: 3.4
      dist: trusty
      sudo: false
    - python: 3.5
      dist: trusty
      sudo: false
    - python: 3.6
      dist: trusty
      sudo: false
    - python: 3.7
      dist: xenial
      sudo: true

before_install:
  - if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
      echo "No pull requests can be sent to the master branch" 1>&2;
      exit 1;
    fi
install:
  - python scripts/ci/install
script: python scripts/ci/run-tests

language: python
cache: pip

matrix:
  include:
    - python: 2.6
      dist: trusty
      sudo: false
    - python: 2.7
      dist: trusty
      sudo: false
    - python: 3.3
      dist: trusty
      sudo: false
    - python: 3.4
      dist: trusty
      sudo: false
    - python: 3.5
      dist: trusty
      sudo: false
    - python: 3.6
      dist: trusty
      sudo: false
    - python: 3.7
      dist: xenial
      sudo: true

before_install:
  - if [ "$TRAVIS_PULL_REQUEST" != "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
      echo "No pull requests can be sent to the master branch" 1>&2;
      exit 1;
    fi
install:
  - python scripts/ci/install
script: python scripts/ci/run-tests

Enable pip cache in Travis CI
Enable pip cache in Travis CI

Can speed up builds and reduce load on PyPI servers.

For more information, see:

https://docs.travis-ci.com/user/caching/#pip-cache
