-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
279 lines (250 loc) · 9.05 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
[build-system]
requires = ["flit_core >=3.3,<4,!=3.7"]
build-backend = "flit_core.buildapi"
[project]
name = "tanchan"
version = "0.4.3"
readme = "README.md"
requires-python = ">=3.11.0,<3.14"
license = {file = "LICENSE"}
authors = [ {name = "Faster Speeding", email="[email protected]"} ]
keywords = ["hikari"]
classifiers = [
"Development Status :: 4 - Beta",
"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 = ["hikari-tanjun>=2.16, <3", "typing-extensions>=4.5, <5"]
dynamic = ["description"]
[project.optional-dependencies]
yuyo = ["hikari-yuyo>=1.18.0, <2"]
[project.urls]
Homepage = "https://github.com/FasterSpeeding/Tan-chan"
Repository = "https://github.com/FasterSpeeding/Tan-chan"
Documentation = "https://tan-chan.cursed.solutions/"
Changelog = "https://github.com/FasterSpeeding/tan-chan/blob/master/CHANGELOG.md"
[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",
"packaging>=23.0",
"pytest-xdist>=3.1",
]
type-checking = [
"mypy>=0.991",
"nox",
"pyright>=1.1.285",
{include-group = "tests"},
# From `yuyo` extra
"hikari-yuyo>=1.18.0, <2",
]
[tool.black]
include = ".*pyi?$"
line-length = 120
skip-magic-trailing-comma = true
target-version = ["py311"]
[tool.coverage.run]
concurrency = ["multiprocessing"]
parallel = true
branch = true
timid = false
source = ["tanchan"]
[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"]
[tool.piped]
default_sessions = [
"reformat",
"verify-markup",
"lint",
"spell-check",
"slot-check",
"type-check",
"test",
"verify-types",
]
mypy_allowed_to_fail = true
mypy_targets = ["./tanchan"]
project_name = "tanchan"
top_level_targets = ["./docs_src", "./noxfile.py", "./tanchan", "./tests"]
[tool.piped.extra_installs]
slot_check = [".[yuyo]"]
[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 = "4bf1f4002804f947bebae669d631cad28e39b6516f6c3d4ead820c07949e57d1"
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.pyright]
include = ["docs_src", "tanchan", "noxfile.py", "tests"]
pythonVersion = "3.11"
typeCheckingMode = "strict"
reportMissingModuleSource = "error"
# 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]
testpaths = ["tests"]
timeout = 15
required_plugins = []
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
"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: ``
"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
"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
]
"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: ``
]
"tests/test_doc_parse.py" = [
"D400", # First line should end with a period
"D401", # First line of docstring should be in imperative mood: "Description."
"D406", # [*] Section name should end with a newline ("Returns")
"D407", # [*] Missing dashed underline after section ("Returns")
"D410", # [*] Missing blank line after section ("Parameters")
"D411", # [*] Missing blank line before section ("Returns")
]
[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 = "tanchan.components.config:\\w+Config"
[tool.uv]
reinstall-package = ["tanchan"]