From d1a7eda5e8f061b336239a93cc94ebbccd2db13c Mon Sep 17 00:00:00 2001 From: Jon Banafato Date: Tue, 24 Oct 2017 00:17:42 -0400 Subject: [PATCH] Enable flake8 linting in tox.ini and .travis.yml Currently, flake8 is accessible via `make lint`, but it does not run along side the rest of the test suite. This change adds flake8 checks to the tox.ini file to enable linting as a routine part of running tests. Additionally, drop the changes made in #100. --- .travis.yml | 35 ++++++++++++++++++++--------------- tox.ini | 9 ++++++++- 2 files changed, 28 insertions(+), 16 deletions(-) diff --git a/.travis.yml b/.travis.yml index 98ac6f0..324b044 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,24 +2,29 @@ language: python -python: - - "3.6" - - "3.5" - - "3.4" - - "2.7" - - "pypy" +matrix: + include: + - python: 3.6 + env: TOX_ENV=py36 + - python: 3.5 + env: TOX_ENV=py35 + - python: 3.4 + env: TOX_ENV=py34 + - python: 2.7 + env: TOX_ENV=py27 + - python: pypy + env: TOX_ENV=pypy + - python: 3.6 + env: TOX_ENV=flake8 # Use tox to run tests on Travis-CI to keep one unified method of running tests in any environment install: - - pip install coverage coveralls tox-travis + - pip install coverage coveralls tox # Command to run tests, e.g. python setup.py test -script: tox +script: tox -e $TOX_ENV -# Use a build stage instead of after_success to get a single coveralls report -jobs: - include: - - stage: Coveralls - script: - - coverage run --source=pipreqs setup.py test - - coveralls +# Use after_success to get a single coveralls report +after_success: + - coverage run --source=pipreqs setup.py test + - coveralls diff --git a/tox.ini b/tox.ini index 8b6f824..28a1dfa 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27, py34, py35, py36, pypy +envlist = py27, py34, py35, py36, pypy, flake8 [testenv] setenv = @@ -7,3 +7,10 @@ setenv = commands = python setup.py test deps = -r{toxinidir}/requirements.txt + +[testenv:flake8] +basepython = python3.6 +commands = flake8 pipreqs +deps = + -r{toxinidir}/requirements.txt + flake8