forked from open-telemetry/opentelemetry-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
211 lines (167 loc) · 7.48 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
[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}-test-core-api
pypy3-test-core-api
; opentelemetry-proto
py3{5,6,7,8}-test-core-proto
pypy3-test-core-proto
; opentelemetry-sdk
py3{5,6,7,8}-test-core-sdk
pypy3-test-core-sdk
; opentelemetry-instrumentation
py3{5,6,7,8}-test-core-instrumentation
pypy3-test-core-instrumentation
; docs/getting-started
py3{5,6,7,8}-test-core-getting-started
pypy3-test-core-getting-started
; opentelemetry-example-app
py3{5,6,7,8}-test-core-example-app
pypy3-test-core-example-app
; opentelemetry-exporter-jaeger
py3{5,6,7,8}-test-exporter-jaeger
pypy3-test-exporter-jaeger
; opentelemetry-exporter-opencensus
py3{5,6,7,8}-test-exporter-opencensus
; exporter-opencensus intentionally excluded from pypy3
; opentelemetry-exporter-otlp
py3{5,6,7,8}-test-exporter-otlp
; exporter-otlp intentionally excluded from pypy3
; opentelemetry-exporter-prometheus
py3{5,6,7,8}-test-exporter-prometheus
pypy3-test-exporter-prometheus
; opentelemetry-exporter-zipkin
py3{5,6,7,8}-test-exporter-zipkin
pypy3-test-exporter-zipkin
; opentelemetry-opentracing-shim
py3{5,6,7,8}-test-core-opentracing-shim
pypy3-test-core-opentracing-shim
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-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-example-app: docs/examples/opentelemetry-example-app/tests
test-core-getting-started: docs/getting_started/tests
test-core-opentracing-shim: instrumentation/opentelemetry-instrumentation-opentracing-shim/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
commands_pre =
; Install without -e to test the actual installation
py3{5,6,7,8}: 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-core-proto: pip install {toxinidir}/opentelemetry-proto
instrumentation: pip install {toxinidir}/opentelemetry-instrumentation
example-app: pip install {toxinidir}/opentelemetry-instrumentation {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-wsgi {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-flask {toxinidir}/docs/examples/opentelemetry-example-app
getting-started: pip install -e {toxinidir}/opentelemetry-instrumentation -e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests -e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-wsgi -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
jaeger: pip install {toxinidir}/exporter/opentelemetry-exporter-jaeger
opentracing-shim: pip install {toxinidir}/opentelemetry-sdk
opentracing-shim: pip install {toxinidir}/instrumentation/opentelemetry-instrumentation-opentracing-shim
zipkin: pip install {toxinidir}/exporter/opentelemetry-exporter-zipkin
; 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 =
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-grpc
-c dev-requirements.txt
asgiref
pylint
flake8
isort
black
psutil
readme_renderer
httpretty
commands_pre =
python scripts/eachdist.py install --editable --with-test-deps
commands =
python scripts/eachdist.py lint --check-only
[testenv:docs]
deps =
-e {toxinidir}/opentelemetry-python-contrib/exporter/opentelemetry-exporter-datadog
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-grpc
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-flask
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-django
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-wsgi
-c {toxinidir}/dev-requirements.txt
-r {toxinidir}/docs-requirements.txt
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-sdk
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-sdk \
-e {toxinidir}/opentelemetry-instrumentation \
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-requests \
-e {toxinidir}/opentelemetry-python-contrib/instrumentation/opentelemetry-instrumentation-wsgi
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-sdk \
-e {toxinidir}/tests/util \
-e {toxinidir}/exporter/opentelemetry-exporter-opencensus
docker-compose up -d
commands =
pytest {posargs}
commands_post =
docker-compose down -v