deb-python-falcon/tox.ini

191 lines
5.0 KiB
INI

[tox]
# NOTE(kgriffs): The py26, py27, and py34 envs are required when
# checking combined coverage. To check coverage:
#
# $ tox -e py26,py27,py34 && tools/combine_coverage.sh
#
# You can then drill down into coverage details by opening the HTML
# report at ".coverage_html/index.html".
envlist = py26,
py27,
py34,
py35,
pep8,
docs
[testenv]
deps = -r{toxinidir}/tools/test-requires
commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon
pytest tests []
# --------------------------------------------------------------------
# Coverage
# --------------------------------------------------------------------
[with-coverage]
whitelist_externals = bash
mv
commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon
coverage run -m pytest tests []
bash -c "if [ ! -d .coverage_data ]; then mkdir .coverage_data; fi"
mv {toxinidir}/.coverage {toxinidir}/.coverage_data/.coverage.{envname}
[testenv:py26]
# NOTE(kgriffs): pytest-randomly is not compatible with py26
whitelist_externals = {[with-coverage]whitelist_externals}
commands = {[with-coverage]commands}
[testenv:py27]
deps = {[testenv]deps}
pytest-randomly
whitelist_externals = {[with-coverage]whitelist_externals}
commands = {[with-coverage]commands}
[testenv:py34]
deps = {[testenv]deps}
pytest-randomly
whitelist_externals = {[with-coverage]whitelist_externals}
commands = {[with-coverage]commands}
# --------------------------------------------------------------------
# Debugging
# --------------------------------------------------------------------
[with-debug-tools]
deps = -r{toxinidir}/tools/test-requires
pdbpp
[testenv:py27_debug]
deps = {[with-debug-tools]deps}
funcsigs
[testenv:py34_debug]
deps = {[with-debug-tools]deps}
# --------------------------------------------------------------------
# Cython
# --------------------------------------------------------------------
[with-cython]
deps = -r{toxinidir}/tools/test-requires
cython
[testenv:py27_cython]
deps = {[with-cython]deps}
[testenv:py33_cython]
deps = {[with-cython]deps}
[testenv:py34_cython]
deps = {[with-cython]deps}
[testenv:py35_cython]
deps = {[with-cython]deps}
# --------------------------------------------------------------------
# Smoke testing
# --------------------------------------------------------------------
[smoke-test]
commands = falcon-bench -t 1 -b falcon-ext
[testenv:py27_smoke]
# This test smoke-tests a basic Falcon app
deps = -r{toxinidir}/tools/bench-requires
commands = {[smoke-test]commands}
[testenv:py27_smoke_cython]
# This test ensures that a falcon app will run fine under Cython
deps = -r{toxinidir}/tools/bench-requires
cython
commands = {[smoke-test]commands}
# --------------------------------------------------------------------
# Lint
# --------------------------------------------------------------------
[testenv:py3kwarn]
deps = py3kwarn
commands = py3kwarn falcon
[testenv:pep8]
deps = flake8
flake8-quotes
flake8-import-order
# NOTE(kgriffs): Run with py27 since some code branches assume the
# unicode type is defined, and pep8 complains in those cases when
# running under py3.
basepython = python2.7
commands = flake8 \
--max-complexity=15 \
--exclude=./build,.venv,.tox,dist,docs,./falcon/bench/nuts \
--ignore=F403 \
--max-line-length=99 \
--import-order-style=google \
--application-import-names=falcon \
[]
# --------------------------------------------------------------------
# Benchmarking
# --------------------------------------------------------------------
[testenv:py26_bench]
deps = -r{toxinidir}/tools/bench-requires
commands = falcon-bench []
[testenv:py27_bench]
deps = -r{toxinidir}/tools/bench-requires
commands = falcon-bench []
[testenv:py27_bench_cython]
deps = -r{toxinidir}/tools/bench-requires
cython
commands = falcon-bench []
[testenv:py33_bench]
deps = -r{toxinidir}/tools/bench-requires
commands = falcon-bench []
[testenv:py33_bench_cython]
deps = -r{toxinidir}/tools/bench-requires
cython
commands = falcon-bench []
[testenv:py34_bench]
deps = -r{toxinidir}/tools/bench-requires
commands = falcon-bench []
[testenv:py34_bench_cython]
deps = -r{toxinidir}/tools/bench-requires
cython
commands = falcon-bench []
[testenv:py35_bench]
deps = -r{toxinidir}/tools/bench-requires
commands = falcon-bench []
[testenv:py35_bench_cython]
deps = -r{toxinidir}/tools/bench-requires
cython
commands = falcon-bench []
[testenv:pypy_bench]
deps = -r{toxinidir}/tools/bench-requires
commands = falcon-bench []
[testenv:pypy3_bench]
deps = -r{toxinidir}/tools/bench-requires
commands = falcon-bench []
# --------------------------------------------------------------------
# Documentation
# --------------------------------------------------------------------
[testenv:docs]
deps = -r{toxinidir}/tools/doc-requires
whitelist_externals = rm
commands =
sphinx-build -j 2 -ab html docs docs/_build/html