blob: e29b2d5d7fbe8ba6cb6684f31fa5862fa68fcd0b [file] [log] [blame]
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07001[tox]
Christian Heimesdbf18352016-11-30 13:33:02 +01002minversion = 2.4
Paul Kehrer4e91f7f2015-09-14 09:02:46 -05003envlist = py26,py27,pypy,py33,py34,py35,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 =
Alex Gaynorff61cd32013-10-03 09:52:08 -07009 coverage
Alex Stapleton3888a842014-03-24 23:05:53 +000010 ./vectors
Paul Kehrer9b6ae9c2015-09-15 18:30:55 -050011passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME
Alex Gaynor29b2ebc2016-11-22 09:25:17 -050012setenv =
13 CRYPTOGRAPHY_ALLOW_OPENSSL_100=1
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
23[testenv:docs]
Chris Wolfe0b26ab22016-11-05 23:00:37 -050024extras =
25 docstest
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070026basepython = python2.7
Donald Stufft235fa712013-08-11 17:47:17 -040027commands =
28 sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
Alex Gaynor960cf5e2013-12-15 10:24:35 -080029 sphinx-build -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
Donald Stufft235fa712013-08-11 17:47:17 -040030 sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
Paul Kehrercd34ca62014-09-29 15:20:43 -050031 sphinx-build -W -b spelling docs docs/_build/html
Paul Kehrerb525adf2014-09-29 15:18:23 -050032 doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/
Donald Stufft942e91d2015-02-12 21:39:51 -050033 python setup.py check --restructuredtext --strict
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070034
Paul Kehrer986b1902014-03-02 16:35:21 -040035[testenv:docs-linkcheck]
Paul Kehrer562b9a92016-11-13 05:46:04 -080036extras =
Paul Kehrer986b1902014-03-02 16:35:21 -040037deps =
38 sphinx
39basepython = python2.7
40commands =
41 sphinx-build -W -b linkcheck docs docs/_build/html
42
Paul Kehrer1dafc3f2016-01-03 21:09:22 -060043# This target disables coverage on pypy because of performance problems with
David Reid46cb6012013-10-31 15:53:59 -070044# coverage.py on pypy.
Paul Kehrer1dafc3f2016-01-03 21:09:22 -060045[testenv:pypy-nocoverage]
Paul Kehrer030c4ac2016-01-03 21:22:05 -060046basepython = pypy
Paul Kehrerdefa4602014-12-23 13:00:23 -060047commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050048 pip list
Paul Kehrerdefa4602014-12-23 13:00:23 -060049 py.test --capture=no --strict {posargs}
50
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070051[testenv:pep8]
Chris Wolfe0b26ab22016-11-05 23:00:37 -050052extras =
53 pep8test
Alex Gaynor5b8126f2014-05-17 22:34:56 -070054commands =
55 flake8 .
Alex Gaynor967c03b2013-10-21 20:22:50 -070056
Alex Gaynorc510e492013-10-31 11:37:11 -070057[testenv:py3pep8]
Terry Chiaac85fa92015-08-16 13:55:46 +080058basepython = python3
Chris Wolfe0b26ab22016-11-05 23:00:37 -050059extras =
60 pep8test
Alex Gaynord8387832014-05-17 22:35:16 -070061commands =
62 flake8 .
Alex Gaynorc510e492013-10-31 11:37:11 -070063
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100064[testenv:randomorder]
65deps =
66 {[testenv]deps}
67 pytest-random
68commands =
69 py.test --capture=no --strict --random {posargs}
70
Alex Gaynor967c03b2013-10-21 20:22:50 -070071[flake8]
Terry Chia5cec1bf2015-03-22 11:49:08 +080072exclude = .tox,*.egg,.git,_build,.hypothesis
Alex Stapletonbafceb62014-03-22 08:50:07 +000073select = E,W,F,N,I
Alex Stapleton707b0082014-04-20 22:24:41 +010074application-import-names = cryptography,cryptography_vectors,tests
Alex Gaynor95f2c2b2014-08-19 16:18:01 -070075
76[doc8]
77extensions = rst
Terry Chia36b35b12014-12-14 15:32:16 +080078
79[pytest]
80addopts = -r s
81markers =
82 requires_backend_interface: this test requires a specific backend interface
83 supported: parametrized test requiring only_if and skip_message