-
Notifications
You must be signed in to change notification settings - Fork 649
/
tox.ini
239 lines (195 loc) · 7.21 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
[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-example-app
py3{4,5,6,7,8}-test-example-app
pypy3-test-example-app
; examples/basic_tracer
py3{4,5,6,7,8}-test-example-basic-tracer
pypy3-test-example-basic-tracer
; examples/http
py3{4,5,6,7,8}-test-example-http
pypy3-test-example-http
; 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-http-requests
py3{4,5,6,7,8}-test-ext-http-requests
pypy3-test-ext-http-requests
; opentelemetry-ext-jaeger
py3{4,5,6,7,8}-test-ext-jaeger
pypy3-test-ext-jaeger
; opentelemetry-ext-mysql
py3{4,5,6,7,8}-test-ext-mysql
pypy3-test-ext-mysql
; 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-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
py3{4,5,6,7,8}-coverage
; Coverage is temporarily disabled for pypy3 due to the pytest bug.
; pypy3-coverage
lint
py38-tracecontext
py38-{mypy,mypyinstalled}
docs
docker-tests
[travis]
python =
3.8: py38, lint, 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-ext-http-requests: ext/opentelemetry-ext-http-requests/tests
test-ext-jaeger: ext/opentelemetry-ext-jaeger/tests
test-ext-dbapi: ext/opentelemetry-ext-dbapi/tests
test-ext-mysql: ext/opentelemetry-ext-mysql/tests
test-ext-pymongo: ext/opentelemetry-ext-pymongo/tests
test-ext-psycopg2: ext/opentelemetry-ext-psycopg2/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: examples/opentelemetry-example-app/tests
test-example-basic-tracer: examples/basic_tracer/tests
test-example-http: examples/http/tests
test-opentracing-shim: ext/opentelemetry-ext-opentracing-shim/tests
commands_pre =
; Install without -e to test the actual installation
python -m pip install -U pip setuptools wheel
test: pip install {toxinidir}/opentelemetry-api
test-sdk: pip install {toxinidir}/opentelemetry-sdk
example-app: pip install {toxinidir}/opentelemetry-sdk
example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests
example-app: pip install {toxinidir}/ext/opentelemetry-ext-wsgi
example-app: pip install {toxinidir}/ext/opentelemetry-ext-flask
example-app: pip install {toxinidir}/examples/opentelemetry-example-app
example-basic-tracer: pip install -e {toxinidir}/opentelemetry-api
example-basic-tracer: pip install -e {toxinidir}/opentelemetry-sdk
example-http: pip install -e {toxinidir}/opentelemetry-api
example-http: pip install -e {toxinidir}/opentelemetry-sdk
example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests
example-http: pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi
example-http: pip install -r {toxinidir}/examples/http/requirements.txt
ext: pip install {toxinidir}/opentelemetry-api
wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-testutil
wsgi,flask: pip install {toxinidir}/ext/opentelemetry-ext-wsgi
wsgi,flask: pip install {toxinidir}/opentelemetry-sdk
flask: pip install {toxinidir}/ext/opentelemetry-ext-flask[test]
dbapi: pip install {toxinidir}/ext/opentelemetry-ext-dbapi
mysql: pip install {toxinidir}/ext/opentelemetry-ext-dbapi
mysql: pip install {toxinidir}/ext/opentelemetry-ext-mysql
pymongo: pip install {toxinidir}/ext/opentelemetry-ext-pymongo
psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-dbapi
psycopg2: pip install {toxinidir}/ext/opentelemetry-ext-psycopg2
http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests
jaeger: pip install {toxinidir}/opentelemetry-sdk
jaeger: pip install {toxinidir}/ext/opentelemetry-ext-jaeger
opentracing-shim: pip install {toxinidir}/opentelemetry-sdk {toxinidir}/ext/opentelemetry-ext-opentracing-shim
zipkin: pip install {toxinidir}/opentelemetry-sdk
zipkin: pip install {toxinidir}/ext/opentelemetry-ext-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 =
-c dev-requirements.txt
pylint
flake8
isort
black
commands_pre =
python scripts/eachdist.py install --editable
commands =
python scripts/eachdist.py lint --check-only
[testenv:docs]
deps =
-c dev-requirements.txt
sphinx
sphinx-rtd-theme
sphinx-autodoc-typehints
opentracing~=2.2.0
Deprecated>=1.2.6
thrift>=0.10.0
pymongo ~= 3.1
flask~=1.0
changedir = docs
commands =
sphinx-build -E -a -W --keep-going -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}/ext/opentelemetry-ext-http-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
pymongo ~= 3.1
changedir =
ext/opentelemetry-ext-docker-tests/tests
commands_pre =
pip install -e {toxinidir}/opentelemetry-api \
-e {toxinidir}/opentelemetry-sdk \
-e {toxinidir}/ext/opentelemetry-ext-pymongo
- docker-compose up -d
commands =
pytest {posargs}
commands_post =
docker-compose down