-
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathpyproject.toml
211 lines (199 loc) · 6.62 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
[project]
name = "nonebot-plugin-alconna"
description = "Alconna Adapter for Nonebot"
authors = [
{name = "RF-Tar-Railt", email = "[email protected]"},
]
dependencies = [
"tarina<0.7,>=0.6.8",
"nepattern<1.0,>=0.7.7",
"arclet-alconna<2.0,>=1.8.35",
"arclet-alconna-tools>=0.7.10",
"importlib-metadata>=4.13.0",
"nonebot2>=2.3.0",
"nonebot-plugin-waiter>=0.6.0",
]
dynamic = ["version"]
requires-python = ">=3.9"
readme = "README.md"
license = {text = "MIT"}
keywords = [
"command",
"alconna",
"nonebot",
]
[project.urls]
homepage = "https://github.com/nonebot/plugin-alconna"
repository = "https://github.com/nonebot/plugin-alconna"
[build-system]
requires = ["pdm-backend"]
build-backend = "pdm.backend"
[tool.pdm]
[tool.pdm.dev-dependencies]
dev = [
"isort!=6.0.0",
"black>=25.1.0",
"loguru>=0.7.2",
"ruff>=0.8.4",
"nonemoji>=0.1.4",
"pre-commit>=3.7.0",
"nonebug>=0.3.7",
"pytest-xdist>=3.6.1",
"pytest-asyncio>=0.23.6",
"fastapi>=0.110.2",
"uvicorn[standard]>=0.28.1",
"pydantic>=2.7.0",
"nonebot2[httpx,websockets]>=2.3.0",
"nonebot-adapter-console>=0.5.0",
"nonebot-adapter-ding>=2.0.0a16",
"nonebot-adapter-discord>=0.1.8",
"nonebot-adapter-dodo>=0.2.1",
"nonebot-adapter-feishu>=2.6.0",
"nonebot-adapter-kaiheila>=0.3.4",
"nonebot-adapter-mail>=1.0.0a7",
"nonebot-adapter-mirai>=2.3.3",
"nonebot-adapter-minecraft>=1.3.2",
"nonebot-adapter-onebot>=2.4.5",
"nonebot-adapter-qq>=1.6.2",
"nonebot-adapter-red>=0.9.0",
"nonebot-adapter-satori>=0.13.4",
"nonebot-adapter-telegram>=0.1.0b18",
"nonebot-adapter-kritor>=0.3.2",
"nonebot-adapter-tailchat>=0.1.0b12",
"nonebot-plugin-filehost>=1.1.1",
"nonebot-plugin-send-anything-anywhere>=0.7.1",
"pytest-sugar>=1.0.0",
"pytest-mock>=3.14.0",
"nonebot-plugin-localstore>=0.7.1",
"pyyaml>=6.0.1",
"fix-future-annotations>=0.5.0",
]
[tool.pdm.build]
includes = ["src/nonebot_plugin_alconna"]
[tool.pdm.version]
source = "file"
path = "src/nonebot_plugin_alconna/__init__.py"
[tool.black]
line-length = 120
target-version = ["py39", "py310", "py311", "py312"]
include = '\.pyi?$'
extend-exclude = '''
'''
[tool.isort]
profile = "black"
line_length = 120
length_sort = true
skip_gitignore = true
force_sort_within_sections = true
extra_standard_library = ["typing_extensions"]
[tool.ruff]
line-length = 120
target-version = "py39"
[tool.ruff.lint]
select = [
"F", # pyflakes
"E", # pycodestyle errors
"W", # pycodestyle warnings
# "I", # isort
"N", # PEP8-naming
"UP", # pyupgrade
"YTT", # flake8-2020
"ASYNC", # flake8-async
# "S", # flake8-bandit
"BLE", # flake8-blind-except
# "FBT", # flake8-boolean-trap
"B", # flake8-bugbear
"A", # flake8-builtins
"COM", # flake8-commas
"C4", # flake8-comprehensions
"DTZ", # flake8-datetimez
"T10", # flake8-debugger
# "FA", # flake8-future-annotations
"ISC", # flake8-implicit-str-concat
"ICN", # flake8-import-conventions
"PIE", # flake8-pie
"T20", # flake8-print
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RSE", # flake8-raise
"RET", # flake8-return
"SLOT", # flake8-slots
"SIM", # flake8-simplify
"TID", # flake8-tidy-imports
# "TC", # flake8-type-checking
# "ARG", # flake8-unused-arguments
"PTH", # flake8-use-pathlib
# "ERA", # eradicate
"PD", # pandas-vet
"PGH", # pygrep-hooks
"PL", # pylint
"TRY", # tryceratops
"FLY", # flynt
"FAST", # FastAPI
"PERF", # Perflint
"FURB", # refurb
"RUF", # Ruff-specific rules
]
ignore = [
"C901",
"T201",
"E731",
"PT023",
"B010", # Do not call `setattr` with a constant attribute value.
"SIM105", # Use `contextlib.suppress`
"B008", # Do not perform function call in argument defaults
"RUF100", # Unused `noqa` directive
"TC003", # Move xxx into a type-checking block
"E402", # module level import not at top of file
"E501", # 过长的行由 ruff format 处理, 剩余的都是字符串
"UP035", # pyupgrade, 但 typing.Callable 的导入会报错
"TRY003",
"TRY301", # 为啥非要把 raise 丢进另外一个 inner fn 里
"BLE001", # except Exception as e
"PGH003", # 要求 `# type: ignore` 提供理由,但 pyright 和 mypy 等都不是统一标准。
"PLC0414", # 用 import-as 表示 re-export
"N818", # 要求所有自定义错误以 Error 作后缀,但我们不这么做
"RET502", # return = return None
"RET503", # 就要 implicit return none
"PLC0105", # 我们已经用 R 表示协变,Q 表示逆变了
"PLR0913", # 参数就那么多的,你用 builder 什么的不是更逆天?
"SIM108", # 迫真 simplicy
"RUF001", # String contains ambiguous `,` (FULLWIDTH COMMA). Did you mean `,` (COMMA)?
"RUF002", # Docstring contains ambiguous `,` (FULLWIDTH COMMA). Did you mean `,` (COMMA)?
"RUF009", # 我不想要额外的全局变量。
"UP038", # instance(..., X | Y) 还是太超前了
"RUF003", # 中文注释里用全角符号怎么你了
"SLOT000", # 动态类型需求,主要是 json5 backend
"PLR0911", "PLR0912", "PLR0915", # 复杂度高点怎么你了
"PYI041", # int 和 float 在运行时的类型没有交集(互不成立 issubclass)
"PLW2901", # shallow 怎么你了
"S101", # assert 怎么你了,非要 RuntimeError 吗
"PLR2004", # magic number 怎么你了
"TRY004", # 我要抛啥错误我清楚
"COM812", # 强制尾随逗号
"TID252", # 相对导入
"ISC001", # format warning
"N801", # Class name should use CapWords convention
"N802", # Function name should be lowercase
"N804", # First argument of a class method should be named `cls`
"N805", # First argument of a method should be named `self`
"N806", # Variable in function should be lowercase
]
flake8-quotes = { inline-quotes = "double", multiline-quotes = "double" }
[tool.ruff.lint.flake8-annotations]
mypy-init-return = true
[tool.ruff.lint.flake8-builtins]
builtins-ignorelist = ["id"]
[tool.pyright]
pythonVersion = "3.9"
pythonPlatform = "All"
defineConstant = { PYDANTIC_V2 = true }
typeCheckingMode = "basic"
reportShadowedImports = false
disableBytesTypePromotions = true
[tool.pdm.scripts]
test = "pytest -v -n 2 -W ignore ./tests/"
format = { composite = ["isort ./src/ ./example/ ./tests/","black ./src/ ./example/ ./tests/","ruff check ./src/ ./example/ ./tests/"] }
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "session"