blob: 96a175fa7c59470502621e118f6c7165a8992e76 [file] [log] [blame]
Alex Gaynor0f66c6d2013-08-07 12:18:02 -07001[tox]
Paul Kehrer09586412015-04-18 20:26:03 -05002envlist = py26,py27,pypy,py33,py34,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 Gaynorfb8adfc2013-10-31 14:16:24 -07008 iso8601
Alex Gaynor83a0f482013-08-10 15:48:57 -04009 pretend
Alex Gaynorfb8adfc2013-10-31 14:16:24 -070010 pytest
Alex Stapleton3888a842014-03-24 23:05:53 +000011 ./vectors
Paul Kehrerc8ccffb2015-05-12 18:37:13 -050012passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH
Alex Gaynorff61cd32013-10-03 09:52:08 -070013commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050014 pip list
Paul Kehrer11491662015-05-26 07:57:10 -050015 python -c "from cryptography.hazmat.backends.openssl.backend import backend; print(backend.openssl_version_text())"
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]
Alex Gaynor13ec4792013-11-08 14:09:21 -080024deps =
Ayrxa417b842014-05-20 23:53:40 +080025 doc8
Alex Gaynor29b40ea2014-01-10 09:00:12 -080026 pyenchant
Donald Stufft942e91d2015-02-12 21:39:51 -050027 readme>=0.5.1
Alex Gaynor13ec4792013-11-08 14:09:21 -080028 sphinx
29 sphinx_rtd_theme
Alex Stapleton89917f12014-03-22 10:18:15 +000030 sphinxcontrib-spelling
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070031basepython = python2.7
Donald Stufft235fa712013-08-11 17:47:17 -040032commands =
33 sphinx-build -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
Alex Gaynor960cf5e2013-12-15 10:24:35 -080034 sphinx-build -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
Donald Stufft235fa712013-08-11 17:47:17 -040035 sphinx-build -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
Paul Kehrercd34ca62014-09-29 15:20:43 -050036 sphinx-build -W -b spelling docs docs/_build/html
Paul Kehrerb525adf2014-09-29 15:18:23 -050037 doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/
Donald Stufft942e91d2015-02-12 21:39:51 -050038 python setup.py check --restructuredtext --strict
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070039
Paul Kehrer986b1902014-03-02 16:35:21 -040040[testenv:docs-linkcheck]
41deps =
42 sphinx
43basepython = python2.7
44commands =
45 sphinx-build -W -b linkcheck docs docs/_build/html
46
David Reid46cb6012013-10-31 15:53:59 -070047# Temporarily disable coverage on pypy because of performance problems with
48# coverage.py on pypy.
49[testenv:pypy]
Alex Stapletona39a3192014-03-14 20:03:12 +000050commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050051 pip list
Paul Kehrer11491662015-05-26 07:57:10 -050052 python -c "from cryptography.hazmat.backends.openssl.backend import backend; print(backend.openssl_version_text())"
Alex Stapletona39a3192014-03-14 20:03:12 +000053 py.test --capture=no --strict {posargs}
David Reid46cb6012013-10-31 15:53:59 -070054
Paul Kehrerdefa4602014-12-23 13:00:23 -060055# Temporarily disable coverage on pypy3 because of performance problems with
56# coverage.py on pypy3.
57[testenv:pypy3]
58commands =
Paul Kehrer7cf4c302015-06-06 08:45:09 -050059 pip list
Paul Kehrer11491662015-05-26 07:57:10 -050060 python -c "from cryptography.hazmat.backends.openssl.backend import backend; print(backend.openssl_version_text())"
Paul Kehrerdefa4602014-12-23 13:00:23 -060061 py.test --capture=no --strict {posargs}
62
Alex Gaynor0f66c6d2013-08-07 12:18:02 -070063[testenv:pep8]
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 Gaynor5b8126f2014-05-17 22:34:56 -070068commands =
69 flake8 .
Alex Gaynor967c03b2013-10-21 20:22:50 -070070
Alex Gaynorc510e492013-10-31 11:37:11 -070071[testenv:py3pep8]
Alex Gaynor7b62cca2014-05-18 12:31:59 -070072basepython = python3.3
Alex Gaynor25693232014-03-04 15:02:33 -080073deps =
74 flake8
Alex Stapletonbafceb62014-03-22 08:50:07 +000075 flake8-import-order
Alex Stapleton89917f12014-03-22 10:18:15 +000076 pep8-naming
Alex Gaynord8387832014-05-17 22:35:16 -070077commands =
78 flake8 .
Alex Gaynorc510e492013-10-31 11:37:11 -070079
Paul Kehrer1ecc7f12014-11-20 19:47:12 -100080[testenv:randomorder]
81deps =
82 {[testenv]deps}
83 pytest-random
84commands =
85 py.test --capture=no --strict --random {posargs}
86
Alex Gaynor967c03b2013-10-21 20:22:50 -070087[flake8]
Alex Gaynor1d805382013-10-21 20:44:52 -070088exclude = .tox,*.egg
Alex Stapletonbafceb62014-03-22 08:50:07 +000089select = E,W,F,N,I
Alex Stapleton707b0082014-04-20 22:24:41 +010090application-import-names = cryptography,cryptography_vectors,tests
Alex Gaynor95f2c2b2014-08-19 16:18:01 -070091
92[doc8]
93extensions = rst
Terry Chia36b35b12014-12-14 15:32:16 +080094
95[pytest]
96addopts = -r s
97markers =
98 requires_backend_interface: this test requires a specific backend interface
99 supported: parametrized test requiring only_if and skip_message