blob: 4075f66f1251730f055664d48fe3460660f89f3a [file] [log] [blame]
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07001[tox]
Paul Kehrer4e91f7f2015-09-14 09:02:46 -05002envlist = py26,py27,pypy,py33,py34,py35,docs,pep8,py3pep8
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07003
4[testenv]
Paul Kehrer7ad18bc2014-03-26 13:13:38 -06005# If you add a new dep here you probably need to add it in setup.py as well
Alex Gaynor83a0f482013-08-10 15:48:57 -04006deps =
Alex Gaynorff61cd32013-10-03 09:52:08 -07007 coverage
Alex Gaynor4efd3f92016-01-17 23:03:11 -05008 .[test]
Alex Stapleton3888a842014-03-24 23:05:53 +00009 ./vectors
Paul Kehrer9b6ae9c2015-09-15 18:30:55 -050010passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME
Alex Gaynorff61cd32013-10-03 09:52:08 -070011commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050012 pip list
Paul Kehrer11491662015-05-26 07:57:10 -050013 python -c "from cryptography.hazmat.backends.openssl.backend import backend; print(backend.openssl_version_text())"
Donald Stufft62143e42014-11-13 08:17:36 -050014 # We use parallel mode and then combine here so that coverage.py will take
15 # the paths like .tox/py34/lib/python3.4/site-packages/cryptography/__init__.py
16 # and collapse them into src/cryptography/__init__.py.
17 coverage run --parallel-mode -m pytest --capture=no --strict {posargs}
18 coverage combine
Alex Gaynor3e81fb22013-11-05 16:29:19 -080019 coverage report -m
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070020
21[testenv:docs]
Alex Gaynor13ec4792013-11-08 14:09:21 -080022deps =
Ayrxa417b842014-05-20 23:53:40 +080023 doc8
Alex Gaynor29b40ea2014-01-10 09:00:12 -080024 pyenchant
Paul Kehrerbe5330e2016-01-04 20:08:01 -060025 readme_renderer
Alex Gaynorb28d4712016-01-14 19:52:44 -050026 sphinx
Alex Gaynor13ec4792013-11-08 14:09:21 -080027 sphinx_rtd_theme
Alex Stapleton89917f12014-03-22 10:18:15 +000028 sphinxcontrib-spelling
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070029basepython = python2.7
Donald Stufft235fa712013-08-11 17:47:17 -040030commands =
31 sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
Alex Gaynor960cf5e2013-12-15 10:24:35 -080032 sphinx-build -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
Donald Stufft235fa712013-08-11 17:47:17 -040033 sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
Paul Kehrercd34ca62014-09-29 15:20:43 -050034 sphinx-build -W -b spelling docs docs/_build/html
Paul Kehrerb525adf2014-09-29 15:18:23 -050035 doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/
Donald Stufft942e91d2015-02-12 21:39:51 -050036 python setup.py check --restructuredtext --strict
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070037
Paul Kehrer986b1902014-03-02 16:35:21 -040038[testenv:docs-linkcheck]
39deps =
40 sphinx
41basepython = python2.7
42commands =
43 sphinx-build -W -b linkcheck docs docs/_build/html
44
Paul Kehrer1dafc3f2016-01-03 21:09:22 -060045# This target disables coverage on pypy because of performance problems with
David Reid46cb6012013-10-31 15:53:59 -070046# coverage.py on pypy.
Paul Kehrer1dafc3f2016-01-03 21:09:22 -060047[testenv:pypy-nocoverage]
Paul Kehrer030c4ac2016-01-03 21:22:05 -060048basepython = pypy
Paul Kehrerdefa4602014-12-23 13:00:23 -060049commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050050 pip list
Paul Kehrer11491662015-05-26 07:57:10 -050051 python -c "from cryptography.hazmat.backends.openssl.backend import backend; print(backend.openssl_version_text())"
Paul Kehrerdefa4602014-12-23 13:00:23 -060052 py.test --capture=no --strict {posargs}
53
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070054[testenv:pep8]
Alex Gaynor25693232014-03-04 15:02:33 -080055deps =
56 flake8
Alex Stapletonbafceb62014-03-22 08:50:07 +000057 flake8-import-order
Alex Stapleton89917f12014-03-22 10:18:15 +000058 pep8-naming
Alex Gaynor5b8126f2014-05-17 22:34:56 -070059commands =
60 flake8 .
Alex Gaynor967c03b2013-10-21 20:22:50 -070061
Alex Gaynorc510e492013-10-31 11:37:11 -070062[testenv:py3pep8]
Terry Chiaac85fa92015-08-16 13:55:46 +080063basepython = python3
Alex Gaynor25693232014-03-04 15:02:33 -080064deps =
65 flake8
Alex Stapletonbafceb62014-03-22 08:50:07 +000066 flake8-import-order
Alex Stapleton89917f12014-03-22 10:18:15 +000067 pep8-naming
Alex Gaynord8387832014-05-17 22:35:16 -070068commands =
69 flake8 .
Alex Gaynorc510e492013-10-31 11:37:11 -070070
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100071[testenv:randomorder]
72deps =
73 {[testenv]deps}
74 pytest-random
75commands =
76 py.test --capture=no --strict --random {posargs}
77
Alex Gaynor967c03b2013-10-21 20:22:50 -070078[flake8]
Terry Chia5cec1bf2015-03-22 11:49:08 +080079exclude = .tox,*.egg,.git,_build,.hypothesis
Alex Stapletonbafceb62014-03-22 08:50:07 +000080select = E,W,F,N,I
Alex Stapleton707b0082014-04-20 22:24:41 +010081application-import-names = cryptography,cryptography_vectors,tests
Alex Gaynor95f2c2b2014-08-19 16:18:01 -070082
83[doc8]
84extensions = rst
Terry Chia36b35b12014-12-14 15:32:16 +080085
86[pytest]
87addopts = -r s
88markers =
89 requires_backend_interface: this test requires a specific backend interface
90 supported: parametrized test requiring only_if and skip_message