-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
pyproject.toml
218 lines (195 loc) · 5.85 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
[project]
name = "alicebot"
version = "0.11.0"
description = "A simply asynchronous python chatbot framework."
authors = [{ name = "st1020", email = "[email protected]" }]
license = { text = "MIT" }
readme = "README.md"
keywords = ["bot", "chatbot", "qq", "qqbot", "cqhttp", "coolq"]
classifiers = [
"Development Status :: 3 - Alpha",
"Framework :: AsyncIO",
"Framework :: Robot Framework",
"Framework :: Robot Framework :: Library",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Topic :: Communications :: Chat",
]
requires-python = ">=3.9"
dependencies = [
"tomli>=2.0.0,<3.0.0;python_version<'3.11'",
"pydantic>=2.0.3,<3.0.0",
"aiohttp>=3.8.0,<4.0.0",
"structlog>=24.1.0,<25.0.0",
"rich>=13.7.0,<14.0.0",
"typing-extensions>=4.5.0",
"anyio>=4.4.0,<5.0.0",
]
[project.optional-dependencies]
cqhttp = ["alicebot-adapter-cqhttp"]
onebot = ["alicebot-adapter-onebot"]
mirai = ["alicebot-adapter-mirai"]
dingtalk = ["alicebot-adapter-dingtalk"]
telegram = ["alicebot-adapter-telegram"]
apscheduler = ["alicebot-adapter-apscheduler"]
hot_reload = ["watchfiles>=0.24"]
all = [
"alicebot-adapter-cqhttp",
"alicebot-adapter-onebot",
"alicebot-adapter-mirai",
"alicebot-adapter-dingtalk",
"alicebot-adapter-telegram",
"alicebot-adapter-apscheduler",
"watchfiles>=0.24",
]
[project.urls]
Homepage = "https://docs.alicebot.dev/"
Documentation = "https://docs.alicebot.dev/"
Repository = "https://github.com/AliceBotProject/alicebot"
Changelog = "https://docs.alicebot.dev/changelog.html"
[tool.uv]
dev-dependencies = [
# dev
"setuptools>=74",
"trio>=0.26",
"exceptiongroup>=1",
"tomli>=2",
# lint
"ruff>=0.6",
"mypy>=1",
"pylint>=3",
"pylint-pydantic>=0.3",
# docs
"sophia-doc>=0.1",
"tomlkit>=0.13",
# test
"pytest>=8",
"pytest-xdist>=3",
"pytest-cov>=5",
]
[tool.uv.sources]
alicebot-adapter-cqhttp = { workspace = true }
alicebot-adapter-onebot = { workspace = true }
alicebot-adapter-mirai = { workspace = true }
alicebot-adapter-dingtalk = { workspace = true }
alicebot-adapter-telegram = { workspace = true }
alicebot-adapter-apscheduler = { workspace = true }
[tool.uv.workspace]
members = ["packages/*"]
[tool.ruff]
line-length = 88
target-version = "py39"
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"C90", # mccabe
"FBT", # flake8-boolean-trap
"EM", # flake8-errmsg
"INP", # flake8-no-pep420
"E501", # Line too long, handled by formatter
"D415", # First line should end with a period, question mark, or exclamation point
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed
"ASYNC109", # Async function definition with a timeout parameter
"S101", # Use of assert detected
"COM812", # Trailing comma missing
"TD003", # Missing issue link on the line following this TODO
"FIX002", # Line contains TODO
"PGH003", # Use specific rule codes when ignoring type issues
"PLR0912", # Too many branches
"PLR0913", # Too many arguments to function call
"TRY003", # Avoid specifying long messages outside the exception class
"PERF203", # try-except within a loop incurs performance overhead
]
allowed-confusables = [",", ":", "!"]
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["id", "type"]
[tool.ruff.lint.isort]
known-third-party = ["pydantic", "aiohttp", "structlog"]
extra-standard-library = ["typing_extensions"]
[tool.ruff.lint.pydocstyle]
convention = "google"
[tool.ruff.lint.pyflakes]
extend-generics = [
"alicebot.plugin.Plugin",
"alicebot.adapter.Adapter",
"alicebot.event.Event",
"alicebot.event.MessageEvent",
"alicebot.message.Message",
"alicebot.message.MessageSegment",
]
[tool.ruff.lint.pyupgrade]
keep-runtime-typing = true
[tool.ruff.lint.per-file-ignores]
"packages/*/alicebot/__init__.py" = ["D104"]
"packages/*/alicebot/adapter/__init__.py" = ["D104"]
"examples/plugins/*.py" = ["D", "T", "ANN"]
"tests/*.py" = ["D", "PLR2004"]
[tool.pyright]
ignore = ["examples/plugins"]
extraPaths = ["tests", "tests/test_utils"]
pythonVersion = "3.9"
pythonPlatform = "All"
typeCheckingMode = "strict"
reportUnnecessaryIsInstance = false
reportCallInDefaultInitializer = true
reportImplicitOverride = true
reportPropertyTypeMismatch = true
reportShadowedImports = true
reportUninitializedInstanceVariable = true
[tool.mypy]
python_version = "3.9"
strict = true
exclude = [
'^packages/.*/alicebot/__init__\.py$',
'^packages/.*/alicebot/adapter/__init__\.py$',
'^examples/.*\.py$',
]
warn_return_any = false
[[tool.mypy.overrides]]
module = "apscheduler.*"
ignore_missing_imports = true
[tool.pylint.main]
disable = [
# Warning
"broad-exception-caught",
# Convention
"import-outside-toplevel",
"line-too-long",
"missing-function-docstring",
"too-many-lines",
# Refactor
"duplicate-code",
"too-few-public-methods",
"too-many-arguments",
"too-many-boolean-expressions",
"too-many-branches",
"too-many-instance-attributes",
"too-many-nested-blocks",
"too-many-positional-arguments",
"too-many-public-methods",
]
load-plugins = ["pylint_pydantic"]
source-roots = ["."]
ignore = ["packages/alicebot-adapter-telegram/examples"]
[tool.pylint.variables]
allowed-redefined-builtins = ["id", "type"]
[tool.pytest.ini_options]
log_cli = true
testpaths = "tests"
addopts = "--cov=alicebot --cov-report=term-missing"
[tool.coverage.run]
omit = ["alicebot/adapter/utils.py"]
[tool.coverage.report]
exclude_also = [
"raise NotImplementedError",
"if TYPE_CHECKING:",
"@overload",
"@(abc\\.)?abstractmethod",
]
omit = ["alicebot/log.py"]
[tool.hatch.build.targets.sdist]
include = ["/README.md", "/alicebot"]
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"