build: Enforce flake8-cleanliness in CI
This commit is contained in:
parent
61bfba41f2
commit
f7a7026c8b
2
.flake8
2
.flake8
|
@ -1,5 +1,5 @@
|
|||
[flake8]
|
||||
exclude = .git,.tox,__pycache__
|
||||
exclude = .git,.tox,__pycache__,.eggs,build
|
||||
max-line-length = 100
|
||||
ignore =
|
||||
# E231 missing whitespace after ','
|
||||
|
|
|
@ -28,6 +28,7 @@ install:
|
|||
# Twisted runs on 2.x and 3.3+, but is flaky on pypy.
|
||||
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then travis_retry pip install Twisted; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' || $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install sphinx sphinx_rtd_theme; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then travis_retry pip install flake8; fi
|
||||
# On travis the extension should always be built
|
||||
- if [[ $TRAVIS_PYTHON_VERSION != 'pypy'* ]]; then export TORNADO_EXTENSION=1; fi
|
||||
- travis_retry python setup.py install
|
||||
|
@ -77,6 +78,7 @@ script:
|
|||
- export TORNADO_EXTENSION=0
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-out && sphinx-build -E -n -W -b html . sphinx-out; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' || $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-doctest-out && sphinx-build -E -n -b doctest . sphinx-out; fi
|
||||
- if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then flake8; fi
|
||||
|
||||
after_success:
|
||||
# call codecov from project root
|
||||
|
|
9
tox.ini
9
tox.ini
|
@ -44,7 +44,9 @@ envlist =
|
|||
py3-sphinx-docs,
|
||||
# Run the doctests via sphinx (which covers things not run
|
||||
# in the regular test suite and vice versa)
|
||||
{py2,py3}-sphinx-doctest
|
||||
{py2,py3}-sphinx-doctest,
|
||||
|
||||
py3-lint
|
||||
|
||||
[testenv]
|
||||
# Most of these are defaults, but if you specify any you can't fall back
|
||||
|
@ -79,6 +81,7 @@ deps =
|
|||
py2-monotonic: monotonic
|
||||
sphinx: sphinx
|
||||
sphinx: sphinx_rtd_theme
|
||||
lint: flake8
|
||||
|
||||
setenv =
|
||||
# The extension is mandatory on cpython.
|
||||
|
@ -151,3 +154,7 @@ changedir = docs
|
|||
setenv = TORNADO_EXTENSION=0
|
||||
commands =
|
||||
sphinx-build -q -E -n -b doctest . {envtmpdir}/doctest
|
||||
|
||||
[testenv:py3-lint]
|
||||
commands = flake8 {posargs:}
|
||||
changedir = {toxinidir}
|
||||
|
|
Loading…
Reference in New Issue