forked from mongodb/mongo-python-driver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
202 lines (183 loc) · 5.05 KB
/
tox.ini
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
[tox]
requires =
tox>=4
envlist =
# Test using the system Python.
test,
# Test using the run-tests Evergreen script.
test-eg,
# Set up encryption files and services.
setup-encryption,
# Tear down encryption files and services.
teardown-encryption,
# 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,
# Server live sphinx docs
doc-serve,
# 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
setup-encryption = setup-encryption
teardown-encryption = teardown-encryption
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-serve = doc-serve
doc-test = doc-test
linkcheck = linkcheck
test-mockupdb = test-mockupdb
aws-secrets = aws-secrets
[testenv]
package = editable
[testenv:.pkg]
pass_env =
NO_EXT
[testenv:test]
description = run base set of unit tests with no extra functionality
extras =
test
commands =
pytest -v --durations=5 --maxfail=10 {posargs}
[testenv:test-eg]
description = run tests using run-tests.sh Evergreen script
passenv = *
extras = test
allowlist_externals =
bash
commands =
bash ./.evergreen/run-tests.sh {posargs}
[testenv:lint]
description = run pre-commit
skip_install = true
deps =
pre-commit
commands =
pre-commit run --all-files
[testenv:lint-manual]
description = run all pre-commit stages, including those that require manual fixes
skip_install = true
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 bson gridfs tools pymongo
mypy --install-types --non-interactive --config-file mypy_test.ini 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 =
python tools/ensure_future_annotations_import.py
{[testenv:typecheck-mypy]commands}
{[testenv:typecheck-pyright]commands}
{[testenv:typecheck-pyright-strict]commands}
[testenv:doc]
description = build sphinx docs
deps =
-rrequirements/docs.txt
commands =
sphinx-build -W -b html doc ./doc/_build/html
[testenv:doc-serve]
description = serve sphinx docs
deps =
{[testenv:doc]deps}
sphinx-autobuild
commands =
sphinx-autobuild -W -b html doc --watch ./pymongo --watch ./bson --watch ./gridfs ./doc/_build/serve
[testenv:doc-test]
description = run sphinx doc tests
deps =
{[testenv:doc]deps}
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
extras =
{[testenv:test]extras}
passenv = *
allowlist_externals =
{[testenv:test]allowlist_externals}
commands =
{[testenv:test]commands} ./test/mockupdb
[testenv:setup-encryption]
description = set up encryption assets and servers
skip_install = true
passenv = *
allowlist_externals =
bash
commands =
bash .evergreen/setup-libmongocrypt.sh
bash {env:DRIVERS_TOOLS}/.evergreen/csfle/setup-secrets.sh
bash {env:DRIVERS_TOOLS}/.evergreen/csfle/start-servers.sh
[testenv:teardown-encryption]
description = tear down encryption assets and servers
skip_install = true
passenv = *
allowlist_externals =
bash
rm
commands =
bash {env:DRIVERS_TOOLS}/.evergreen/csfle/stop-servers.sh
rm -rf libmongocrypt/ libmongocrypt_git/ libmongocrypt.tar.gz mongocryptd.pid