argon2-cffi/tox.ini
2025-10-08 08:44:39 +02:00

135 lines
3.8 KiB
INI

[tox]
min_version = 4
env_list =
pre-commit,
py3{9,10,11,12,13,14}-{tests,mypy},
py314t-tests,
py314-tests-{bindings-main,system-argon2},
pypy3-tests,
typing-{pyright,ty,pyrefly,mypy}
docs-doctests,
coverage-{combine,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{9,14}-tests]
# Keep coverage-combine's depends with the versions.
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
# Split combine/report in 2 to avoid excessive "Combined data file ..." output.
[testenv:coverage-combine]
# Keep base_python in-sync with .python-version-default
base_python = py313
# Keep in-sync with test env definition above.
depends = py3{9,14}-tests
skip_install = true
deps = coverage
commands = coverage combine
[testenv:coverage-report]
description = Report coverage over oldest and latest supported Python
# Keep base_python in-sync with .python-version-default
base_python = py313
skip_install = true
depends = coverage-combine
deps = coverage
parallel_show_output = true
commands = 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:typing-mypy]
description = Check own code with Mypyy.
# Keep base_python in-sync with .python-version-default
base_python = py313
deps = mypy
dependency_groups = typing
commands = mypy src
[testenv:typing-pyright]
description = Check API and own code with Pyright
deps = pyright
dependency_groups = typing
commands = pyright src tests/typing
[testenv:typing-ty]
description = Check API with ty
deps = ty
dependency_groups = typing
commands = ty check src tests/typing
[testenv:typing-pyrefly]
description = Check API with pyrefly
deps = pyrefly
dependency_groups = typing
commands = pyrefly check src tests/typing
[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