forked from mongodb/mongo-python-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtox.ini
More file actions
161 lines (146 loc) · 4.14 KB
/
tox.ini
File metadata and controls
161 lines (146 loc) · 4.14 KB
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
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
[tox]
requires =
tox>=4
envlist =
# Test using the system Python.
test,
# Test using the run-tests Evergreen script.
test-eg,
# 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
labels = # Use labels and -m instead of -e so that tox -m <label> fails instantly if the label does not exist
test = test
test-eg = test-eg
lint = lint
lint-manual = lint-manual
typecheck-mypy = typecheck-mypy
typecheck-pyright = typecheck-pyright
typecheck-pyright-strict = typecheck-pyright-strict
typecheck = typecheck
doc = doc
doc-test = doc-test
linkcheck = linkcheck
test-mockupdb = test-mockupdb
aws-secrets = aws-secrets
[testenv:test]
description = run base set of unit tests with no extra functionality
deps =
pytest>=7
commands =
python --version
pytest -v {posargs}
[testenv:test-eg]
description = run tests using run-tests.sh Evergreen script
passenv = *
deps =
pytest>=7
setuptools
allowlist_externals =
bash
commands =
bash ./.evergreen/run-tests.sh {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
extras =
encryption
ocsp
zstd
aws
deps =
mypy==1.2.0
certifi; platform_system == "win32" or platform_system == "Darwin"
typing_extensions
commands =
mypy --install-types --non-interactive --disallow-untyped-defs 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/*.*" --exclude "test/conftest.py" 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==1.2.0
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
extras =
{[testenv:typecheck-mypy]extras}
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 =
-rdoc/docs-requirements.txt
commands =
sphinx-build -E -b html doc ./doc/_build/html
[testenv:doc-test]
description = run sphinx doc tests
deps =
{[testenv:doc]deps}
gevent
pytz
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
[testenv:test-mockupdb]
description = run mockupdb tests
deps =
{[testenv:test]deps}
https://github.com/ajdavis/mongo-mockup-db/archive/master.zip
passenv = *
commands =
python -m pytest -v {posargs} ./test/mockupdb
[testenv:aws-secrets]
deps =
PyYAML
boto3
passenv = *
commands =
python {env:DRIVERS_TOOLS}/.evergreen/auth_aws/setup_secrets.py {posargs}