forked from mongodb/motor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
169 lines (152 loc) · 4.02 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
# Tox (https://tox.readthedocs.io) is a tool for running tests in multiple
# virtualenvs. "pip install tox>3.18" and run "tox" from this directory.
# Adapted from Tornado's tox.ini.
[tox]
requires =
tox>=4
envlist =
# Run the unit test suite
test
# Ensure the sphinx build has no errors or warnings.
docs,
# Run the doctests, include examples and tutorial, via Sphinx.
doctest,
# Check links of sphinx docs
linkcheck,
# Test with the latest PyMongo.
test-pymongo-latest,
# Apply PyMongo's test suite to Motor via Synchro.
synchro
# Run synchro tests with enterprise auth
enterprise-synchro
# Run pre-commit on all files.
lint
# Run pre-commit on all files with manual checks.
lint-manual
# Check the sdist integrity.
manifest
# Typecheck with mypy
typecheck-mypy
labels = # Use labels and -m instead of -e so that tox -m <label> fails instantly if the label does not exist
test = test
docs = docs
doctest = doctest
checklink = checklink
test-pymongo-latest = test-pymongo-latest
synchro = synchro
enterprise-synchro = enterprise-synchro
lint = lint
lint-manual = lint-manual
linkcheck = linkcheck
manifest = manifest
typecheck-mypy = typecheck-mypy
[testenv]
install_command =
python -I -m pip install --prefer-binary {opts} {packages}
passenv =
DB_IP
DB_PORT
DB_USER
DB_PASSWORD
CERT_DIR
ASYNC_TEST_TIMEOUT
FLE_AWS_KEY
FLE_AWS_SECRET
FLE_AWS_KEY2
FLE_AWS_SECRET2
FLE_AZURE_CLIENTID
FLE_AZURE_TENANTID
FLE_AZURE_CLIENTSECRET
FLE_GCP_EMAIL
FLE_GCP_PRIVATEKEY
[testenv:test]
commands =
python --version
python -m pytest -v {posargs}
extras =
test
[testenv:docs]
setenv = PYTHONWARNINGS=
deps =
-rdoc/docs-requirements.txt
changedir = doc
commands =
python -m sphinx -q -E -W -b html . {envtmpdir}/html {posargs}
[testenv:doctest]
setenv = PYTHONHASHSEED=0
deps =
-rdoc/docs-requirements.txt
changedir = doc
commands =
python -m sphinx -q -E -b doctest . {envtmpdir}/doctest {posargs}
[testenv:linkcheck]
setenv = PYTHONHASHSEED=0
deps =
-rdoc/docs-requirements.txt
changedir = doc
commands =
python -m sphinx -q -E -b linkcheck . {envtmpdir}/linkcheck {posargs}
[testenv:test-pymongo-latest]
extras =
encryption
test
commands =
pip install git+https://github.com/mongodb/mongo-python-driver.git@master
pip install -q --pre --prefer-binary pymongocrypt
python --version
python -c "import pymongo; print('PyMongo %s' % (pymongo.version,))"
python -m pytest -v {posargs}
[testenv:synchro]
extras =
test
allowlist_externals =
git
setenv =
PYTHONPATH = {envtmpdir}/mongo-python-driver
commands =
git clone --depth 1 --branch master https://github.com/mongodb/mongo-python-driver.git {envtmpdir}/mongo-python-driver
python -m pip install -e {envtmpdir}/mongo-python-driver
python -m synchro.synchrotest {envtmpdir}/mongo-python-driver -v {posargs}
[testenv:enterprise-synchro]
extras =
test
gssapi
allowlist_externals =
git
passenv =
*
setenv =
PYTHONPATH = {envtmpdir}/mongo-python-driver
commands =
git clone --depth 1 --branch master https://github.com/mongodb/mongo-python-driver.git {envtmpdir}/mongo-python-driver
python -m pip install -e {envtmpdir}/mongo-python-driver
python -m synchro.synchrotest {envtmpdir}/mongo-python-driver -v test/test_auth.py
[testenv:lint]
deps =
pre-commit
commands =
python -m pre_commit run --all-files
[testenv:lint-manual]
deps =
pre-commit
commands =
python -m pre_commit run --all-files --hook-stage=manual
[testenv:manifest]
deps =
check-manifest
commands =
python -m check_manifest -v
[testenv:typecheck-mypy]
description = run mypy to typecheck
extras =
test
deps =
mypy==1.7.0
typing_extensions
setuptools==68.0.0
setenv =
SKIP_ENV_SETUP=1
commands =
mypy --install-types --non-interactive motor
mypy --install-types --non-interactive test/test_typing.py
pytest test/test_mypy_fails.py