forked from K1rL3s/maxo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
228 lines (214 loc) · 7.96 KB
/
Copy pathpyproject.toml
File metadata and controls
228 lines (214 loc) · 7.96 KB
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
[build-system]
requires = ["uv_build==0.9.13"]
build-backend = "uv_build"
[project]
name = "maxo"
description = "Asynchronous framework for MAX.ru bots"
version = "0.5.3"
readme = "README.md"
license = { file = "LICENSE" }
authors = [
{ name = "K1rL3s - Kirill Lesovoy", email = "kirill.lesovoi@mail.ru" },
{ name = "Ivan Kirpichnikov" },
]
maintainers = [{ name = "K1rL3s - Kirill Lesovoy", email = "kirill.lesovoi@mail.ru" }]
classifiers = [
"License :: OSI Approved :: Apache Software License",
"Development Status :: 4 - Beta",
"Environment :: Console",
"Framework :: AsyncIO",
"Framework :: aiohttp",
"Typing :: Typed",
"Operating System :: OS Independent",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Application Frameworks",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Communications :: Chat",
]
requires-python = ">=3.12,<3.15"
dependencies = [
"unihttp[aiohttp]>=0.2.6,<0.3.0",
"anyio>=4.0.0,<5.0.0",
"cachetools>=4.0.0,<7.0.0",
"jinja2>=3.0.0,<4.0.0",
"adaptix==3.0.0b12",
"typing-extensions>=4.12.0,<5.0.0"
]
[project.optional-dependencies]
magic_filter = ["magic_filter>=1.0.0,<2.0.0"]
dishka = ["dishka>=1.0.0,<2.0.0"]
redis = ["redis[hiredis]>=5.0.1,<8.0.0"]
fastapi = ["fastapi>=0.128.0,<1.0.0"]
preview = ["diagrams>=0.25.1,<1.0.0"]
[project.scripts]
maxo-dialog-preview = "maxo.dialogs.tools.web_preview:main"
[dependency-groups]
docs = [
"sphinx>=8.2,<10.0",
"sphinx-autodoc-typehints>=3.0.0,<4.0.0",
"sphinx-iconify>=0.3,<0.4",
"sphinx-tabs>=3.4,<4",
"sphinx-contributors>=0.2,<0.3",
"sphinx-copybutton>=0.5,<0.6",
"sphinx-design>=0.6, <0.8",
"sphinxcontrib-mermaid>=2.0,<3",
"myst-parser>=5.0,<6",
"shibuya>=2026.1",
# TODO: remove when `sphinx-tabs` is fixed:
# https://github.com/executablebooks/sphinx-tabs/issues/212
"docutils==0.21.2",
]
tests = [
"pytest==9.0.2",
"pytest-asyncio==1.3.0",
"pytest-cov==7.0.0",
"pytest-repeat==0.9.4",
"nox==2026.2.9",
"nox-uv==0.7.1",
"pytest-aiohttp==1.0.5",
"httpx==0.27.0",
]
lint = [
"mypy==1.19.0",
"ruff==0.14.5",
"codespell==2.4.1",
"bandit==1.9.1",
"slotscheck==0.19.1",
"black==25.11.0",
]
dev = [
{ include-group = "lint" },
{ include-group = "tests" },
{ include-group = "docs" },
"maxo[magic_filter,dishka,redis,fastapi]"
]
[project.urls]
Documentation = "https://maxo.rtfd.io"
Repository = "https://github.com/K1rL3s/maxo"
[tool.mypy]
files = ["src/maxo", "tests", "examples"]
namespace_packages = false
exclude = "(^|/)docs/_build/"
strict = true
strict_bytes = true
local_partial_types = true
ignore_missing_imports = true
warn_unreachable = true
enable_error_code = [
"truthy-bool",
"truthy-iterable",
"redundant-expr",
"unused-awaitable",
"ignore-without-code",
"possibly-undefined",
"redundant-self",
"mutable-override",
"unimported-reveal",
"deprecated",
]
[tool.ruff]
src = ["src", "examples"]
fix = true
line-length = 88
indent-width = 4
target-version = "py312"
exclude = ["docs/conf.py"]
[tool.ruff.lint]
select = [
"ALL",
]
ignore = [
"RUF001", # https://docs.astral.sh/ruff/rules/ambiguous-unicode-character-string/
"RUF002", # https://docs.astral.sh/ruff/rules/ambiguous-unicode-character-docstring/
"RUF003", # https://docs.astral.sh/ruff/rules/ambiguous-unicode-character-comment/
"C901", # https://docs.astral.sh/ruff/rules/complex-structure/
# todo pydocstyle
"D100",
"D101",
"D102",
"D103",
"D104", # missing docstring in public package
"D105", # missing docstring in magic methods
"D106", # missing docstring in public nested class
"D107", # missing docstring in __init__
"D212",
"D203",
"ARG001", # https://docs.astral.sh/ruff/rules/unused-function-argument/
"ARG002", # https://docs.astral.sh/ruff/rules/unused-method-argument/
"ANN401", # https://docs.astral.sh/ruff/rules/any-type/
"EM", # https://docs.astral.sh/ruff/rules/#flake8-errmsg-em
"FIX", # https://docs.astral.sh/ruff/rules/#flake8-fixme-fix
"TD001", # https://docs.astral.sh/ruff/rules/invalid-todo-tag/
"TD002", # https://docs.astral.sh/ruff/rules/missing-todo-author/
"TD003", # https://docs.astral.sh/ruff/rules/missing-todo-link/
"FBT001", # https://docs.astral.sh/ruff/rules/boolean-type-hint-positional-argument/
"FBT002", # https://docs.astral.sh/ruff/rules/boolean-default-value-positional-argument/
"TRY003", # https://docs.astral.sh/ruff/rules/raise-vanilla-args/
"ANN401", # https://docs.astral.sh/ruff/rules/any-type/
"ASYNC109", # own timeout implementation
"TC001", # https://docs.astral.sh/ruff/rules/typing-only-first-party-import/
"TC006", # https://docs.astral.sh/ruff/rules/runtime-cast-value/
"UP046", # https://docs.astral.sh/ruff/rules/non-pep695-generic-class/
"UP047", # https://docs.astral.sh/ruff/rules/non-pep695-generic-function/
"PLR0904", # https://docs.astral.sh/ruff/rules/too-many-public-methods/
"PLR0911", # https://docs.astral.sh/ruff/rules/too-many-return-statements/
"PLR0912", # https://docs.astral.sh/ruff/rules/too-many-branches/
"PLR0913", # https://docs.astral.sh/ruff/rules/too-many-arguments/
"PLR0914", # https://docs.astral.sh/ruff/rules/too-many-locals/
"PLR0915", # https://docs.astral.sh/ruff/rules/too-many-statements/
"PLR0916", # https://docs.astral.sh/ruff/rules/too-many-boolean-expressions/
"PLR0917", # https://docs.astral.sh/ruff/rules/too-many-positional-arguments/
"PLR1702", # https://docs.astral.sh/ruff/rules/too-many-nested-blocks/
"PLR6301", # https://docs.astral.sh/ruff/rules/no-self-use/
"A001", # https://docs.astral.sh/ruff/rules/builtin-variable-shadowing/
"A002", # https://docs.astral.sh/ruff/rules/builtin-argument-shadowing/
"A003", # https://docs.astral.sh/ruff/rules/builtin-attribute-shadowing/
"A006", # https://docs.astral.sh/ruff/rules/builtin-lambda-argument-shadowing/
"N818", # https://docs.astral.sh/ruff/rules/error-suffix-on-exception-name/
"B008", # https://docs.astral.sh/ruff/rules/function-call-in-default-argument/
"S311", # https://docs.astral.sh/ruff/rules/suspicious-non-cryptographic-random-usage/#suspicious-non-cryptographic-random-usage-s311
"PLR1704", # https://docs.astral.sh/ruff/rules/redefined-argument-from-local/
"PLW2901", # https://docs.astral.sh/ruff/rules/redefined-loop-name/
"ERA001", # https://docs.astral.sh/ruff/rules/commented-out-code/ # Удалить после починки всего
"UP040", # https://docs.astral.sh/ruff/rules/non-pep695-type-alias/ # Адаптикс с ним не работает
"TC003", # https://docs.astral.sh/ruff/rules/typing-only-standard-library-import/
]
[tool.ruff.lint.per-file-ignores]
"tests/**/*.py" = [
"S101", # assert
"ANN", # type annotations
"D", # docstrings
"ASYNC", # async правила
"E501", # длинные строки
"PLR", # complexity
"FBT003",
"SLF001",
]
"examples/**/*.py" = ["T201", "D", "TID252"]
"src/maxo/types/*.py" = ["E501", "D", "W291", "W293"]
"src/maxo/enums/*.py" = ["E501", "D", "W291", "W293"]
"src/maxo/bot/methods/*.py" = ["E501", "D", "W291", "W293"]
"src/maxo/routing/updates/*.py" = ["E501", "D"]
"src/maxo/dialogs/test_tools/**/*.py" = ["S101"]
"src/maxo/serialization.py" = ["PLW0603"]
[tool.ruff.lint.isort]
case-sensitive = true
combine-as-imports = true
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
skip-magic-trailing-comma = false
line-ending = "auto"
[tool.black]
line-length = 88
target-version = ["py312"]
include = 'src/.*\.py$|tests/.*\.py$|examples/.*\.py$'
[tool.pytest.ini_options]
log_cli = true
log_cli_level = "DEBUG"
asyncio_mode = "strict"