forked from open-telemetry/opentelemetry-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tox.ini
98 lines (82 loc) · 3.12 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
[tox]
skipsdist = True
skip_missing_interpreters = True
envlist =
py3{4,5,6,7,8}-test-{api,sdk,example-app,ext-wsgi,ext-http-requests}
pypy3-test-{api,sdk,example-app,ext-wsgi,ext-http-requests}
lint
py37-{mypy,mypyinstalled}
docs
[travis]
python =
3.7: py37, lint, docs
[testenv]
deps =
mypy,mypyinstalled: mypy~=0.711
setenv =
mypy: MYPYPATH={toxinidir}/opentelemetry-api/src/
changedir =
test-api: opentelemetry-api/tests
test-sdk: opentelemetry-sdk/tests
test-example-app: opentelemetry-example-app/tests
test-ext-wsgi: ext/opentelemetry-ext-wsgi/tests
test-ext-http-requests: ext/opentelemetry-ext-http-requests/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-wsgi
example-app: pip install {toxinidir}/ext/opentelemetry-ext-http-requests
example-app: pip install {toxinidir}/opentelemetry-example-app
ext: pip install {toxinidir}/opentelemetry-api
wsgi: pip install {toxinidir}/ext/opentelemetry-ext-wsgi
http-requests: pip install {toxinidir}/ext/opentelemetry-ext-http-requests
; 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: python -m unittest discover
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.7
deps =
pylint~=2.3
flake8~=3.7
isort~=4.3
black>=19.3b0,==19.*
commands_pre =
pip install -e {toxinidir}/opentelemetry-api
pip install -e {toxinidir}/opentelemetry-sdk
pip install -e {toxinidir}/ext/opentelemetry-ext-wsgi
pip install -e {toxinidir}/ext/opentelemetry-ext-http-requests
pip install -e {toxinidir}/opentelemetry-example-app
commands =
; Prefer putting everything in one pylint command to profit from duplication
; warnings.
black --check --diff .
pylint opentelemetry-api/src/opentelemetry \
opentelemetry-api/tests/ \
opentelemetry-sdk/src/opentelemetry \
opentelemetry-sdk/tests/ \
ext/opentelemetry-ext-http-requests/src/ \
ext/opentelemetry-ext-http-requests/tests/ \
ext/opentelemetry-ext-wsgi/tests/ \
opentelemetry-example-app/src/opentelemetry_example_app/ \
opentelemetry-example-app/tests/
flake8 .
isort --check-only --diff --recursive .
[testenv:docs]
deps =
sphinx~=2.1
sphinx-rtd-theme~=0.4
sphinx-autodoc-typehints~=1.6
changedir = docs
commands =
sphinx-build -W --keep-going -b html -T . _build/html