-
Notifications
You must be signed in to change notification settings - Fork 1
/
pyproject.toml
437 lines (374 loc) · 11.2 KB
/
pyproject.toml
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
[project]
name = "matrixctl"
version = "0.12.0"
description = "Control, manage, provision and deploy matrix homeservers."
authors = [{ name = "Michael Sasser", email = "[email protected]" }]
maintainers = [{ name = "Michael Sasser", email = "[email protected]" }]
readme = "README.md"
keywords = ["Matrix", "Synapse", "Docker"]
classifiers = [
"Development Status :: 3 - Alpha",
"Environment :: Console",
"Intended Audience :: Customer Service",
"Intended Audience :: Developers",
"Intended Audience :: Other Audience",
"Intended Audience :: System Administrators",
"License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)",
"Natural Language :: English",
"Operating System :: POSIX",
"Operating System :: POSIX :: Linux",
"Operating System :: Unix",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Utilities",
"Typing :: Typed",
]
dependencies = [
"GitPython>=3.1.43,<4.0.0",
"coloredlogs>=15.0.1,<16.0.0",
"paramiko>=3.4.0,<4.0.0",
"ruamel.yaml>=0.18.6",
"ansible-runner>=2.4.0,<3.0.0",
"attrs>=23.2.0",
"xdg>=6.0.0,<7.0.0",
"Jinja2>=3.1.4,<4.0.0",
"psycopg>=3.1.19,<4.0.0",
"httpx[http2]>=0.27.2",
"sshtunnel>=0.4.0,<0.5.0",
"rich>=13.8.0,<14.0.0",
]
requires-python = ">=3.10,<4.0"
[project.urls]
Homepage = "https://michaelsasser.github.io/matrixctl/index.html"
Documentation = "https://michaelsasser.github.io/matrixctl/index.html"
Repository = "https://github.com/MichaelSasser/matrixctl"
Issues = "https://github.com/MichaelSasser/matrixctl/issues"
Changelog = "https://github.com/MichaelSasser/matrixctl/blob/main/CHANGELOG.md"
[tool.rye]
managed = true
universal = true
generate-hashes = true
dev-dependencies = [
# Typesheds
"types-setuptools>=75.1.0.20240917",
"types-paramiko>=3.4.0.20240423,<4.0.0.0",
"types-attrs>=19.1.0,<20.0.0",
"types-Jinja2>=2.11.9,<3.0.0",
"towncrier>=24.8.0",
"ruff>=0.6.8",
"pytest>=8.3.3",
"coverage>=7.6.1",
"tox>=4.20.0",
"pre-commit>=3.8.0",
"basedpyright>=1.18.2",
"git-cliff>=2.6.1",
]
[project.optional-dependencies]
docs = [
"sphinx>=8.0.0,<9.0.0",
"sphinx-autodoc-typehints>=1.2.2,<3.0",
"sphinxcontrib-programoutput>=0.17",
"numpydoc>=1.5.0",
"sphinx-rtd-theme>=3.0,<4.0",
"myst-parser>=4.0.0",
"tomli>=2.0.2; python_version < '3.11'",
"exceptiongroup>=1.2.2; python_version < '3.11'",
]
[tool.rye.scripts]
# Application entry points
matrixctl = { call = "matrixctl.__main__:main" }
doc = { cmd = "sphinx-build -T -W -b html docs/source docs/build/html" }
# Linting
check = { chain = ["check:lint", "check:fmt"] }
"check:lint" = "rye lint"
"check:fmt" = "rye fmt --check"
"check:type" = "rye run basedpyright"
fix = { chain = ["fix:lint", "fix:fmt"] }
"fix:lint" = "rye lint --fix"
"fix:fmt" = "rye fmt"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["src/matrixctl"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.ruff]
line-length = 79
cache-dir = "~/.cache/ruff"
fix = true
src = ["src/matrixctl", "docs", "tests"]
show-fixes = true
target-version = "py310"
exclude = [
".git",
".mypy_cache",
".nox",
".pytype",
".ruff_cache",
".tox",
".venv",
"__pypackages__",
"_build",
"buck-out",
"build",
"dist",
"venv",
]
[tool.ruff.format]
docstring-code-format = true
quote-style = "double"
indent-style = "space"
[tool.ruff.lint]
task-tags = ["TODO", "FIXME", "WARN", "SEC", "SECURITY", "INFO", "NOTE"]
ignore = [
"D202",
"D203",
"TCH003",
"TCH001",
"ANN401",
"ANN101",
"T201", # Print statements
"TD002", # Missing TODO author
"TD003", # Missing TODO issue link
"FIX002", # Unresolved TODO
"PERF203", # Try/except in loop
"COM812",
"ISC001",
]
select = ["ALL"]
[tool.ruff.lint.flake8-annotations]
allow-star-arg-any = true
suppress-dummy-args = true
# suppress-none-returning = true
[tool.ruff.lint.flake8-bandit]
check-typed-exception = true
[tool.ruff.lint.flake8-copyright]
author = "Michael Sasser <[email protected]>"
min-file-size = 512
[tool.ruff.lint.flake8-import-conventions]
banned-from = ["typing"]
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
"typing" = "t"
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.mccabe]
# Unlike Flake8, default to a complexity level of 10.
max-complexity = 10
[tool.ruff.lint.isort]
force-single-line = true
lines-after-imports = 2
constants = ["__version__"]
forced-separate = ["tests", "matrixctl"]
required-imports = ["from __future__ import annotations"]
known-first-party = ["matrixctl"]
lines-between-types = 1
known-third-party = [
"pytest",
"paramiko",
"argcomplete",
"coloredlogs",
"sphinx_rtd_theme",
"git",
"httpx",
"attr",
"ansible_runner",
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = ["S101"]
"docs/*" = ["INP001"]
[tool.mypy]
python_version = "3.11"
platform = "linux"
ignore_missing_imports = true
strict_equality = true
strict = true
show_traceback = true
# CI output differs from local
warn_unused_ignores = false # workaround see PR: 308
[[tool.mypy.overrides]]
module = "tests.matrixctl.handlers.*"
allow_untyped_decorators = true # pytest fixtures
[tool.pyright]
include = ["src/matrixctl", "tests"]
exclude = ["**/__pycache__"]
reportMissingImports = true
reportMissingTypeStubs = false
pythonVersion = "3.11"
pythonPlatform = "Linux"
typeCheckingMode = "basic"
# reportUnknownVariableType ="none"
# reportUnknownMemberType ="none"
# reportUnknownParameterType = "none"
# reportUnknownArgumentType = "none"
# reportUnknownLambdaType = "none"
[tool.pycln]
all = true
[tool.flake8]
max-line-length = 79
# max-complexity = 12
ignore = "E501"
select = "C,E,F,W,B,B901"
[tool.interrogate]
ignore-init-method = true
ignore-init-module = true
ignore-magic = true
# ignore-semiprivate = false
# ignore-private = false
# ignore-property-decorators = false
# ignore-module = false
fail-under = 100
exclude = ["setup.py", "docs", "build"]
# ignore-regex = ["^get$", "^mock_.*", ".*BaseClass.*"]
# ignore-regex see: https://github.com/econchick/interrogate/issues?q=is%3Aissue+overload
ignore-regex = ["request", "exec_async_request"]
verbose = 1
# quiet = false
# whitelist-regex = []
# color = true
[tool.vulture]
make_whitelist = true
min_confidence = 80
paths = ["src/matrixctl"]
sort_by_size = true
[tool.coverage.report]
exclude_also = ["@t.overload", "pragma: no cover"]
[tool.git-cliff.changelog]
# DOCS: https://git-cliff.org/docs/configuration
header = """
# Changelog\n
All notable changes to MatrixCtl will be documented in this file.\n
You can find the issue tracker on
[GitHub](https://github.com/MichaelSasser/matrixctl/issues).
"""
# DOCS: https://keats.github.io/tera/docs/#introduction
body = """
{% if version %}\
## {{ version | trim_start_matches(pat="v") }} - {{ timestamp | date(format="%Y-%m-%d") }}
{% else %}\
## Unreleased
{% endif %}\
{% for group, commits in commits | filter(attribute="merge_commit", value=false) | group_by(attribute="group") %}
### {{ group | striptags | trim | upper_first }}
{% for group, commits in commits | filter(attribute="merge_commit", value=false) | group_by(attribute="scope") %}
#### {{ group | striptags | trim | upper_first }}
{% for commit in commits | unique(attribute="message") %}
- {{ commit.message | upper_first }}\
{% endfor %}
{% endfor %}\
{% endfor %}\n
"""
footer = """
<!-- generated by git-cliff -->
"""
trim = true
postprocessors = [
{ pattern = '<REPO>', replace = "https://github.com/MichaelSasser/matrixctl" }, # replace repository URL
]
# render body even when there are no releases to process
# render_always = true
# output file path
# output = "CHANGELOG.md"
[tool.git-cliff.git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = true
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [
# Replace issue numbers
{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "([#${2}](<REPO>/issues/${2}))" },
# Check spelling of the commit with https://github.com/crate-ci/typos
# If the spelling is incorrect, it will be automatically fixed.
# { pattern = '.*', replace_command = 'typos --write-changes -' },
]
# regex for parsing and grouping commits
commit_parsers = [
{ message = "^breaking", group = "<!-- 0 --> 🏗️ Breaking changes" },
{ message = "^security", group = "<!-- 1 -->🛡️ Security" },
{ body = ".*security", group = "<!-- 1 -->🛡️ Security" },
{ message = "^feat", group = "<!-- 2 -->🚀 Features" },
{ message = "^fix", group = "<!-- 3 -->🐛 Bug Fixes" },
{ message = "^doc", group = "<!-- 4 -->📚 Documentation" },
{ message = "^perf", group = "<!-- 5 -->⚡ Performance" },
{ message = "^refactor", group = "<!-- 6 -->🚜 Refactor" },
{ message = "^style", group = "<!-- 7 -->🎨 Styling" },
{ message = "^test", group = "<!-- 8 -->🧪 Testing" },
{ message = "^revert", group = "<!-- 9 -->◀️ Revert" },
{ message = "^chore|^ci", group = "<!-- 10 -->⚙️ Miscellaneous Tasks" },
{ message = "^chore\\(release\\): prepare for", skip = true },
{ message = "^chore\\(deps.*\\)", skip = true },
{ message = "^chore\\(pr\\)", skip = true },
{ message = "^chore\\(pull\\)", skip = true },
{ message = "^misc\\(dependencies\\)", skip = true },
]
# filter out the commits that are not matched by commit parsers
filter_commits = true
# sort the tags topologically
topo_order = false
# sort the commits inside sections by oldest/newest order
sort_commits = "oldest"
[tool.tox]
legacy_tox_ini = """
[pytest]
addopts = -ra
testpaths = tests
xfail_strict = true
filterwarnings =
once::Warning
ignore:::pympler[.*]
# Keep docs in sync with docs env and .readthedocs.yml.
# [gh-actions]
# python =
# 3.10: py39, precommit, changelog, docs
# # 3.10: py310
[tox]
rye_discovery = true
envlist = precommit,py310,py311,py312,docs,changelog,
isolated_build = True
[coverage:report]
exclude_also =
@t.overload
pragma: no cover
[testenv]
allowlist_externals = rye
# Prevent random setuptools/pip breakages like
# https://github.com/pypa/setuptools/issues/1042 from breaking our builds.
setenv =
VIRTUALENV_NO_DOWNLOAD=1
extras = {env:TOX_AP_TEST_EXTRAS:tests}
commands =
rye sync --all-features
rye run coverage run -m pytest --doctest-modules {posargs}
[testenv:precommit]
allowlist_externals = rye
basepython = python3.12
skip_install = true
deps =
pre-commit
passenv = HOMEPATH # needed on Windows
commands =
rye sync --all-features
rye run pre-commit run --all-files
[testenv:docs]
allowlist_externals = rye
# Keep basepython in sync with gh-actions and .readthedocs.yml.
basepython = python3.12
# extras = docs, func
# currently disable -n
commands =
rye sync --all-features
rye run sphinx-build -T -W -b html -d {envtmpdir}/doctrees docs/source docs/build/html
[testenv:changelog]
allowlist_externals = rye
basepython = python3.12
# deps = towncrier
skip_install = true
commands =
rye sync --all-features
rye run git-cliff --unreleased
"""