blob: d4c3022bc12e943f22a497a5bcdfd5902e3c7304 [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
Paul Kehrer7e422822018-12-07 11:43:38 +08008 idna: idna
Alex Gaynor83a0f482013-08-10 15:48:57 -04009deps =
Paul Kehrere5359852017-09-13 09:30:51 +080010 # This must be kept in sync with Jenkinsfile and .travis/install.sh
Paul Kehrer636ad602018-09-04 09:45:17 -050011 coverage
Alex Stapleton3888a842014-03-24 23:05:53 +000012 ./vectors
Paul Kehrer9b6ae9c2015-09-15 18:30:55 -050013passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME
Alex Gaynorff61cd32013-10-03 09:52:08 -070014commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050015 pip list
Donald Stufft62143e42014-11-13 08:17:36 -050016 # We use parallel mode and then combine here so that coverage.py will take
17 # the paths like .tox/py34/lib/python3.4/site-packages/cryptography/__init__.py
18 # and collapse them into src/cryptography/__init__.py.
19 coverage run --parallel-mode -m pytest --capture=no --strict {posargs}
20 coverage combine
Alex Gaynor3e81fb22013-11-05 16:29:19 -080021 coverage report -m
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070022
Paul Kehrer63df0102017-06-19 00:59:13 -100023# This target disables coverage on pypy because of performance problems with
24# coverage.py on pypy.
25[testenv:pypy-nocoverage]
26basepython = pypy
27commands =
28 pip list
29 pytest --capture=no --strict {posargs}
30
Alex Gaynor7c8ed9e2017-08-14 23:25:01 -040031# This target disables coverage on pypy because of performance problems with
32# coverage.py on pypy.
33[testenv:pypy3-nocoverage]
34basepython = pypy3
35commands =
36 pip list
37 pytest --capture=no --strict {posargs}
38
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070039[testenv:docs]
Chris Wolfe0b26ab22016-11-05 23:00:37 -050040extras =
Paul Kehrere3d2fc12018-03-05 20:50:10 -040041 docs
Chris Wolfe0b26ab22016-11-05 23:00:37 -050042 docstest
Paul Kehrer056c9dd2018-05-12 15:17:06 -040043basepython = python3
Donald Stufft235fa712013-08-11 17:47:17 -040044commands =
Paul Kehrera3facfa2017-10-11 19:49:27 +080045 sphinx-build -j4 -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
46 sphinx-build -j4 -T -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
47 sphinx-build -j4 -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
48 sphinx-build -j4 -T -W -b spelling docs docs/_build/html
Paul Kehrerb525adf2014-09-29 15:18:23 -050049 doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/
Paul Kehrer6d7b70e2018-12-02 23:50:54 +080050 python setup.py sdist
51 twine check dist/*
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070052
Paul Kehrer986b1902014-03-02 16:35:21 -040053[testenv:docs-linkcheck]
Paul Kehrer562b9a92016-11-13 05:46:04 -080054extras =
Alex Gaynor9aefda92018-09-14 19:44:47 -040055 docs
Paul Kehrer986b1902014-03-02 16:35:21 -040056basepython = python2.7
57commands =
58 sphinx-build -W -b linkcheck docs docs/_build/html
59
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070060[testenv:pep8]
Terry Chiaac85fa92015-08-16 13:55:46 +080061basepython = python3
Chris Wolfe0b26ab22016-11-05 23:00:37 -050062extras =
63 pep8test
Alex Gaynord8387832014-05-17 22:35:16 -070064commands =
65 flake8 .
Alex Gaynorc510e492013-10-31 11:37:11 -070066
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100067[testenv:randomorder]
68deps =
69 {[testenv]deps}
70 pytest-random
71commands =
Ville Skyttä40c6d402018-05-13 16:23:49 +020072 pytest --capture=no --strict --random {posargs}
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100073
Alex Gaynor967c03b2013-10-21 20:22:50 -070074[flake8]
Paul Kehrer1478d0b2018-10-25 09:40:02 +080075ignore = W504
Terry Chia5cec1bf2015-03-22 11:49:08 +080076exclude = .tox,*.egg,.git,_build,.hypothesis
Alex Stapletonbafceb62014-03-22 08:50:07 +000077select = E,W,F,N,I
Alex Stapleton707b0082014-04-20 22:24:41 +010078application-import-names = cryptography,cryptography_vectors,tests
Alex Gaynor95f2c2b2014-08-19 16:18:01 -070079
80[doc8]
81extensions = rst
Terry Chia36b35b12014-12-14 15:32:16 +080082
83[pytest]
84addopts = -r s
85markers =
86 requires_backend_interface: this test requires a specific backend interface
87 supported: parametrized test requiring only_if and skip_message
Alex Gaynor2e85a922018-07-16 11:18:33 -040088 wycheproof_tests: this test runs a wycheproof fixture