diff --git a/.travis.yml b/.travis.yml index 526bac0e..2bcd0c2c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,23 +1,30 @@ +sudo: false language: python cache: pip -python: - - "3.6" - - "3.5" - - "3.4" - - "3.3" - - "2.7" - - "2.6" - -sudo: false -# command to install dependencies, e.g. pip install -r requirements.txt -# These packages only exist on Ubuntu 13.04 and newer: -# No dependencies currently unless using Python 2.6. +matrix: + include: + - python: 2.7 + - python: 3.4 + - python: 3.5 + - python: 3.6 + - python: 3.7 + dist: xenial # required for Python 3.7 (travis-ci/travis-ci#9069) + sudo: required # required for Python 3.7 (travis-ci/travis-ci#9069) install: - - if [[ $TRAVIS_PYTHON_VERSION == 2.6* ]]; then pip install -r requirements_py26.txt; fi - python setup.py install +before_script: + # Run flake8 tests only on Python 2.7 and 3.7... + # 1) stop the build if there are Python syntax errors or undefined names + # 2) exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide + - if [[ $TRAVIS_PYTHON_VERSION == *.7 ]]; then + pip install flake8; + flake8 . --count --exit-zero --select=E901,E999,F821,F822,F823 --show-source --statistics; + flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics; + fi + # command to run tests, e.g. python setup.py test script: