-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyproject.toml
More file actions
397 lines (377 loc) · 12.1 KB
/
Copy pathpyproject.toml
File metadata and controls
397 lines (377 loc) · 12.1 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
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
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
"setuptools-scm>=8.1.0",
]
[project]
name = "mypy-strict-kwargs"
description = "Enforce using keyword arguments where possible."
readme = { file = "README.rst", content-type = "text/x-rst" }
keywords = [
"mypy",
]
license = { file = "LICENSE" }
authors = [
{ name = "Adam Dangoor", email = "adamdangoor@gmail.com" },
]
requires-python = ">=3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Environment :: Web Environment",
"License :: OSI Approved :: MIT License",
"Operating System :: Microsoft :: Windows",
"Operating System :: POSIX",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
]
dynamic = [
"version",
]
dependencies = [
"mypy>=2.0.0",
]
optional-dependencies.dev = [
"actionlint-py==1.7.12.24",
"check-manifest==0.51",
"deptry==0.25.1",
"doc8==2.0.0",
"doccmd==2026.7.19",
"interrogate==1.7.0",
"mypy[faster-cache]==2.3.0",
"prek==0.4.11",
"pydocstringformatter==1.0.0",
"pylint[spelling]==4.0.6",
"pylint-per-file-ignores==3.2.1",
"pyproject-fmt==2.26.0",
"pyrefly==1.1.1",
"pyright==1.1.411",
"pyroma==5.0.1",
"pytest==9.1.1",
"pytest-cov==7.1.0",
"pytest-mypy-plugins==4.0.3",
"pyyaml==6.0.3",
"ruff==0.16.0",
# We add shellcheck-py not only for shell scripts and shell code blocks,
# but also because having it installed means that ``actionlint-py`` will
# use it to lint shell commands in GitHub workflow files.
"shellcheck-py==0.11.0.1",
"shfmt-py==4.0.0",
"sphinx-lint==1.0.2",
"strict-kwargs==2026.7.24",
"towncrier==25.8.0",
"ty==0.0.63",
"vulture==2.16",
"yamlfix==1.19.1",
"zizmor==1.28.0",
]
optional-dependencies.release = [ "check-wheel-contents==0.6.3", "towncrier==25.8.0" ]
urls.Documentation = "https://mypy-strict-kwargs.readthedocs.io/en/latest/"
urls.Source = "https://github.com/adamtheturtle/mypy-strict-kwargs"
entry-points."mypy.plugins".mypy_strict_kwargs = "mypy_strict_kwargs.plugin:plugin"
[tool.setuptools]
packages.find.where = [
"src",
]
package-data.mypy_strict_kwargs = [
"py.typed",
]
zip-safe = false
[tool.setuptools_scm]
# This keeps the start of the version the same as the last release.
# This is useful for our documentation to include e.g. binary links
# to the latest released binary.
#
# Code to match this is in ``conf.py``.
version_scheme = "post-release"
[tool.ruff]
line-length = 79
lint.select = [
"ALL",
]
lint.ignore = [
# Ruff warns that this conflicts with the formatter.
"COM812",
# The project copyright notice is in the LICENSE file.
"CPY001",
# Allow our chosen docstring line-style - pydocstringformatter handles formatting
# but doesn't enforce D205 (blank line after summary) or D212 (summary on first line).
"D205",
"D212",
# Ruff warns that this conflicts with the formatter.
"ISC001",
# Ignore 'too-many-*' errors as they seem to get in the way more than
# helping.
"PLR0913",
]
lint.per-file-ignores."doccmd_*.py" = [
# Allow our chosen docstring line-style - pydocstringformatter handles
# formatting but docstrings in docs may not match this style.
"D200",
# Allow asserts in docs.
"S101",
]
lint.per-file-ignores."tests/*" = [
# use of assert in tests
"S101",
]
# Do not automatically remove commented out code.
# We comment out code during development, and with VSCode auto-save, this code
# is sometimes annoyingly removed.
lint.unfixable = [
"ERA001",
]
lint.flake8-tidy-imports.banned-api."typing.cast".msg = "typing.cast is banned: use explicit type narrowing or a typed variable instead."
lint.pydocstyle.convention = "google"
[tool.pylint]
# Disable the message, report, category or checker with the given id(s). You
# can either give multiple identifiers separated by comma (,) or put this
# option multiple times (only on the command line, not in the configuration
# file where it should appear only once).You can also use "--disable=all" to
# disable everything first and then reenable specific checks. For example, if
# you want to run only the similarities checker, you can use "--disable=all
# --enable=similarities". If you want to run only the classes checker, but have
# no Warning level messages displayed, use"--disable=all --enable=classes
# --disable=W"
"MESSAGES CONTROL".disable = [
# Too difficult to please
"duplicate-code",
# Let ruff handle long lines
"line-too-long",
"locally-disabled",
"missing-return-type-doc",
# We don't need everything to be documented because of mypy
"missing-type-doc",
"too-few-public-methods",
"too-many-arguments",
"too-many-instance-attributes",
"too-many-lines",
"too-many-locals",
"too-many-return-statements",
# Let ruff deal with sorting
"ungrouped-imports",
# Let ruff handle unused imports
"unused-import",
# mypy does not want untyped parameters.
"useless-type-doc",
# Let ruff handle imports
"wrong-import-order",
]
# Enable the message, report, category or checker with the given id(s). You can
# either give multiple identifier separated by comma (,) or put this option
# multiple time (only on the command line, not in the configuration file where
# it should appear only once). See also the "--disable" option for examples.
"MESSAGES CONTROL".enable = [
"bad-inline-option",
"deprecated-pragma",
"file-ignored",
"spelling",
"use-symbolic-message-instead",
"useless-suppression",
]
# We ignore invalid names because:
# - We want to use generated module names, which may not be valid, but are never seen.
"MESSAGES CONTROL".per-file-ignores = [
"doccmd_README_rst_*.py:invalid-name",
]
DEPRECATED_BUILTINS.bad-functions = [
# Use Pylint until Ruff can ban bare builtin calls, or until custom rules
# make this removable:
# https://github.com/astral-sh/ruff/issues/10079
# https://github.com/astral-sh/ruff/issues/970
"filter",
"getattr",
"hasattr",
"map",
"setattr",
]
# Allow the body of an if to be on the same line as the test if there is no
# else.
FORMAT.single-line-if-stmt = false
# Return non-zero exit code if useless-suppression is emitted.
MAIN.fail-on = [
"useless-suppression",
]
MASTER.extension-pkg-allow-list = [
"mypy",
]
# Use multiple processes to speed up Pylint.
MASTER.jobs = 0
# List of plugins (as comma separated values of python modules names) to load,
# usually to register additional checkers.
# See https://chezsoi.org/lucas/blog/pylint-strict-base-configuration.html.
# and we also add `pylint_per_file_ignores` to allow per-file ignores.
# We do not use the plugins:
# - pylint.extensions.code_style
# - pylint.extensions.magic_value
# - pylint.extensions.while_used
# as they seemed to get in the way.
MASTER.load-plugins = [
"pylint.extensions.bad_builtin",
"pylint.extensions.comparison_placement",
"pylint.extensions.consider_refactoring_into_while_condition",
"pylint.extensions.docparams",
"pylint.extensions.dunder",
"pylint.extensions.eq_without_hash",
"pylint.extensions.for_any_all",
"pylint.extensions.mccabe",
"pylint.extensions.no_self_use",
"pylint.extensions.overlapping_exceptions",
"pylint.extensions.private_import",
"pylint.extensions.redefined_loop_name",
"pylint.extensions.redefined_variable_type",
"pylint.extensions.set_membership",
"pylint.extensions.typing",
"pylint_per_file_ignores",
]
# Pickle collected data for later comparisons.
MASTER.persistent = true
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
MASTER.unsafe-load-any-extension = false
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
SPELLING.spelling-dict = "en_US"
# A path to a file that contains private dictionary; one word per line.
SPELLING.spelling-private-dict-file = "spelling_private_dict.txt"
# Tells whether to store unknown words to indicated private dictionary in
# --spelling-private-dict-file option instead of raising a message.
SPELLING.spelling-store-unknown-words = "no"
[tool.interrogate]
fail-under = 100
verbose = 2
omit-covered-files = true
[tool.check-manifest]
ignore = [
"*.enc",
".checkmake-config.ini",
".git_archival.txt",
".pre-commit-config.yaml",
".prettierrc",
".vscode/*",
".yamlfmt",
"CHANGELOG.rst",
"ci",
"ci/**",
"CODE_OF_CONDUCT.rst",
"CONTRIBUTING.rst",
"docs",
"docs/**",
"LICENSE",
"lint.mk",
"Makefile",
"newsfragments",
"newsfragments/**",
"readthedocs.yaml",
"spelling_private_dict.txt",
"tests",
"tests-pylintrc",
"tests/**",
"towncrier_template.rst.jinja",
"zizmor.yml",
]
[tool.deptry]
optional_dependencies_dev_groups = [
"dev",
"release",
]
[tool.vulture]
# Duplicate some of .gitignore
exclude = [ ".venv" ]
ignore_names = [
# mypy hooks:
# https://mypy.readthedocs.io/en/latest/extending_mypy.html#current-list-of-plugin-hooks.
"get_base_class_hook",
"get_function_signature_hook",
"get_method_signature_hook",
"report_config_data",
]
[tool.pyproject-fmt]
indent = 4
keep_full_version = true
max_supported_python = "3.14"
[tool.mypy]
files = [ "." ]
exclude = [ "build" ]
follow_untyped_imports = true
strict = true
plugins = [
"mypy_strict_kwargs",
# See
# https://mypy.readthedocs.io/en/latest/extending_mypy.html#useful-tools.
"mypy.plugins.proper_plugin",
]
[tool.pyrefly]
errors.non-exhaustive-match = "error"
[tool.pyright]
typeCheckingMode = "strict"
enableTypeIgnoreComments = false
# See
# https://github.com/microsoft/pyright/issues/9617#issuecomment-2558167677.
# This defines as a constant a variable in the ``mypy`` source code which is
# used to configure a type hint.
defineConstant = { MYPYC = false }
reportUnnecessaryTypeIgnoreComment = true
[tool.ty]
# Error if ty emits any warning-level diagnostics.
terminal.error-on-warning = true
# Disable support for `type: ignore` comments
analysis.respect-type-ignore-comments = false
[tool.pytest]
# Use the same process so that we can get coverage.
# * --mypy-same-process
# * The help documentation says that this "will create problems with import cache"
addopts = [ "--mypy-same-process" ]
log_cli = true
xfail_strict = true
[tool.coverage]
run.branch = true
report.exclude_also = [
"case _ as unreachable:\n\\s*assert_never\\(",
"if TYPE_CHECKING:",
]
report.show_missing = true
[tool.towncrier]
# The changelog and the per-release GitHub release notes are both built
# from news fragments under ``newsfragments/``. The release workflow
# runs ``towncrier build`` to assemble them; contributors add one
# fragment file per user-facing change.
directory = "newsfragments"
filename = "CHANGELOG.rst"
# Custom template so an assembled version reproduces the historical
# style exactly: a bare ``<version>`` heading (no project name, no
# date) followed by a flat bullet list with no per-type sub-headings.
template = "towncrier_template.rst.jinja"
title_format = "{version}"
issue_format = "#{issue}"
# ``title_format`` underline first, then any nested headings. A bare
# version such as ``2026.05.18`` underlined with ``-`` matches every
# pre-towncrier entry in CHANGELOG.rst.
underlines = [ "-", "~", "^" ]
type = [
# A single, unnamed fragment type keeps the assembled output as one
# flat bullet list, matching the historical changelog (which never
# grouped entries under "Features"/"Bugfixes"/... sub-headings).
{ directory = "change", name = "", showcontent = true },
]
[tool.pydocstringformatter]
write = true
split-summary-body = false
max-line-length = 75
linewrap-full-docstring = true
[tool.doc8]
max_line_length = 2000
ignore_path = [
"./.eggs",
"./docs/build",
"./docs/build/spelling/output.txt",
"./node_modules",
"./src/*.egg-info/",
"./src/*/_setuptools_scm_version.txt",
]
[tool.yamlfix]
section_whitelines = 1
whitelines = 1