Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 1 | [tox] |
Christian Heimes | dbf1835 | 2016-11-30 13:33:02 +0100 | [diff] [blame] | 2 | minversion = 2.4 |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 3 | envlist = py27,pypy,py36,py37,py38,py39,docs,pep8,packaging |
| 4 | isolated_build = True |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 5 | |
| 6 | [testenv] |
Chris Wolfe | 0b26ab2 | 2016-11-05 23:00:37 -0500 | [diff] [blame] | 7 | extras = |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 8 | test |
| 9 | ssh: ssh |
Alex Gaynor | 83a0f48 | 2013-08-10 15:48:57 -0400 | [diff] [blame] | 10 | deps = |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 11 | # This must be kept in sync with .github/workflows/ci.yml |
Paul Kehrer | 636ad60 | 2018-09-04 09:45:17 -0500 | [diff] [blame] | 12 | coverage |
Alex Stapleton | 3888a84 | 2014-03-24 23:05:53 +0000 | [diff] [blame] | 13 | ./vectors |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 14 | randomorder: pytest-randomly |
| 15 | passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME PYTHONIOENCODING OPENSSL_FORCE_FIPS_MODE |
Alex Gaynor | ff61cd3 | 2013-10-03 09:52:08 -0700 | [diff] [blame] | 16 | commands = |
Paul Kehrer | 7cf4c30 | 2015-06-06 08:45:09 -0500 | [diff] [blame] | 17 | pip list |
Donald Stufft | 62143e4 | 2014-11-13 08:17:36 -0500 | [diff] [blame] | 18 | # We use parallel mode and then combine here so that coverage.py will take |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 19 | # the paths like .tox/py38/lib/python3.8/site-packages/cryptography/__init__.py |
Donald Stufft | 62143e4 | 2014-11-13 08:17:36 -0500 | [diff] [blame] | 20 | # and collapse them into src/cryptography/__init__.py. |
| 21 | coverage run --parallel-mode -m pytest --capture=no --strict {posargs} |
| 22 | coverage combine |
Alex Gaynor | 3e81fb2 | 2013-11-05 16:29:19 -0800 | [diff] [blame] | 23 | coverage report -m |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 24 | |
Paul Kehrer | 63df010 | 2017-06-19 00:59:13 -1000 | [diff] [blame] | 25 | # This target disables coverage on pypy because of performance problems with |
| 26 | # coverage.py on pypy. |
| 27 | [testenv:pypy-nocoverage] |
| 28 | basepython = pypy |
| 29 | commands = |
| 30 | pip list |
| 31 | pytest --capture=no --strict {posargs} |
| 32 | |
Alex Gaynor | 7c8ed9e | 2017-08-14 23:25:01 -0400 | [diff] [blame] | 33 | # This target disables coverage on pypy because of performance problems with |
| 34 | # coverage.py on pypy. |
| 35 | [testenv:pypy3-nocoverage] |
| 36 | basepython = pypy3 |
| 37 | commands = |
| 38 | pip list |
| 39 | pytest --capture=no --strict {posargs} |
| 40 | |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 41 | [testenv:docs] |
Chris Wolfe | 0b26ab2 | 2016-11-05 23:00:37 -0500 | [diff] [blame] | 42 | extras = |
Paul Kehrer | e3d2fc1 | 2018-03-05 20:50:10 -0400 | [diff] [blame] | 43 | docs |
Chris Wolfe | 0b26ab2 | 2016-11-05 23:00:37 -0500 | [diff] [blame] | 44 | docstest |
Paul Kehrer | 056c9dd | 2018-05-12 15:17:06 -0400 | [diff] [blame] | 45 | basepython = python3 |
Donald Stufft | 235fa71 | 2013-08-11 17:47:17 -0400 | [diff] [blame] | 46 | commands = |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 47 | sphinx-build -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html |
| 48 | sphinx-build -T -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex |
| 49 | sphinx-build -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html |
| 50 | sphinx-build -T -W -b spelling docs docs/_build/html |
Paul Kehrer | b525adf | 2014-09-29 15:18:23 -0500 | [diff] [blame] | 51 | doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/ |
Paul Kehrer | 6d7b70e | 2018-12-02 23:50:54 +0800 | [diff] [blame] | 52 | python setup.py sdist |
| 53 | twine check dist/* |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 54 | |
Paul Kehrer | 986b190 | 2014-03-02 16:35:21 -0400 | [diff] [blame] | 55 | [testenv:docs-linkcheck] |
Paul Kehrer | 562b9a9 | 2016-11-13 05:46:04 -0800 | [diff] [blame] | 56 | extras = |
Alex Gaynor | 9aefda9 | 2018-09-14 19:44:47 -0400 | [diff] [blame] | 57 | docs |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 58 | basepython = python3 |
Paul Kehrer | 986b190 | 2014-03-02 16:35:21 -0400 | [diff] [blame] | 59 | commands = |
| 60 | sphinx-build -W -b linkcheck docs docs/_build/html |
| 61 | |
Alex Gaynor | 0f66c6d | 2013-08-07 12:18:02 -0700 | [diff] [blame] | 62 | [testenv:pep8] |
Terry Chia | ac85fa9 | 2015-08-16 13:55:46 +0800 | [diff] [blame] | 63 | basepython = python3 |
Chris Wolfe | 0b26ab2 | 2016-11-05 23:00:37 -0500 | [diff] [blame] | 64 | extras = |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 65 | pep8test |
Alex Gaynor | d838783 | 2014-05-17 22:35:16 -0700 | [diff] [blame] | 66 | commands = |
| 67 | flake8 . |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 68 | black --check . |
Alex Gaynor | c510e49 | 2013-10-31 11:37:11 -0700 | [diff] [blame] | 69 | |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 70 | [testenv:packaging] |
Paul Kehrer | 1ecc7f1 | 2014-11-20 19:47:12 -1000 | [diff] [blame] | 71 | deps = |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 72 | check-manifest |
Paul Kehrer | 1ecc7f1 | 2014-11-20 19:47:12 -1000 | [diff] [blame] | 73 | commands = |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 74 | check-manifest |
Paul Kehrer | 1ecc7f1 | 2014-11-20 19:47:12 -1000 | [diff] [blame] | 75 | |
Alex Gaynor | 967c03b | 2013-10-21 20:22:50 -0700 | [diff] [blame] | 76 | [flake8] |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 77 | ignore = E203,E211,W503,W504 |
Terry Chia | 5cec1bf | 2015-03-22 11:49:08 +0800 | [diff] [blame] | 78 | exclude = .tox,*.egg,.git,_build,.hypothesis |
Alex Stapleton | bafceb6 | 2014-03-22 08:50:07 +0000 | [diff] [blame] | 79 | select = E,W,F,N,I |
Alex Stapleton | 707b008 | 2014-04-20 22:24:41 +0100 | [diff] [blame] | 80 | application-import-names = cryptography,cryptography_vectors,tests |
Alex Gaynor | 95f2c2b | 2014-08-19 16:18:01 -0700 | [diff] [blame] | 81 | |
| 82 | [doc8] |
| 83 | extensions = rst |
Terry Chia | 36b35b1 | 2014-12-14 15:32:16 +0800 | [diff] [blame] | 84 | |
| 85 | [pytest] |
| 86 | addopts = -r s |
| 87 | markers = |
| 88 | requires_backend_interface: this test requires a specific backend interface |
Lucia Li | c6ba99d | 2021-11-08 22:06:11 +0800 | [diff] [blame] | 89 | skip_fips: this test is not executed in FIPS mode |
Terry Chia | 36b35b1 | 2014-12-14 15:32:16 +0800 | [diff] [blame] | 90 | supported: parametrized test requiring only_if and skip_message |
Alex Gaynor | 2e85a92 | 2018-07-16 11:18:33 -0400 | [diff] [blame] | 91 | wycheproof_tests: this test runs a wycheproof fixture |