-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PYTHON-2963 Add tox config in preparation for migration from setup.py (…
- Loading branch information
Showing
2 changed files
with
85 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
[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 all files. | ||
typecheck | ||
|
||
[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} |