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 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
|
[tox]
min_version = 4
env_list =
pre-commit,
mypy-pkg,
py3{8,9,10,11,12,13,14}-{tests,mypy}
py312-bindings-main,
pypy3-tests,
system-argon2,
docs-doctests,
coverage-report
[testenv]
description = Run tests / check types and do NOT measure coverage.
package = wheel
wheel_build_env = .pkg
dependency_groups =
tests: tests
mypy: typing
pass_env =
FORCE_COLOR
NO_COLOR
commands =
tests: pytest {posargs}
tests: python -Im argon2 -n 1 -t 1 -m 8 -p 1
mypy: mypy tests/typing
[testenv:py3{8,13}-tests]
description = Run tests and measure coverage.
deps =
coverage[toml]
commands =
coverage run -m pytest {posargs}
coverage run -m argon2 -n 1 -t 1 -m 8 -p 1
coverage run -m argon2 --profile CHEAPEST
[testenv:coverage-report]
description = Report coverage over all test runs.
skip_install = true
depends = py3{8,13}-tests
deps = coverage[toml]
parallel_show_output = true
commands =
coverage combine
coverage report
[testenv:system-argon2]
description = Run tests against bindings that use a system installation of Argon2.
set_env = ARGON2_CFFI_USE_SYSTEM=1
install_command = pip install {opts} --no-binary=argon2-cffi-bindings {packages}
[testenv:py312-bindings-main]
description = Run tests against the current main branch of argon2-cffi-bindings
dependency_groups =
deps =
commands_pre = pip install -I hypothesis pytest git+https://github.com/hynek/argon2-cffi-bindings
install_command = pip install {opts} --no-deps {packages}
[testenv:pre-commit]
description = Run all pre-commit hooks.
skip_install = true
deps = pre-commit-uv
commands = pre-commit run --all-files
[testenv:pyright]
deps = pyright
dependency_groups = typing
commands = pyright tests/typing src
[testenv:mypy-pkg]
description = Check own code.
deps = mypy
commands = mypy src
[testenv:docs-{build,doctests,linkcheck}]
# Keep base_python in sync with .readthedocs.yaml.
base_python = py313
dependency_groups = docs
commands =
build: sphinx-build -n -T -W -b html -d {envtmpdir}/doctrees docs {posargs:docs/_build/}html
doctests: python -m doctest README.md
doctests: sphinx-build -n -T -W -b doctest -d {envtmpdir}/doctrees docs {posargs:docs/_build/}html
linkcheck: sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/html
[testenv:docs-watch]
package = editable
base_python = {[testenv:docs-build]base_python}
dependency_groups = {[testenv:docs-build]dependency_groups}
deps = watchfiles
commands =
watchfiles \
--ignore-paths docs/_build/ \
'sphinx-build -W -n --jobs auto -b html -d {envtmpdir}/doctrees docs docs/_build/html' \
src \
docs \
README.md \
CHANGELOG.md
[testenv:docs-linkcheck]
base_python = {[testenv:docs]base_python}
dependency_groups = {[testenv:docs]dependency_groups}
commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees docs docs/_build/html
|