1[tox] 2 3# -------------------------------------------------------------------- 4# 5# NOTE(kgriffs): The py27, and py37 envs are required when 6# checking combined coverage. To check coverage: 7# 8# $ tools/mintest.sh 9# 10# Which is equivalent to: 11# 12# $ rm -f .coverage.* 13# $ tox -e py27,py37,pep8 && tools/testing/combine_coverage.sh 14# 15# You can then drill down into coverage details by opening the HTML 16# report at ".coverage_html/index.html". 17# 18# If you are using pyenv and get an error along the lines of 19# "failed to get version_info", you may need to activate all of 20# the python version required by tox before trying again. For 21# example: 22# 23# $ pyenv shell 2.7.13 3.7.2 24# 25# -------------------------------------------------------------------- 26 27envlist = py27, 28 py37, 29 pep8, 30 docs 31 32[testenv] 33setenv = 34 PIP_CONFIG_FILE={toxinidir}/pip.conf 35deps = -r{toxinidir}/requirements/tests 36commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon 37 pytest tests [] 38 39# -------------------------------------------------------------------- 40# Coverage 41# -------------------------------------------------------------------- 42 43[with-coverage] 44whitelist_externals = mkdir 45 mv 46commands = {toxinidir}/tools/clean.sh {toxinidir}/falcon 47 coverage run -m pytest tests [] 48 49[testenv:py27] 50deps = {[testenv]deps} 51 pytest-randomly 52whitelist_externals = {[with-coverage]whitelist_externals} 53; setenv = TOXINIDIR={toxinidir} 54commands = {[with-coverage]commands} 55 56[testenv:py37] 57deps = {[testenv]deps} 58 pytest-randomly 59 jsonschema 60whitelist_externals = {[with-coverage]whitelist_externals} 61commands = {[with-coverage]commands} 62 63# -------------------------------------------------------------------- 64# Additional test suite environments 65# -------------------------------------------------------------------- 66 67[testenv:py34] 68basepython = python3.4 69 70[testenv:pypy] 71basepython = pypy 72 73[testenv:pypy3] 74basepython = pypy3 75 76# -------------------------------------------------------------------- 77# Debugging 78# -------------------------------------------------------------------- 79 80[with-debug-tools] 81deps = -r{toxinidir}/requirements/tests 82 pdbpp 83 84[testenv:py2_debug] 85basepython = python2.7 86deps = {[with-debug-tools]deps} 87 funcsigs 88 jsonschema 89 90[testenv:py3_debug] 91basepython = python3.7 92deps = {[with-debug-tools]deps} 93 94# -------------------------------------------------------------------- 95# Cython 96# -------------------------------------------------------------------- 97 98[with-cython] 99deps = -r{toxinidir}/requirements/tests 100 cython 101 102[testenv:py27_cython] 103basepython = python2.7 104deps = {[with-cython]deps} 105 106[testenv:py34_cython] 107basepython = python3.4 108deps = {[with-cython]deps} 109 110[testenv:py35_cython] 111basepython = python3.5 112deps = {[with-cython]deps} 113 114[testenv:py36_cython] 115basepython = python3.6 116deps = {[with-cython]deps} 117 118[testenv:py37_cython] 119basepython = python3.7 120deps = {[with-cython]deps} 121 122# -------------------------------------------------------------------- 123# Smoke testing with a sample app 124# -------------------------------------------------------------------- 125 126[smoke-test] 127commands = falcon-bench -t 1 -b falcon-ext 128 129[testenv:py27_smoke] 130basepython = python2.7 131deps = -r{toxinidir}/requirements/bench 132commands = {[smoke-test]commands} 133 134[testenv:py27_smoke_cython] 135basepython = python2.7 136deps = -r{toxinidir}/requirements/bench 137 cython 138commands = {[smoke-test]commands} 139 140[testenv:py37_smoke] 141basepython = python3.7 142deps = -r{toxinidir}/requirements/bench 143commands = {[smoke-test]commands} 144 145[testenv:py37_smoke_cython] 146basepython = python3.7 147deps = -r{toxinidir}/requirements/bench 148 cython 149commands = {[smoke-test]commands} 150 151# -------------------------------------------------------------------- 152# Lint 153# -------------------------------------------------------------------- 154 155[testenv:py3kwarn] 156basepython = python2.7 157deps = py3kwarn 158commands = py3kwarn falcon 159 160[testenv:pep8] 161deps = flake8 162 flake8-quotes 163 flake8-import-order 164 165# NOTE(kgriffs): Run with py27 since some code branches assume the 166# unicode type is defined, and pep8 complains in those cases when 167# running under py3. 168basepython = python2.7 169 170commands = flake8 \ 171 --max-complexity=15 \ 172 --exclude=.ecosystem,.eggs,.tox,.venv,build,dist,docs,examples,falcon/bench/nuts \ 173 --ignore=F403,W504 \ 174 --max-line-length=99 \ 175 --import-order-style=google \ 176 --application-import-names=falcon \ 177 [] 178 179[testenv:pep8-examples] 180deps = flake8 181 flake8-quotes 182 flake8-import-order 183 184# NOTE(kgriffs): Run with py27 since some code branches assume the 185# unicode type is defined, and pep8 complains in those cases when 186# running under py3. 187basepython = python2.7 188 189commands = flake8 examples \ 190 --max-complexity=12 \ 191 --ignore=F403,W504 \ 192 --max-line-length=99 \ 193 --import-order-style=google \ 194 --application-import-names=look \ 195 [] 196 197# -------------------------------------------------------------------- 198# For viewing environ dicts generated by various WSGI servers 199# -------------------------------------------------------------------- 200 201[testenv:py27_dump_uwsgi] 202basepython = python2.7 203deps = uwsgi 204commands = uwsgi --http localhost:8000 --wsgi-file {toxinidir}/tests/dump_wsgi.py 205 206[testenv:py27_dump_gunicorn] 207basepython = python2.7 208deps = gunicorn 209commands = gunicorn -b localhost:8000 tests.dump_wsgi 210 211[testenv:py37_dump_gunicorn] 212basepython = python3.7 213deps = gunicorn 214commands = gunicorn -b localhost:8000 tests.dump_wsgi 215 216[testenv:py27_dump_waitress] 217basepython = python2.7 218deps = waitress 219commands = waitress-serve --listen=localhost:8000 tests.dump_wsgi:application 220 221[testenv:py27_dump_wsgiref] 222basepython = python2.7 223commands = python tests/dump_wsgi.py 224 225[testenv:py37_dump_wsgiref] 226basepython = python3.7 227commands = python tests/dump_wsgi.py 228 229# -------------------------------------------------------------------- 230# Benchmarking 231# -------------------------------------------------------------------- 232 233[testenv:py27_bench] 234basepython = python2.7 235deps = -r{toxinidir}/requirements/bench 236commands = falcon-bench [] 237 238[testenv:py27_bench_cython] 239basepython = python2.7 240deps = -r{toxinidir}/requirements/bench 241 cython 242commands = falcon-bench [] 243 244[testenv:py34_bench] 245basepython = python3.4 246deps = -r{toxinidir}/requirements/bench 247commands = falcon-bench [] 248 249[testenv:py34_bench_cython] 250basepython = python3.4 251deps = -r{toxinidir}/requirements/bench 252 cython 253commands = falcon-bench [] 254 255[testenv:py35_bench] 256basepython = python3.5 257deps = -r{toxinidir}/requirements/bench 258commands = falcon-bench [] 259 260[testenv:py35_bench_cython] 261basepython = python3.5 262deps = -r{toxinidir}/requirements/bench 263 cython 264commands = falcon-bench [] 265 266[testenv:py36_bench] 267basepython = python3.6 268deps = -r{toxinidir}/requirements/bench 269commands = falcon-bench [] 270 271[testenv:py36_bench_cython] 272basepython = python3.6 273deps = -r{toxinidir}/requirements/bench 274 cython 275commands = falcon-bench [] 276 277[testenv:py37_bench] 278basepython = python3.7 279deps = -r{toxinidir}/requirements/bench 280commands = falcon-bench [] 281 282[testenv:py37_bench_cython] 283basepython = python3.7 284deps = -r{toxinidir}/requirements/bench 285 cython 286commands = falcon-bench [] 287 288[testenv:pypy_bench] 289basepython = pypy 290deps = -r{toxinidir}/requirements/bench 291commands = falcon-bench [] 292 293[testenv:pypy3_bench] 294basepython = pypy3 295deps = -r{toxinidir}/requirements/bench 296commands = falcon-bench [] 297 298# -------------------------------------------------------------------- 299# Check for new versions of vendored packages 300# -------------------------------------------------------------------- 301 302[testenv:check_vendored] 303basepython = python3.7 304deps = 305commands = {toxinidir}/tools/check-vendored.sh 306 307# -------------------------------------------------------------------- 308# Documentation 309# -------------------------------------------------------------------- 310 311[testenv:docs] 312basepython = python3.7 313deps = -r{toxinidir}/requirements/docs 314commands = 315 sphinx-build -j 4 -W -E -b html docs docs/_build/html [] 316 317# -------------------------------------------------------------------- 318# Ecosystem 319# -------------------------------------------------------------------- 320 321[testenv:hug] 322basepython = python3.7 323deps = virtualenv 324commands = 325 {toxinidir}/tools/testing/install_hug.sh 326 {toxinidir}/tools/testing/test_hug.sh 327