forked from open-telemetry/opentelemetry-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
228 lines (181 loc) · 7.86 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
[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{5,6,7,8,9}-test-core-api
pypy3-test-core-api
; opentelemetry-proto
py3{5,6,7,8,9}-test-core-proto
pypy3-test-core-proto
; opentelemetry-sdk
py3{5,6,7,8,9}-test-core-sdk
pypy3-test-core-sdk
; opentelemetry-instrumentation
py3{5,6,7,8,9}-test-core-instrumentation
pypy3-test-core-instrumentation
; docs/getting-started
py3{5,6,7,8,9}-test-core-getting-started
pypy3-test-core-getting-started
; opentelemetry-distro
py3{5,6,7,8,9}-test-core-distro
pypy3-test-core-distro
; opentelemetry-exporter-jaeger
py3{5,6,7,8,9}-test-exporter-jaeger
; opentelemetry-exporter-opencensus
py3{5,6,7,8,9}-test-exporter-opencensus
; exporter-opencensus intentionally excluded from pypy3
; opentelemetry-exporter-otlp
py3{5,6,7,8,9}-test-exporter-otlp
; exporter-otlp intentionally excluded from pypy3
; opentelemetry-exporter-prometheus
py3{5,6,7,8,9}-test-exporter-prometheus
pypy3-test-exporter-prometheus
; opentelemetry-exporter-zipkin
py3{5,6,7,8,9}-test-exporter-zipkin
pypy3-test-exporter-zipkin
; opentelemetry-opentracing-shim
py3{5,6,7,8,9}-test-core-opentracing-shim
pypy3-test-core-opentracing-shim
; opentelemetry-propagator-b3
py3{5,6,7,8,9}-test-propagator-b3
pypy3-test-propagator-b3
; opentelemetry-propagator-jaeger
py3{5,6,7,8,9}-test-propagator-jaeger
pypy3-test-propagator-jaeger
lint
tracecontext
mypy,mypyinstalled
docs
docker-tests
[testenv]
deps =
-c dev-requirements.txt
test: pytest
test: pytest-benchmark
coverage: pytest
coverage: pytest-cov
mypy,mypyinstalled: mypy
setenv = mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/
changedir =
test-core-api: opentelemetry-api/tests
test-core-sdk: opentelemetry-sdk/tests
test-core-proto: opentelemetry-proto/tests
test-core-instrumentation: opentelemetry-instrumentation/tests
test-core-getting-started: docs/getting_started/tests
test-core-opentracing-shim: shim/opentelemetry-opentracing-shim/tests
test-core-distro: opentelemetry-distro/tests
test-exporter-jaeger: exporter/opentelemetry-exporter-jaeger/tests
test-exporter-opencensus: exporter/opentelemetry-exporter-opencensus/tests
test-exporter-otlp: exporter/opentelemetry-exporter-otlp/tests
test-exporter-prometheus: exporter/opentelemetry-exporter-prometheus/tests
test-exporter-zipkin: exporter/opentelemetry-exporter-zipkin/tests
test-propagator-b3: propagator/opentelemetry-propagator-b3/tests
test-propagator-jaeger: propagator/opentelemetry-propagator-jaeger/tests
commands_pre =
; Install without -e to test the actual installation
py3{5,6,7,8,9}: 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-instrumentation {toxinidir}/opentelemetry-sdk {toxinidir}/tests/util
test-core-proto: pip install {toxinidir}/opentelemetry-proto
distro: pip install {toxinidir}/opentelemetry-distro {toxinidir}/opentelemetry-distro
instrumentation: pip install {toxinidir}/opentelemetry-instrumentation
getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests {toxinidir}/opentelemetry-python-contrib/util/opentelemetry-util-http -e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-flask
opencensus: pip install {toxinidir}/exporter/opentelemetry-exporter-opencensus
otlp: pip install {toxinidir}/opentelemetry-proto
otlp: pip install {toxinidir}/exporter/opentelemetry-exporter-otlp
prometheus: pip install {toxinidir}/exporter/opentelemetry-exporter-prometheus
exporter-jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger
opentracing-shim: pip install {toxinidir}/opentelemetry-sdk
opentracing-shim: pip install {toxinidir}/shim/opentelemetry-opentracing-shim
zipkin: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin
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 =
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
asgiref
pylint
flake8
isort
black
psutil
readme_renderer
httpretty
commands_pre =
python -m pip install -e {toxinidir}/opentelemetry-api[test]
python -m pip install -e {toxinidir}/opentelemetry-instrumentation[test]
python -m pip install -e {toxinidir}/opentelemetry-sdk[test]
python -m pip install -e {toxinidir}/opentelemetry-proto[test]
python -m pip install -e {toxinidir}/tests/util[test]
python -m pip install -e {toxinidir}/shim/opentelemetry-opentracing-shim[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[test]
python -m pip install -e {toxinidir}/exporter/opentelemetry-exporter-prometheus[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]
python -m pip install -e {toxinidir}/opentelemetry-distro[test]
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:tracecontext]
basepython: python3.9
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-instrumentation \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests \
-e {toxinidir}/opentelemetry-python-contrib/util/opentelemetry-util-http
commands =
{toxinidir}/scripts/tracecontext-integration-test.sh
[testenv:docker-tests]
deps =
pytest
docker-compose >= 1.25.2
changedir =
tests/opentelemetry-docker-tests/tests
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-instrumentation \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/tests/util \
-e {toxinidir}/exporter/opentelemetry-exporter-opencensus
docker-compose up -d
commands =
pytest {posargs}
commands_post =
docker-compose down -v