mongo-python-driver/tox.ini

111 lines
2.9 KiB
INI

[tox]
requires =
tox>=4
envlist =
# Test using the system Python.
test,
# Run pre-commit on all files.
lint,
# Run pre-commit on all files, including stages that require manual fixes.
lint-manual,
# Typecheck using mypy.
typecheck-mypy,
# Typecheck using pyright.
typecheck-pyright,
# Typecheck using pyright strict.
typecheck-pyright-strict,
# Typecheck all files.
typecheck,
# Build sphinx docs
doc,
# Test sphinx docs
doc-test,
# Linkcheck sphinx docs
linkcheck
[testenv:test]
description = run unit tests
commands =
python --version
python setup.py test {posargs}
[testenv:lint]
description = run pre-commit
deps =
pre-commit
commands =
pre-commit run --all-files
[testenv:lint-manual]
description = run all pre-commit stages, including those that require manual fixes
deps =
pre-commit
commands =
pre-commit run --all-files --hook-stage manual
[testenv:typecheck-mypy]
description = run mypy and pyright to typecheck
deps =
mypy
zstandard
certifi; platform_system == "win32" or platform_system == "Darwin"
typing_extensions
pyopenssl>=17.2.0
requests<3.0.0
service_identity>=18.1.0
pymongocrypt>=1.6.0,<2.0.0
pymongo-auth-aws<2.0.0
commands =
mypy --install-types --non-interactive bson gridfs tools pymongo
mypy --install-types --non-interactive --disable-error-code var-annotated --disable-error-code attr-defined --disable-error-code union-attr --disable-error-code assignment --disable-error-code no-redef --disable-error-code index --allow-redefinition --allow-untyped-globals --exclude "test/mypy_fails/*.*" test
mypy --install-types --non-interactive test/test_typing.py test/test_typing_strict.py
[testenv:typecheck-pyright]
description = run pyright to typecheck
deps =
mypy
pyright==1.1.290
commands =
pyright test/test_typing.py test/test_typing_strict.py
[testenv:typecheck-pyright-strict]
description = run pyright with strict mode to typecheck
deps =
{[testenv:typecheck-pyright]deps}
allowlist_externals=echo
commands =
echo '{"strict": ["tests/test_typing_strict.py"]}' > pyrightconfig.json
pyright test/test_typing_strict.py
[testenv:typecheck]
description = run mypy and pyright to typecheck
deps =
{[testenv:typecheck-mypy]deps}
{[testenv:typecheck-pyright]deps}
allowlist_externals=echo
commands =
{[testenv:typecheck-mypy]commands}
{[testenv:typecheck-pyright]commands}
{[testenv:typecheck-pyright-strict]commands}
[testenv:doc]
description = build sphinx docs
deps =
sphinx
commands =
sphinx-build -E -b html doc ./doc/_build/html
[testenv:doc-test]
description = run sphinx doc tests
deps =
{[testenv:doc]deps}
commands =
sphinx-build -E -b doctest doc ./doc/_build/doctest
[testenv:linkcheck]
description = check links of sphinx docs
deps =
{[testenv:doc]deps}
commands =
sphinx-build -E -b linkcheck doc ./doc/_build/linkcheck