-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.cfg
187 lines (168 loc) · 5.47 KB
/
setup.cfg
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
[flake8]
max-line-length = 120
max-complexity = 18
ignore = E203, E266, W503
docstring-convention = google
per-file-ignores = __init__.py:F401
exclude = .git,
__pycache__,
setup.py,
build,
dist,
docs,
releases,
.venv,
.tox,
.mypy_cache,
.pytest_cache,
.vscode,
.github,
# By default test codes will be linted.
# tests
[mypy]
ignore_missing_imports = True
show_error_codes = True
[darglint]
strictness=full
docstring_style=google
message_template={path}:{line} @{obj} {msg_id}: {msg}
[tool:pytest]
testpaths = tests
addopts =
--cov
--cov-report=term-missing
--cov=broadlink_listener
--cov-append
[coverage:run]
# uncomment the following to omit files during running
#omit =
# path/folder/file
# path/folder/*
branch = True
[coverage:report]
show_missing = True
exclude_lines =
pragma: no cover
def __repr__
if self.debug:
if settings.DEBUG
raise AssertionError
raise NotImplementedError
if 0:
if __name__ == .__main__.:
def main
[coverage:html]
directory = coverage_html
show_contexts = True
[gh-actions]
python =
3.9: py39, format, lint, build
[tox:tox]
isolated_build = true
min_version = 2.0 # platform specification support is available since version 2.0
envlist = lint, format, {py3.8, py3.9, py3.10, py3.11}-{lin,mac,win}
[dev]
allowlist_externals =
poetry
python
commands =
poetry run python --version
# python --version
poetry lock --no-update
poetry install -v --with devel --no-root --sync
poetry run tox --version
poetry run pip --version
poetry run pip list --format=freeze
[testenv]
# environment will be skipped if regular expression does not match against the sys.platform string
platform = lin: linux
mac: darwin
win: win32
allowlist_externals =
{[dev]allowlist_externals}
passenv = *
setenv =
{py3.8}-{lin, mac}: PYTH = python3.8
{py3.9}-{lin, mac}: PYTH = python3.9
{py3.10}-{lin, mac}: PYTH = python3.10
{py3.11}-{lin, mac}: PYTH = python3.11
{py3.8, py3.9, py3.10, py3.11}-{win}: PYTH = python
{py3.8, py3.9, py3.10, py3.11}: COVERAGE_FILE = .coverage_{envname}
PYTHONPATH = {toxinidir}
PYTHONWARNINGS = ignore
commands =
#poetry install -v
py3.8: poetry env use {env:PYTH}
py3.9: poetry env use {env:PYTH}
py3.10: poetry env use {env:PYTH}
py3.11: poetry env use {env:PYTH}
poetry run python --version
{[dev]commands}
poetry run pytest {posargs:-vv} --cov-report=html:html_coverage_{envname} --cov-report=xml:xml_coverage_{envname}.xml
[testenv:format]
description = Format the code
ignore_errors = True
allowlist_externals =
{[dev]allowlist_externals}
commands =
{[dev]commands}
poetry run isort broadlink_listener tests
poetry run black broadlink_listener tests
[testenv:license]
description = License files according to REUSE 3.0
allowlist_externals =
{[dev]allowlist_externals}
commands =
poetry run reuse annotate --license=MIT --copyright="Gabriele Pongelli" --year="2022" $(find ./broadlink_listener ./tests ./docs -name "*.py")
poetry run reuse annotate --license=MIT --copyright="Gabriele Pongelli" --year="2022" --force-dot-license $(find ./broadlink_listener ./tests ./docs -name "*.json")
poetry run reuse annotate --license=MIT --copyright="Gabriele Pongelli" --year="2022" $(find ./.github \( -name "*.yml" -o -name "*.md" \) )
poetry run reuse annotate --license=MIT --copyright="Gabriele Pongelli" --year="2022" --style python ./.editorconfig ./.gitignore ./. yamllint ./.pre-commit-config.yaml
poetry run reuse annotate --license=MIT --copyright="Gabriele Pongelli" --year="2022" ./docs/Makefile ./docs/make.bat ./pyproject.toml
poetry run reuse annotate --license=MIT --copyright="Gabriele Pongelli" --year="2022" --force-dot-license $(find . -maxdepth 1 -name "*.rst" -o -name "*.md" -o -name "*.lock" -o -name "*.cfg" )
poetry run reuse annotate --license=MIT --copyright="Gabriele Pongelli" --year="2023" --force-dot-license $(find ./docs -name "*.rst")
poetry run reuse download --all
sed -i '' -e 's/<year>/2022/g;s/<copyright holders>/Gabriele Pongelli/g' LICENSES/MIT.txt
# Windows Call
# poetry run reuse annotate --license=MIT --copyright="Gabriele Pongelli" --year="2023" --force-dot-license $(Get-ChildItem .\tests\*.png)
[testenv:lint]
description = Lint the code
ignore_errors = True
allowlist_externals =
{[dev]allowlist_externals}
commands =
{[dev]commands}
poetry run flake8 broadlink_listener tests
poetry run mypy --install-types broadlink_listener tests
poetry run yamllint -f colored broadlink_listener
poetry run codespell broadlink_listener docs/source
poetry run pylint broadlink_listener
poetry run darglint -v 2 broadlink_listener
poetry run bandit -r broadlink_listener
poetry run reuse lint
poetry run python-active-versions
poetry run check-python-versions .
[testenv:build]
description = Build package
allowlist_externals =
{[dev]allowlist_externals}
commands =
{[dev]commands}
poetry build
poetry run twine check dist/*
[testenv:docs]
description = Build docs
allowlist_externals =
{[dev]allowlist_externals}
commands =
{[dev]commands}
poetry run sphinx-build -b html docs/source/ docs/build/html
[testenv:release]
description = Run release task
skip_install = true
allowlist_externals =
{[dev]allowlist_externals}
commands =
{[dev]commands}
poetry run cz bump --changelog
poetry build
# poetry publish -r ...