forked from open-telemetry/opentelemetry-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
320 lines (246 loc) · 10.6 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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
[tox]
skipsdist = True
skip_missing_interpreters = True
envlist =
; Environments are organized by individual package, allowing
; for specifying supported Python versions per package.
; opentelemetry-api
py3{4,5,6,7,8}-test-api
pypy3-test-api
; opentelemetry-sdk
py3{4,5,6,7,8}-test-sdk
pypy3-test-sdk
; opentelemetry-auto-instrumentation
py3{4,5,6,7,8}-test-auto-instrumentation
pypy3-test-auto-instrumentation
; opentelemetry-example-app
py3{4,5,6,7,8}-test-example-app
pypy3-test-example-app
; docs/getting-started
py3{4,5,6,7,8}-test-getting-started
pypy3-test-getting-started
; opentelemetry-ext-aiohttp-client
py3{5,6,7,8}-test-ext-aiohttp-client
pypy3-test-ext-aiohttp-client
; opentelemetry-ext-django
py3{6,7,8}-test-ext-django
pypy3-test-ext-django
; opentelemetry-ext-dbapi
py3{4,5,6,7,8}-test-ext-dbapi
pypy3-test-ext-dbapi
; opentelemetry-ext-flask
py3{4,5,6,7,8}-test-ext-flask
pypy3-test-ext-flask
; opentelemetry-ext-requests
py3{4,5,6,7,8}-test-ext-requests
pypy3-test-ext-requests
; opentelemetry-ext-jinja2
py3{4,5,6,7,8}-test-ext-jinja2
pypy3-test-ext-jinja2
; opentelemetry-ext-jaeger
py3{4,5,6,7,8}-test-ext-jaeger
pypy3-test-ext-jaeger
; opentelemetry-ext-datadog
py3{5,6,7,8}-test-ext-datadog
; opentelemetry-ext-mysql
py3{4,5,6,7,8}-test-ext-mysql
pypy3-test-ext-mysql
; opentelemetry-ext-otcollector
py3{4,5,6,7,8}-test-ext-otcollector
; ext-otcollector intentionally excluded from pypy3
; opentelemetry-ext-prometheus
py3{4,5,6,7,8}-test-ext-prometheus
pypy3-test-ext-prometheus
; opentelemetry-ext-psycopg2
py3{4,5,6,7,8}-test-ext-psycopg2
; ext-psycopg2 intentionally excluded from pypy3
; opentelemetry-ext-pymongo
py3{4,5,6,7,8}-test-ext-pymongo
pypy3-test-ext-pymongo
; opentelemetry-ext-pymysql
py3{4,5,6,7,8}-test-ext-pymysql
pypy3-test-ext-pymysql
; opentelemetry-ext-sqlite3
py3{4,5,6,7,8}-test-ext-sqlite3
pypy3-test-ext-sqlite3
; opentelemetry-ext-wsgi
py3{4,5,6,7,8}-test-ext-wsgi
pypy3-test-ext-wsgi
; opentelemetry-ext-zipkin
py3{4,5,6,7,8}-test-ext-zipkin
pypy3-test-ext-zipkin
; opentelemetry-opentracing-shim
py3{4,5,6,7,8}-test-opentracing-shim
pypy3-test-opentracing-shim
; opentelemetry-opentracing-shim
py3{4,5,6,7,8}-test-opentracing-shim
pypy3-test-opentracing-shim
; opentelemetry-ext-grpc
py3{4,5,6,7,8}-test-ext-grpc
; opentelemetry-ext-sqlalchemy
py3{4,5,6,7,8}-test-ext-sqlalchemy
pypy3-test-ext-sqlalchemy
; opentelemetry-ext-redis
py3{4,5,6,7,8}-test-ext-redis
pypy3-test-ext-redis
; Coverage is temporarily disabled for pypy3 due to the pytest bug.
; pypy3-coverage
lint
py38-tracecontext
py38-{mypy,mypyinstalled}
docs
docker-tests
[testenv]
deps =
-c dev-requirements.txt
test: pytest
coverage: pytest
coverage: pytest-cov
mypy,mypyinstalled: mypy
setenv =
mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/
changedir =
test-api: opentelemetry-api/tests
test-sdk: opentelemetry-sdk/tests
test-auto-instrumentation: opentelemetry-auto-instrumentation/tests
test-ext-grpc: ext/opentelemetry-ext-grpc/tests
test-ext-aiohttp-client: ext/opentelemetry-ext-aiohttp-client/tests
test-ext-requests: ext/opentelemetry-ext-requests/tests
test-ext-jinja2: ext/opentelemetry-ext-jinja2/tests
test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests
test-ext-datadog: ext/opentelemetry-ext-datadog/tests
test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests
test-ext-django: ext/opentelemetry-ext-django/tests
test-ext-mysql: ext/opentelemetry-ext-mysql/tests
test-ext-otcollector: ext/opentelemetry-ext-otcollector/tests
test-ext-prometheus: ext/opentelemetry-ext-prometheus/tests
test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests
test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/tests
test-ext-pymysql: ext/opentelemetry-ext-pymysql/tests
test-ext-sqlite3: ext/opentelemetry-ext-sqlite3/tests
test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests
test-ext-zipkin: ext/opentelemetry-ext-zipkin/tests
test-ext-flask: ext/opentelemetry-ext-flask/tests
test-example-app: docs/examples/opentelemetry-example-app/tests
test-getting-started: docs/getting_started/tests
test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests
test-ext-sqlalchemy: ext/opentelemetry-ext-sqlalchemy/tests
test-ext-redis: ext/opentelemetry-ext-redis/tests
commands_pre =
; Install without -e to test the actual installation
py3{4,5,6,7}: python -m pip install -U pip setuptools wheel
; Install common packages for all the tests. These are not needed in all the
; cases but it saves a lot of boilerplate in this file.
test: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util
test-auto-instrumentation: pip install {toxinidir}/opentelemetry-auto-instrumentation
example-app: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests {toxinidir}/ext/opentelemetry-ext-wsgi {toxinidir}/ext/opentelemetry-ext-flask {toxinidir}/docs/examples/opentelemetry-example-app
getting-started: pip install -e {toxinidir}/opentelemetry-auto-instrumentation -e {toxinidir}/ext/opentelemetry-ext-requests -e {toxinidir}/ext/opentelemetry-ext-wsgi -e {toxinidir}/ext/opentelemetry-ext-flask
grpc: pip install {toxinidir}/ext/opentelemetry-ext-grpc[test]
wsgi,flask,django: pip install {toxinidir}/tests/util
wsgi,flask,django: pip install {toxinidir}/ext/opentelemetry-ext-wsgi
flask,django: pip install {toxinidir}/opentelemetry-auto-instrumentation
flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test]
dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi[test]
django: pip install {toxinidir}/ext/opentelemetry-ext-django[test]
mysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-mysql[test]
otcollector: pip install {toxinidir}/ext/opentelemetry-ext-otcollector
prometheus: pip install {toxinidir}/ext/opentelemetry-ext-prometheus
pymongo: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-pymongo[test]
psycopg2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-psycopg2 {toxinidir}/ext/opentelemetry-ext-psycopg2[test]
pymysql: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-pymysql[test]
sqlite3: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-dbapi {toxinidir}/ext/opentelemetry-ext-sqlite3[test]
redis: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-redis[test]
requests: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-requests[test]
jinja2: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-jinja2[test]
aiohttp-client: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-aiohttp-client
jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger
datadog: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-datadog
opentracing-shim: pip install {toxinidir}/ext/opentelemetry-ext-opentracing-shim
zipkin: pip install {toxinidir}/ext/opentelemetry-ext-zipkin
sqlalchemy: pip install {toxinidir}/opentelemetry-auto-instrumentation {toxinidir}/ext/opentelemetry-ext-sqlalchemy
; In order to get a healthy coverage report,
; we have to install packages in editable mode.
coverage: python {toxinidir}/scripts/eachdist.py install --editable
; Using file:// here because otherwise tox invokes just "pip install
; opentelemetry-api", leading to an error
mypyinstalled: pip install file://{toxinidir}/opentelemetry-api/
commands =
test: pytest {posargs}
coverage: {toxinidir}/scripts/coverage.sh
mypy: mypy --namespace-packages opentelemetry-api/src/opentelemetry/
; For test code, we don't want to enforce the full mypy strictness
mypy: mypy --namespace-packages --config-file=mypy-relaxed.ini opentelemetry-api/tests/
; Test that mypy can pick up typeinfo from an installed package (otherwise,
; implicit Any due to unfollowed import would result).
mypyinstalled: mypy --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict
[testenv:lint]
basepython: python3.8
recreate = True
deps =
-c dev-requirements.txt
pylint
flake8
isort
black
psutil
readme_renderer
httpretty
commands_pre =
python scripts/eachdist.py install --editable
commands =
python scripts/eachdist.py lint --check-only
[testenv:docs]
deps =
-c {toxinidir}/dev-requirements.txt
-r {toxinidir}/docs-requirements.txt
changedir = docs
commands =
sphinx-build -E -a -W -b html -T . _build/html
[testenv:py38-tracecontext]
basepython: python3.8
deps =
# needed for tracecontext
aiohttp~=3.6
# needed for example trace integration
flask~=1.1
requests~=2.7
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-auto-instrumentation \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/opentelemetry-auto-instrumentation \
-e {toxinidir}/ext/opentelemetry-ext-requests \
-e {toxinidir}/ext/opentelemetry-ext-wsgi \
-e {toxinidir}/ext/opentelemetry-ext-flask
commands =
{toxinidir}/scripts/tracecontext-integration-test.sh
[testenv:docker-tests]
deps =
pytest
docker-compose >= 1.25.2
mysql-connector-python ~= 8.0
pymongo ~= 3.1
pymysql ~= 0.9.3
psycopg2-binary ~= 2.8.4
sqlalchemy ~= 1.3.16
redis ~= 3.3.11
changedir =
ext/opentelemetry-ext-docker-tests/tests
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/opentelemetry-auto-instrumentation \
-e {toxinidir}/tests/util \
-e {toxinidir}/ext/opentelemetry-ext-dbapi \
-e {toxinidir}/ext/opentelemetry-ext-mysql \
-e {toxinidir}/ext/opentelemetry-ext-psycopg2 \
-e {toxinidir}/ext/opentelemetry-ext-pymongo \
-e {toxinidir}/ext/opentelemetry-ext-pymysql \
-e {toxinidir}/ext/opentelemetry-ext-sqlalchemy \
-e {toxinidir}/ext/opentelemetry-ext-redis
docker-compose up -d
python check_availability.py
commands =
pytest {posargs}
commands_post =
docker-compose down