/
tox.ini
139 lines (118 loc) · 2.92 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
# A tox config file for afkak
[tox]
minversion = 3.3.0
isolated_build = true
envlist =
py39-lint,
{py37,py38,py39}-{unit,unit-snappy-murmur},
py39-int-snappy-murmur,
pypy3-{unit,unit-snappy},
fmt
[testenv]
setenv =
PROJECT_ROOT={toxinidir}
PYTHONWARNINGS=all,ignore::ImportWarning,ignore::DeprecationWarning,ignore::PendingDeprecationWarning
LC_ALL=C.UTF-8
PIP_DISABLE_VERSION_CHECK=y
VIRUALENV_NO_DOWNLOAD=y
AFKAK_TEST_LOG={envtmpdir}/test.log
PIP_INDEX_URL=https://pypi.org/simple
allowlist_externals = {toxinidir}/tools/download-kafka
passenv =
AFKAK_TWISTED_DEBUG
int: KAFKA_VERSION
CPPFLAGS
LANG
TRAVIS
extras =
snappy: snappy
murmur: FastMurmur2
deps =
coverage==4.0.1
Twisted>=21.2.0
pytest
pytest-twisted
lint: ruff
lint: isort
commands =
int: {toxinidir}/tools/download-kafka {env:KAFKA_VERSION}
# Prefix the test command when coverage is requested. Note the trailing
# backslash: it is important!
coverage: coverage run --parallel --branch --source afkak \
# Run the unit tests. The integration tests will auto-skip because the
# KAFKA_VERSION environment variable isn't set.
unit: {envbindir}/trial {posargs:afkak.test}
# Run just the integration tests
int: {envbindir}/pytest -v -s {posargs: --pyargs afkak.test.int}
lint: ruff check afkak
lint: isort --check-only afkak
[testenv:cov_erase]
description = Clear any accumulated .coverage.* files.
skip_install = true
commands =
coverage erase
[testenv:cov_report]
description = Combine coverage reports from any unit or int test runs since the last time coverase was run.
skip_install = true
commands =
coverage combine
coverage report
coverage html -d {toxinidir}/htmlcov
[testenv:docs]
basepython = python3.9
deps =
Sphinx~=5.1.1
changedir = docs
allowlist_externals = {toxinidir}/tools/download-intersphinx
commands =
{toxinidir}/tools/download-intersphinx
sphinx-build -b html -d {envtmpdir}/doctrees . html
[testenv:twine]
basepython = python3.9
deps =
twine
readme_renderer[md]
commands = {posargs}
[testenv:fmt]
deps =
black
isort
commands =
isort afkak
black afkak
[flake8]
doctests = yes
max-line-length = 120
ignore =
# Don't require a comma after **kw call syntax because that isn't valid in Python 2.7:
C815,
# Stacklevel keyword argument
B028,
# Ignore a few whitespace issues for now to avoid churn.
E226, E241,
# Whiplash
W503, W504,
# black compatibility
E203,
jobs = auto
[isort]
profile = black
default_section = LOCALFOLDER
known_first_party = afkak
multi_line_output = 3
include_trailing_comma = True
force_grid_wrap = 0
use_parentheses = True
ensure_newline_before_comments = True
line_length = 120
[gh-actions]
python =
3.7: py37
3.8: py38
3.9: py39
pypy-3: pypy3
[gh-actions:env]
TOX_SUITE =
lint: lint
unit: unit
int: int