blob: 7e6b56ca1eac50cea20ab6b9f6605333ba6c3dce [file] [log] [blame]
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07001[tox]
Christian Heimesdbf18352016-11-30 13:33:02 +01002minversion = 2.4
Paul Kehrer4ee1cb92018-06-27 20:07:14 -07003envlist = py27,pypy,py34,py35,py36,py37,docs,pep8,py3pep8
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07004
5[testenv]
Chris Wolfe0b26ab22016-11-05 23:00:37 -05006extras =
7 test
Alex Gaynor83a0f482013-08-10 15:48:57 -04008deps =
Paul Kehrere5359852017-09-13 09:30:51 +08009 # This must be kept in sync with Jenkinsfile and .travis/install.sh
Paul Kehrer636ad602018-09-04 09:45:17 -050010 coverage
Alex Stapleton3888a842014-03-24 23:05:53 +000011 ./vectors
Paul Kehrer9b6ae9c2015-09-15 18:30:55 -050012passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME
Alex Gaynorff61cd32013-10-03 09:52:08 -070013commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050014 pip list
Donald Stufft62143e42014-11-13 08:17:36 -050015 # We use parallel mode and then combine here so that coverage.py will take
16 # the paths like .tox/py34/lib/python3.4/site-packages/cryptography/__init__.py
17 # and collapse them into src/cryptography/__init__.py.
18 coverage run --parallel-mode -m pytest --capture=no --strict {posargs}
19 coverage combine
Alex Gaynor3e81fb22013-11-05 16:29:19 -080020 coverage report -m
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070021
Paul Kehrer63df0102017-06-19 00:59:13 -100022# This target disables coverage on pypy because of performance problems with
23# coverage.py on pypy.
24[testenv:pypy-nocoverage]
25basepython = pypy
26commands =
27 pip list
28 pytest --capture=no --strict {posargs}
29
Alex Gaynor7c8ed9e2017-08-14 23:25:01 -040030# This target disables coverage on pypy because of performance problems with
31# coverage.py on pypy.
32[testenv:pypy3-nocoverage]
33basepython = pypy3
34commands =
35 pip list
36 pytest --capture=no --strict {posargs}
37
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070038[testenv:docs]
Chris Wolfe0b26ab22016-11-05 23:00:37 -050039extras =
Paul Kehrere3d2fc12018-03-05 20:50:10 -040040 docs
Chris Wolfe0b26ab22016-11-05 23:00:37 -050041 docstest
Paul Kehrer056c9dd2018-05-12 15:17:06 -040042basepython = python3
Donald Stufft235fa712013-08-11 17:47:17 -040043commands =
Paul Kehrera3facfa2017-10-11 19:49:27 +080044 sphinx-build -j4 -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
45 sphinx-build -j4 -T -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
46 sphinx-build -j4 -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
47 sphinx-build -j4 -T -W -b spelling docs docs/_build/html
Paul Kehrerb525adf2014-09-29 15:18:23 -050048 doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/
Donald Stufft942e91d2015-02-12 21:39:51 -050049 python setup.py check --restructuredtext --strict
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070050
Paul Kehrer986b1902014-03-02 16:35:21 -040051[testenv:docs-linkcheck]
Paul Kehrer562b9a92016-11-13 05:46:04 -080052extras =
Alex Gaynor9aefda92018-09-14 19:44:47 -040053 docs
Paul Kehrer986b1902014-03-02 16:35:21 -040054basepython = python2.7
55commands =
56 sphinx-build -W -b linkcheck docs docs/_build/html
57
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070058[testenv:pep8]
Terry Chiaac85fa92015-08-16 13:55:46 +080059basepython = python3
Chris Wolfe0b26ab22016-11-05 23:00:37 -050060extras =
61 pep8test
Alex Gaynord8387832014-05-17 22:35:16 -070062commands =
63 flake8 .
Alex Gaynorc510e492013-10-31 11:37:11 -070064
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100065[testenv:randomorder]
66deps =
67 {[testenv]deps}
68 pytest-random
69commands =
Ville Skyttä40c6d402018-05-13 16:23:49 +020070 pytest --capture=no --strict --random {posargs}
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100071
Alex Gaynor967c03b2013-10-21 20:22:50 -070072[flake8]
Paul Kehrer1478d0b2018-10-25 09:40:02 +080073ignore = W504
Terry Chia5cec1bf2015-03-22 11:49:08 +080074exclude = .tox,*.egg,.git,_build,.hypothesis
Alex Stapletonbafceb62014-03-22 08:50:07 +000075select = E,W,F,N,I
Alex Stapleton707b0082014-04-20 22:24:41 +010076application-import-names = cryptography,cryptography_vectors,tests
Alex Gaynor95f2c2b2014-08-19 16:18:01 -070077
78[doc8]
79extensions = rst
Terry Chia36b35b12014-12-14 15:32:16 +080080
81[pytest]
82addopts = -r s
83markers =
84 requires_backend_interface: this test requires a specific backend interface
85 supported: parametrized test requiring only_if and skip_message
Alex Gaynor2e85a922018-07-16 11:18:33 -040086 wycheproof_tests: this test runs a wycheproof fixture