-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
pyproject.toml
337 lines (303 loc) · 10.8 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
[build-system]
requires = ["flit_core >=3.3,<4"]
build-backend = "flit_core.buildapi"
[project]
name = "hikari-yuyo"
version = "1.23.1"
readme = "README.md"
requires-python = ">=3.11,<3.14"
license = {file = "LICENSE"}
authors = [ {name = "Faster Speeding", email="lucina@lmbyrne.dev"} ]
keywords= ["hikari"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: BSD License",
"Intended Audience :: Developers",
"Natural Language :: English",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Communications :: Chat",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
"Typing :: Typed"
]
dependencies = ["alluka>=0.4, <1", "hikari>=2.0.0.dev118, <3"]
dynamic = ["description"]
[project.optional-dependencies]
asgi = ["asgiref~=3.0", "hikari[server]"]
cli = ["click>=8, <9", "pydantic>=2, <3", "python-dotenv>=1, <2", "toml>=0.10, <1"]
sake = ["hikari-sake>=1.0.4a1, <2"]
tanjun = ["hikari-tanjun>=2.11.0, <3"]
[project.scripts]
yuyo = "yuyo.__main__:main"
[project.urls]
Homepage = "https://github.com/FasterSpeeding/Yuyo"
Repository = "https://github.com/FasterSpeeding/Yuyo"
Documentation = "https://yuyo.cursed.solutions/"
Changelog = "https://yuyo.cursed.solutions/changelog"
[dependency-groups]
docs = [
"markdown-include>=0.8",
"mkdocs>=1.4.2",
"mkdocstrings[python]>=0.19",
"mkdocs-material>=8.5.11",
"mkdocs-minify-plugin>=0.6.4",
]
freeze-locks = ["uv"]
lint = [
"codespell>=2.2.2",
"pre-commit-hooks>=4.4",
"slotscheck>=0.16.1",
"ruff",
]
publish = ["flit>=3.8.0"]
reformat = [
"black>=22.10.0",
"isort>=5.11.3",
"pre-commit-hooks>=4.4",
"pycln>=2.1.2",
"sort-all>=1.2",
]
templating = ["Jinja2>=3.1.2"]
tests = [
"pytest>=7",
"pytest-cov>=4",
"pytest-sugar>=0.9.6",
"pytest-timeout>=2.1",
"freezegun>=1.2.2",
"pytest-asyncio>=0.20.2",
"pytest-xdist>=3.1",
# The pytest extensions aren't compatible with v8 yet.
"pytest>=7, <8",
# For HTTP constants
"asgiref~=3.0",
]
type-checking = [
"mypy>=0.991",
"nox",
"pyright>=1.1.285",
{include-group = "tests"},
# From `asgi` extra
"asgiref~=3.0",
# From `cli` extra
"click>=8, <9",
"pydantic>=2, <3",
"python-dotenv>=1, <2",
"toml>=0.10, <1",
# From `sake` extra
"hikari-sake>=1.0.4a1, <2",
# From `tanjun` extra
"hikari-tanjun>=2.11.0, <3",
# For examples
"fastapi",
]
[tool.flit.module]
name = "yuyo"
[tool.black]
include = ".*pyi?$"
line-length = 120
skip-magic-trailing-comma = true
target-version = ["py311"]
[tool.codespell]
ignore-regex = "Nd"
[tool.coverage.run]
concurrency = ["multiprocessing"]
parallel = true
branch = true
timid = false
source = ["yuyo"]
[tool.coverage.report]
precision = 2
show_missing = true
skip_covered = false
exclude_lines = [
"^\\s*\\.\\.\\.$",
"^\\s*@abc.abstractmethod$",
"^if typing.TYPE_CHECKING:$"
]
[tool.isort]
profile = "black"
force_single_line = true
[tool.mypy]
# some good strict settings
python_version = "3.11"
strict = true
warn_unreachable = true
# more narrow type ignores
show_error_codes = true
# these are used by pyright
warn_unused_ignores = false
warn_redundant_casts = false
# compatibility with pyright
allow_redefinition = true
disable_error_code = ["type-abstract"]
# Ignore doc_src files which fail to parse
exclude = [
"docs_src/chunk_tracker.py",
"docs_src/links.py",
"docs_src/list_status.py",
]
[tool.piped]
default_sessions = [
"reformat",
"verify-markup",
"lint",
"spell-check",
"slot-check",
"type-check",
"test",
"verify-types",
]
mypy_allowed_to_fail = true
mypy_targets = ["docs_src", "yuyo"]
path_ignore = "docs\\/usage\\/images\\/.+"
project_name = "yuyo"
top_level_targets = ["./docs_src", "./examples", "./noxfile.py", "./yuyo", "./tests"]
[tool.piped.extra_installs]
slot_check = [".[sake]"]
test = [".[asgi, sake]"]
[tool.piped.github_actions.freeze_for_pr]
[tool.piped.github_actions.lint]
[tool.piped.github_actions.pr_docs]
[tool.piped.github_actions.publish]
[tool.piped.github_actions.py_test]
codeclimate_token = "ff91ba30df9fd9d4f49325b583807d32cff9370fb02c8b6a7487ed94f5326933"
python_versions = ["3.11", "3.12", "3.13"]
[tool.piped.github_actions.reformat]
[tool.piped.github_actions.release_docs]
[tool.piped.github_actions.resync_piped]
[tool.piped.github_actions.type_check]
[tool.piped.github_actions.update_licence]
[tool.piped.github_actions.upgrade_locks]
[tool.piped.github_actions.verify_types]
[tool.pycln]
exclude = "docs_src"
[tool.pyright]
include = ["docs_src", "examples", "noxfile.py", "tests", "yuyo"]
pythonVersion = "3.11"
typeCheckingMode = "strict"
reportMissingModuleSource = "error" # Is only "warning" on strict mode.
# Error code which are disabled even when general strict.
reportShadowedImports = "error"
reportCallInDefaultInitializer = "none" # Ended up just complaining about cases where this was fine (e.g. timedeltas).
reportImplicitStringConcatenation = "none" # Conflicts with flake8 config.
reportMissingSuperCall = "none" # Way too strict (requires calls to `object.__init__`).
reportPropertyTypeMismatch = "error"
reportUninitializedInstanceVariable = "error"
reportUnnecessaryTypeIgnoreComment = "error"
reportUnusedCallResult = "none" # Enforces doing `_ = ...`.
# Error codes which lead to too many false-positives.
reportIncompatibleMethodOverride = "warning" # This relies on ordering for key-word only arguments
# which is more annoying than it's worth
reportUnknownMemberType = "warning" # This messes with instance checking generic objects
reportUnknownArgumentType = "warning" # Pretty much the same as reportUnknownMemberType
reportUnknownLambdaType = "warning"
reportImportCycles = "warning" # This isn't necessarily an issue if it's type checking only.
reportUnknownVariableType = "warning" # Lotta false-positives, might fix/change later.
[tool.pytest.ini_options]
asyncio_mode = "strict"
testpaths = ["tests"]
timeout = 15
required_plugins = ["pytest-asyncio"]
filterwarnings = [
"error",
"ignore:Use Context or CachingContext:DeprecationWarning",
]
[tool.ruff.lint]
select = ["ALL"]
ignore = [
"ANN401", # Dynamically typed expressions (typing.Any) are disallowed in ``
"COM812", # Trailing comma missing (incompatible with black)
"D102", # Missing docstring in public method
"D105", # Missing docstring in magic method
"FIX002", # Line contains TODO, consider resolving the issue
"I001", # [*] Import block is un-sorted or un-formatted
"N818", # Exception name `FailedModuleUnload` should be named with an Error suffix
"PD011", # Use `.to_numpy()` instead of `.values`
"PLR1714", # Consider merging multiple comparisons: ``. Use a `set` if the elements are hashable.
"PYI041", # Use `float` instead of `int | float`
"S101", # Use of `assert` detected
"SIM105", # Use `contextlib.suppress(Error)` instead of `try`-`except`-`pass`
"SIM108", # Use ternary operator `` instead of `if`-`else`-block
"TD002", # Missing author in TODO; try: `# TODO(<author_name>): ...` or `# TODO @<author_name>: ...`
"TD003", # Missing issue link on the line following this TODO
]
[tool.ruff.lint.per-file-ignores]
"docs_src/**/*.py" = [
"ARG001", # Unused function argument: ``
"ARG002", # Unused method argument: ``
"B008", # Do not perform function call `` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"B018", # Found useless expression. Either assign it to a variable or remove it.
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"FBT002", # Boolean default positional argument in function definition
"F841", # Local variable `` is assigned to but never used
"INP001", # File `` is part of an implicit namespace package. Add an `__init__.py`.
"N806", # Variable `` in function should be lowercase
"PIE790", # [*] Unnecessary `...` literal
"PYI013", # [*] Non-empty class body must not contain `...`
"T201", # `print` found
]
"docs_src/links.py" = [
"ERA001", # Found commented-out code
]
"examples/**/*.py" = [
"ARG001", # Unused function argument: ``
"B008", # Do not perform function call `` in argument defaults; instead, perform the call within the function, or read the default from a module-level singleton variable
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"FBT001", # Boolean-typed positional argument in function definition
"PIE790", # [*] Unnecessary `...` literal
"PYI013", # [*] Non-empty class body must not contain `...`
]
"noxfile.py" = [
"F403", # `from noxfile import *` used; unable to detect undefined name
]
"tests/**/*.py" = [
"D100", # Missing docstring in public module
"D101", # Missing docstring in public class
"D102", # Missing docstring in public method
"D103", # Missing docstring in public function
"D104", # Missing docstring in public package
"FBT001", # Boolean-typed positional argument in function definition
"FBT002", # Boolean default positional argument in function definition
"FBT003", # Boolean positional value in function call
"PLR0915", # Too many statements
"PGH003", # Use specific rule codes when ignoring type issues
"PLR2004", # Magic value used in comparison, consider replacing `` with a constant variable
"SLF001", # Private member accessed: ``
"S106", # Possible hardcoded password assigned to argument:
]
[tool.ruff.lint.mccabe]
max-complexity = 20
[tool.ruff.lint.pycodestyle]
# Technically this is 120, but black has a policy of "1 or 2 over is fine if it is tidier", so we have to raise this.
max-line-length = 130
[tool.ruff.lint.pydocstyle]
convention = "numpy"
[tool.ruff.lint.pylint]
max-args = 20
max-branches = 20
max-returns = 15
max-statements = 100
[tool.slotscheck]
strict-imports = true
require-superclass = true
require-subclass = true
exclude-classes = """
.*(Proto|Meta)
|yuyo.components:_WrappedTextMenuBuilder
|yuyo.modals:ModalOptions
|yuyo.__main__:.*Model
|yuyo.__main__:_MaybeLocalised
"""
[tool.uv]
reinstall-package = ["hikari-yuyo"]