Add flake8 Travis-CI jobs

(Using bash env tests like this is a little ugly;
in the future, should just switch to tox.)
This commit is contained in:
medmunds
2017-04-16 11:45:59 -07:00
parent 8bdc67939a
commit db43af366e

View File

@@ -1,5 +1,6 @@
sudo: false sudo: false
language: python language: python
matrix: matrix:
include: include:
# Anymail supports the same python versions as Django, excluding Python 3.2, but adding pypy. # Anymail supports the same python versions as Django, excluding Python 3.2, but adding pypy.
@@ -33,6 +34,10 @@ matrix:
# Django 2.0 (prerelease): Python 3.5+ # Django 2.0 (prerelease): Python 3.5+
# - { env: DJANGO="--pre django", python: 3.5 } # - { env: DJANGO="--pre django", python: 3.5 }
# - { env: DJANGO="--pre django", python: 3.6 } # - { env: DJANGO="--pre django", python: 3.6 }
- { env: FLAKE8=true, python: 2.7 }
- { env: FLAKE8=true, python: 3.6 }
# allow_failures: # allow_failures:
# - env: DJANGO="--pre django" # - env: DJANGO="--pre django"
# - python: 3.6 # - python: 3.6
@@ -40,11 +45,18 @@ matrix:
cache: cache:
directories: directories:
- $HOME/.cache/pip - $HOME/.cache/pip
# If env DJANGO is set, install Anymail and run tests
# If env FLAKE8 is set, run flake8
install: install:
- pip install --upgrade setuptools pip - pip install --upgrade setuptools pip
- pip install $DJANGO - if [[ -n $DJANGO ]]; then pip install $DJANGO; fi
# For now, install all ESPs and test at once # For now, install Anymail including all optional ESPs, and test at once
# (in future, might want to matrix ESPs to test cross-dependencies) # (in future, might want to matrix ESPs to test cross-dependencies)
- pip install .[mailgun,mandrill,postmark,sendgrid,sparkpost] - if [[ -n $DJANGO ]]; then pip install .[mailgun,mandrill,postmark,sendgrid,sparkpost]; fi
- if [[ -n $FLAKE8 ]]; then pip install flake8; fi
- pip list - pip list
script: python setup.py test
script:
- if [[ -n $DJANGO ]]; then python setup.py test; fi
- if [[ -n $FLAKE8 ]]; then flake8; fi