forked from open-telemetry/opentelemetry-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
320 lines (256 loc) · 13.2 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]
isolated_build = True
skipsdist = True
skip_missing_interpreters = True
envlist =
; Environments are organized by individual package, allowing
; for specifying supported Python versions per package.
py3{7,8,9,10,11}-opentelemetry-api
pypy3-opentelemetry-api
; Test against both protobuf 3.x and 4.x
py3{7,8,9,10,11}-proto{3,4}-opentelemetry-protobuf
pypy3-proto{3,4}-opentelemetry-protobuf
py3{7,8,9,10,11}-opentelemetry-sdk
pypy3-opentelemetry-sdk
py3{7,8,9,10,11}-opentelemetry-semantic-conventions
pypy3-opentelemetry-semantic-conventions
; docs/getting-started
py3{7,8,9,10,11}-opentelemetry-getting-started
pypy3-opentelemetry-getting-started
py3{7,8,9,10,11}-opentelemetry-opentracing-shim
pypy3-opentelemetry-opentracing-shim
py3{7,8,9,10,11}-opentelemetry-exporter-jaeger-combined
py3{7,8,9,10,11}-opentelemetry-exporter-jaeger-proto-grpc
py3{7,8,9,10,11}-opentelemetry-exporter-jaeger-thrift
py3{7,8,9,10,11}-opentelemetry-exporter-opencensus
; exporter-opencensus intentionally excluded from pypy3
; opentelemetry-exporter-otlp
py3{7,8,9,10,11}-opentelemetry-exporter-otlp-combined
; intentionally excluded from pypy3
py3{7,8,9,10,11}-proto{3,4}-opentelemetry-exporter-otlp-proto-grpc
; intentionally excluded from pypy3
py3{7,8,9,10,11}-proto{3,4}-opentelemetry-exporter-otlp-proto-http
pypy3-opentelemetry-proto{3,4}-exporter-otlp-proto-http
py3{7,8,9,10,11}-opentelemetry-exporter-prometheus
pypy3-opentelemetry-exporter-prometheus
; opentelemetry-exporter-zipkin
py3{7,8,9,10,11}-opentelemetry-exporter-zipkin-combined
pypy3-opentelemetry-exporter-zipkin-combined
py3{7,8,9,10,11}-opentelemetry-exporter-zipkin-proto-http
pypy3-opentelemetry-exporter-zipkin-proto-http
py3{7,8,9,10,11}-opentelemetry-exporter-zipkin-json
pypy3-opentelemetry-exporter-zipkin-json
py3{7,8,9,10,11}-opentelemetry-propagator-b3
pypy3-opentelemetry-propagator-b3
py3{7,8,9,10,11}-opentelemetry-propagator-jaeger
pypy3-opentelemetry-propagator-jaeger
lint
spellcheck
tracecontext
mypy,mypyinstalled
docs
docker-tests-proto{3,4}
public-symbols-check
[testenv]
deps =
-c dev-requirements.txt
opentelemetry: pytest
opentelemetry: pytest-benchmark
opentelemetry: flaky
coverage: pytest
coverage: pytest-cov
mypy,mypyinstalled: mypy
; proto 3 and 4 tests install the respective version of protobuf
proto3: protobuf~=3.19.0
proto4: protobuf~=4.0
setenv =
; override CONTRIB_REPO_SHA via env variable when testing other branches/commits than main
; i.e: CONTRIB_REPO_SHA=dde62cebffe519c35875af6d06fae053b3be65ec tox -e <env to test>
CONTRIB_REPO_SHA={env:CONTRIB_REPO_SHA:"main"}
CONTRIB_REPO="git+https://github.com/open-telemetry/opentelemetry-python-contrib.git@{env:CONTRIB_REPO_SHA}"
mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/:{toxinidir}/tests/opentelemetry-test-utils/src/
changedir =
api: opentelemetry-api/tests
sdk: opentelemetry-sdk/tests
protobuf: opentelemetry-proto/tests
semantic-conventions: opentelemetry-semantic-conventions/tests
getting-started: docs/getting_started/tests
opentracing-shim: shim/opentelemetry-opentracing-shim/tests
exporter-jaeger-combined: exporter/opentelemetry-exporter-jaeger/tests
exporter-jaeger-proto-grpc: exporter/opentelemetry-exporter-jaeger-proto-grpc/tests
exporter-jaeger-thrift: exporter/opentelemetry-exporter-jaeger-thrift/tests
exporter-opencensus: exporter/opentelemetry-exporter-opencensus/tests
exporter-otlp-combined: exporter/opentelemetry-exporter-otlp/tests
exporter-otlp-proto-grpc: exporter/opentelemetry-exporter-otlp-proto-grpc/tests
exporter-otlp-proto-http: exporter/opentelemetry-exporter-otlp-proto-http/tests
exporter-prometheus: exporter/opentelemetry-exporter-prometheus/tests
exporter-zipkin-combined: exporter/opentelemetry-exporter-zipkin/tests
exporter-zipkin-proto-http: exporter/opentelemetry-exporter-zipkin-proto-http/tests
exporter-zipkin-json: exporter/opentelemetry-exporter-zipkin-json/tests
propagator-b3: propagator/opentelemetry-propagator-b3/tests
propagator-jaeger: propagator/opentelemetry-propagator-jaeger/tests
commands_pre =
; Install without -e to test the actual installation
py3{7,8,9,10,11}: 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.
opentelemetry: pip install {toxinidir}/opentelemetry-api {toxinidir}/opentelemetry-semantic-conventions {toxinidir}/opentelemetry-sdk {toxinidir}/tests/opentelemetry-test-utils
protobuf: pip install {toxinidir}/opentelemetry-proto
getting-started: pip install requests==2.26.0 flask==2.0.1
getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http"
getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation"
getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests"
getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi"
getting-started: pip install -e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-flask&subdirectory=instrumentation/opentelemetry-instrumentation-flask"
opencensus: pip install {toxinidir}/exporter/opentelemetry-exporter-opencensus
exporter-otlp-combined: pip install {toxinidir}/opentelemetry-proto
exporter-otlp-combined: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc
exporter-otlp-combined: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http
exporter-otlp-combined: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp
exporter-otlp-proto-grpc: pip install {toxinidir}/opentelemetry-proto
exporter-otlp-proto-grpc: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc
exporter-otlp-proto-http: pip install {toxinidir}/opentelemetry-proto
exporter-otlp-proto-http: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http[test]
exporter-jaeger-combined: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger-proto-grpc {toxinidir}/exporter/opentelemetry-exporter-jaeger-thrift {toxinidir}/exporter/opentelemetry-exporter-jaeger
exporter-jaeger-proto-grpc: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger-proto-grpc
exporter-jaeger-thrift: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger-thrift
opentracing-shim: pip install {toxinidir}/opentelemetry-sdk
opentracing-shim: pip install {toxinidir}/shim/opentelemetry-opentracing-shim
exporter-prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus
exporter-zipkin-combined: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin-json
exporter-zipkin-combined: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin-proto-http
exporter-zipkin-combined: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin
exporter-zipkin-proto-http: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin-json
exporter-zipkin-proto-http: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin-proto-http
exporter-zipkin-json: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin-json
b3: pip install {toxinidir}/propagator/opentelemetry-propagator-b3
propagator-jaeger: pip install {toxinidir}/propagator/opentelemetry-propagator-jaeger
; 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 =
opentelemetry: pytest {posargs}
coverage: {toxinidir}/scripts/coverage.sh
mypy: mypy --install-types --non-interactive --namespace-packages --explicit-package-bases opentelemetry-api/src/opentelemetry/
; For test code, we don't want to enforce the full mypy strictness
mypy: mypy --install-types --non-interactive --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 --install-types --non-interactive --namespace-packages opentelemetry-api/tests/mypysmoke.py --strict
[testenv:spellcheck]
basepython: python3.9
recreate = True
deps =
codespell
commands =
codespell
[testenv:lint]
basepython: python3.9
recreate = True
deps =
-c dev-requirements.txt
asgiref
pylint
flake8
isort
black
psutil
readme_renderer
httpretty
GitPython
flaky
commands_pre =
python -m pip install -e {toxinidir}/opentelemetry-api[test]
python -m pip install -e {toxinidir}/opentelemetry-semantic-conventions[test]
python -m pip install -e {toxinidir}/opentelemetry-sdk[test]
# Pin protobuf version due to lint failing on v3.20.0
# https://github.com/protocolbuffers/protobuf/issues/9730
python -m pip install protobuf==3.19.4
python -m pip install -e {toxinidir}/opentelemetry-proto[test]
python -m pip install -e {toxinidir}/tests/opentelemetry-test-utils[test]
python -m pip install -e {toxinidir}/shim/opentelemetry-opentracing-shim[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-jaeger-proto-grpc[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-jaeger-thrift[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-jaeger[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-opencensus[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-otlp[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-prometheus[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-zipkin-json[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-zipkin-proto-http[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-zipkin[test]
python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-b3[test]
python -m pip install -e {toxinidir}/propagator/opentelemetry-propagator-jaeger[test]
commands =
python scripts/eachdist.py lint --check-only
[testenv:docs]
# FIXME See #2984
basepython: python3.9
recreate = True
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:tracecontext]
basepython: python3.9
deps =
# needed for tracecontext
aiohttp~=3.6
# needed for example trace integration
flask~=1.1
requests~=2.7
# temporary fix. we should update the jinja, flask deps
# See https://github.com/pallets/markupsafe/issues/282
# breaking change introduced in markupsafe causes jinja, flask to break
markupsafe==2.0.1
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-semantic-conventions \
-e {toxinidir}/opentelemetry-sdk \
-e "{env:CONTRIB_REPO}#egg=opentelemetry-util-http&subdirectory=util/opentelemetry-util-http" \
-e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation&subdirectory=opentelemetry-instrumentation" \
-e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-requests&subdirectory=instrumentation/opentelemetry-instrumentation-requests" \
-e "{env:CONTRIB_REPO}#egg=opentelemetry-instrumentation-wsgi&subdirectory=instrumentation/opentelemetry-instrumentation-wsgi"
commands =
{toxinidir}/scripts/tracecontext-integration-test.sh
[testenv:docker-tests-proto{3,4}]
deps =
pytest
docker-compose >= 1.25.2
; proto 3 and 4 tests install the respective version of protobuf
proto3: protobuf~=3.19.0
proto4: protobuf~=4.0
changedir =
tests/opentelemetry-docker-tests/tests
commands_pre =
pip freeze
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-semantic-conventions \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/tests/opentelemetry-test-utils \
; opencensus exporter does not work with protobuf 4
proto3: -e {toxinidir}/exporter/opentelemetry-exporter-opencensus \
-e {toxinidir}/opentelemetry-proto \
-e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-grpc \
-e {toxinidir}/exporter/opentelemetry-exporter-otlp-proto-http \
-e {toxinidir}/exporter/opentelemetry-exporter-otlp
docker-compose up -d
commands =
proto3: pytest {posargs}
; opencensus exporter does not work with protobuf 4
proto4: pytest --ignore opencensus {posargs}
commands_post =
docker-compose down -v
[testenv:public-symbols-check]
basepython: python3.9
recreate = True
deps =
GitPython
commands =
python {toxinidir}/scripts/public_symbols_checker.py