aboutsummaryrefslogtreecommitdiffstats
path: root/tox.ini
blob: 48cfc4513fc62de16d06c391a7feb15436bb39f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
[tox]
minversion = 2.4
envlist = py27,pypy,py35,py36,py37,py38,docs,pep8,packaging
isolated_build = True

[testenv]
extras =
    test
    idna: idna
deps =
    # This must be kept in sync with .travis/install.sh and .github/workflows/ci.yml
    coverage
    ./vectors
    randomorder: pytest-randomly
passenv = ARCHFLAGS LDFLAGS CFLAGS INCLUDE LIB LD_LIBRARY_PATH USERNAME PYTHONIOENCODING
commands =
    pip list
    # We use parallel mode and then combine here so that coverage.py will take
    # the paths like .tox/py38/lib/python3.8/site-packages/cryptography/__init__.py
    # and collapse them into src/cryptography/__init__.py.
    coverage run --parallel-mode -m pytest --capture=no --strict {posargs}
    coverage combine
    coverage report -m

# This target disables coverage on pypy because of performance problems with
# coverage.py on pypy.
[testenv:pypy-nocoverage]
basepython = pypy
commands =
    pip list
    pytest --capture=no --strict {posargs}

# This target disables coverage on pypy because of performance problems with
# coverage.py on pypy.
[testenv:pypy3-nocoverage]
basepython = pypy3
commands =
    pip list
    pytest --capture=no --strict {posargs}

[testenv:docs]
extras =
    docs
    docstest
basepython = python3
commands =
    sphinx-build -j4 -T -W -b html -d {envtmpdir}/doctrees docs docs/_build/html
    sphinx-build -j4 -T -W -b latex -d {envtmpdir}/doctrees docs docs/_build/latex
    sphinx-build -j4 -T -W -b doctest -d {envtmpdir}/doctrees docs docs/_build/html
    sphinx-build -j4 -T -W -b spelling docs docs/_build/html
    doc8 --allow-long-titles README.rst CHANGELOG.rst docs/ --ignore-path docs/_build/
    python setup.py sdist
    twine check dist/*

[testenv:docs-linkcheck]
extras =
    docs
basepython = python2.7
commands =
    sphinx-build -W -b linkcheck docs docs/_build/html

[testenv:pep8]
basepython = python3
extras =
    pep8test
commands =
    flake8 .

[testenv:packaging]
deps =
    check-manifest
commands =
    check-manifest

[flake8]
ignore = W504
exclude = .tox,*.egg,.git,_build,.hypothesis
select = E,W,F,N,I
application-import-names = cryptography,cryptography_vectors,tests

[doc8]
extensions = rst

[pytest]
addopts = -r s
markers =
    requires_backend_interface: this test requires a specific backend interface
    supported: parametrized test requiring only_if and skip_message
    wycheproof_tests: this test runs a wycheproof fixture