forked from spotify/klio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtox.ini
93 lines (81 loc) · 3.03 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
[tox]
envlist = py37,py38,docs,manifest,check-formatting,lint
[testenv]
install_command = python -m pip install {opts} {packages}
extras = tests
commands =
coverage run -m pytest {posargs}
; assert that protos are compiled
/usr/bin/env bash -c "if [ ! -f {toxinidir}/src/klio_core/proto/v1beta1/klio_pb2.py ]; then echo 'Error! Compiled protobuf files are missing. Run `tox -e protoc` to fix.'; false ; else echo 'Success! Found compiled protobuf files.'; fi"
/usr/bin/env bash -c "if [ ! -f {toxinidir}/src/klio_core/proto/klio_pb2.py ]; then echo 'Error! Compiled protobuf files are missing. Run `tox -e protoc` to fix.'; false ; else echo 'Success! Found compiled protobuf files.'; fi"
[testenv:protoc]
whitelist_externals = protoc
; this otherwise inherits from [testenv]
deps =
skip_install = true
commands =
protoc --proto_path {toxinidir}/src/klio_core/proto/ {toxinidir}/src/klio_core/proto/klio.proto --python_out {toxinidir}/src/klio_core/proto/
[testenv:docs]
basepython = python3.7
extras = docs
; this otherwise inherits from [testenv]
deps =
commands =
interrogate src --ignore-init-module --ignore-init-method \
--ignore-semiprivate --ignore-private \
--verbose --fail-under 0
interrogate tests --ignore-init-module --ignore-init-method \
--ignore-semiprivate --ignore-private \
--fail-under 0 --verbose
[testenv:manifest]
basepython = python3.7
deps = check-manifest
skip_install = true
commands = check-manifest
; This env just runs `black` and fails tox if it's not formatted correctly.
; If this env fails, run `tox -e format` locally in order to apply changes.
[testenv:check-formatting]
basepython = python3.7
deps = black==19.10b0
skip_install = true
commands =
black src/klio_core tests --line-length 79 --exclude "klio_pb2.py" --diff --check
[testenv:format]
basepython = python3.7
deps = black==19.10b0
skip_install = true
commands =
black --line-length 79 src/klio_core tests --exclude "klio_pb2.py"
[testenv:lint]
basepython = python3.7
deps =
flake8
flake8-import-order
apache-license-check
skip_install = true
commands =
flake8
apache-license-check src tests setup.py --include-empty --copyright 'Spotify AB' --exclude src/klio_core/proto/klio_pb2.py
; tool-specific config below
[flake8]
show-source = true
max-line-length = 80
exclude = .venv,.tox,.git,dist,doc,*.egg,build,*_pb2.py
# comply with black
ignore = E203, W503
import-order-style = edited
application-import-names = klio_core,tests
application-package-names = transforms
[pytest]
addopts = -v --cov=klio_core --cov-report=xml:cobertura/coverage.xml --cov-report=term-missing
testpaths = tests
filterwarnings =
; 3rd party libraries haven't updated their string escaping (py36+)
ignore:invalid escape sequence:DeprecationWarning
; 3rd party libraries haven't updated their use of collections.abc (py37+)
ignore:Using or importing the ABCs from:DeprecationWarning
; required for mapping envs -> github runtimes
[gh-actions]
python =
3.7: py37, docs, manifest, check-formatting,lint
3.8: py38