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.
This commit is contained in:
Jon Banafato 2017-10-24 00:17:42 -04:00
parent 1d48345cb0
commit d1a7eda5e8
2 changed files with 28 additions and 16 deletions

View File

@ -2,24 +2,29 @@
language: python language: python
python: matrix:
- "3.6" include:
- "3.5" - python: 3.6
- "3.4" env: TOX_ENV=py36
- "2.7" - python: 3.5
- "pypy" 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 # Use tox to run tests on Travis-CI to keep one unified method of running tests in any environment
install: install:
- pip install coverage coveralls tox-travis - pip install coverage coveralls tox
# Command to run tests, e.g. python setup.py test # 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 # Use after_success to get a single coveralls report
jobs: after_success:
include: - coverage run --source=pipreqs setup.py test
- stage: Coveralls - coveralls
script:
- coverage run --source=pipreqs setup.py test
- coveralls

View File

@ -1,5 +1,5 @@
[tox] [tox]
envlist = py27, py34, py35, py36, pypy envlist = py27, py34, py35, py36, pypy, flake8
[testenv] [testenv]
setenv = setenv =
@ -7,3 +7,10 @@ setenv =
commands = python setup.py test commands = python setup.py test
deps = deps =
-r{toxinidir}/requirements.txt -r{toxinidir}/requirements.txt
[testenv:flake8]
basepython = python3.6
commands = flake8 pipreqs
deps =
-r{toxinidir}/requirements.txt
flake8