-
Notifications
You must be signed in to change notification settings - Fork 0
/
pyproject.toml
432 lines (383 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
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
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
[build-system]
build-backend = "setuptools.build_meta"
requires = [
"setuptools",
"setuptools-scm[toml]>=8.1",
"wheel",
]
[project]
name = "doccmd"
description = "Run commands against code blocks in reStructuredText and Markdown files."
readme = { file = "README.rst", content-type = "text/x-rst" }
keywords = [
"markdown",
"rst",
"sphinx",
"testing",
]
license = { file = "LICENSE" }
authors = [
{ name = "Adam Dangoor", email = "[email protected]" },
]
requires-python = ">=3.10"
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.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
]
dynamic = [
"version",
]
dependencies = [
"beartype>=0.19.0",
"click>=8.1.7",
"pygments>=2.18.0",
"sybil>=9.0.0,<10.0.0",
# Pin this dependency as we expect:
# * It might have breaking changes
# * It is not a direct dependency of the user
"sybil-extras==2024.10.18",
]
optional-dependencies.dev = [
"actionlint-py==1.7.4.20",
"check-manifest==0.50",
"deptry==0.21.1",
"doc8==1.1.2",
"docformatter==1.7.5",
"docker==7.1.0",
"furo==2024.8.6",
"interrogate==1.7.0",
"mypy[faster-cache]==1.13.0",
"pre-commit==4.0.1",
"pydocstyle==6.3",
"pyenchant==3.3.0rc1",
"pygments==2.18.0",
"pylint==3.3.2",
"pyproject-fmt==2.5.0",
"pyright==1.1.390",
"pyroma==4.2",
"pytest==8.3.4",
"pytest-cov==6.0.0",
"pytest-regressions==2.5.0",
"pyyaml==6.0.2",
"ruff==0.8.2",
# 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.10.0.1",
"shfmt-py==3.7.0.1",
"sphinx==8.1.3",
"sphinx-click==6.0.0",
"sphinx-copybutton==0.5.2",
"sphinx-inline-tabs==2023.4.21",
"sphinx-substitution-extensions==2024.10.17",
"sphinxcontrib-spelling==8",
"types-docker==7.1.0.20240827",
"types-pygments==2.18.0.20240506",
"vulture==2.13",
"yamlfix==1.17.0",
]
optional-dependencies.packaging = [
"pyinstaller==6.11.1",
]
optional-dependencies.release = [
"check-wheel-contents==0.6.1",
"homebrew-pypi-poet==0.10",
]
urls.Documentation = "https://doccmd.readthedocs.io/en/latest/"
urls.Source = "https://github.com/adamtheturtle/doccmd"
scripts.doccmd = "doccmd:main"
[tool.setuptools]
zip-safe = false
[tool.setuptools.packages.find]
where = [
"src",
]
[tool.setuptools.package-data]
doccmd = [
"py.typed",
]
[tool.distutils.bdist_wheel]
universal = true
[tool.setuptools_scm]
# We write the version to a file so that we can import it.
# We choose a ``.py`` file so that we can read it without
# worrying about including the file in MANIFEST.in.
write_to = "src/doccmd/_setuptools_scm_version.py"
# 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 = [
# We are happy to manage our own "complexity".
"C901",
# Ruff warns that this conflicts with the formatter.
"COM812",
# Allow our chosen docstring line-style - no one-line summary.
"D200",
"D205",
"D212",
"D415",
# 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",
# Allow 'assert' as we use it for tests.
"S101",
# Ignore this rule which might go away and is too strict.
"S603",
]
# 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.pydocstyle.convention = "google"
[tool.pylint]
[tool.pylint.'MASTER']
# Pickle collected data for later comparisons.
persistent = true
# Use multiple processes to speed up Pylint.
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.
# 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.
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',
]
# Allow loading of arbitrary C extensions. Extensions are imported into the
# active Python interpreter and may run arbitrary code.
unsafe-load-any-extension = false
ignore = [
'_setuptools_scm_version.py',
]
[tool.pylint.'MESSAGES CONTROL']
# 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.
enable = [
'bad-inline-option',
'deprecated-pragma',
'file-ignored',
'spelling',
'use-symbolic-message-instead',
'useless-suppression',
]
# 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"
disable = [
'too-few-public-methods',
'too-many-locals',
'too-many-arguments',
'too-many-instance-attributes',
'too-many-return-statements',
'too-many-lines',
'locally-disabled',
# Let ruff handle long lines
'line-too-long',
# Let ruff handle unused imports
'unused-import',
# Let ruff deal with sorting
'ungrouped-imports',
# We don't need everything to be documented because of mypy
'missing-type-doc',
'missing-return-type-doc',
# Too difficult to please
'duplicate-code',
# Let ruff handle imports
'wrong-import-order',
# mypy does not want untyped parameters.
'useless-type-doc',
]
[tool.pylint.'FORMAT']
# Allow the body of an if to be on the same line as the test if there is no
# else.
single-line-if-stmt = false
[tool.pylint.'SPELLING']
# Spelling dictionary name. Available dictionaries: none. To make it working
# install python-enchant package.
spelling-dict = 'en_US'
# A path to a file that contains private dictionary; one word per line.
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-store-unknown-words = 'no'
[tool.pylint.'TYPECHECK']
signature-mutators = [
"click.decorators.option",
"click.decorators.argument",
]
[tool.docformatter]
make-summary-multi-line = true
[tool.check-manifest]
ignore = [
".checkmake-config.ini",
".yamlfmt",
"*.enc",
".git_archival.txt",
".pre-commit-config.yaml",
".shellcheckrc",
".vscode/**",
"CHANGELOG.rst",
"CODE_OF_CONDUCT.rst",
"CONTRIBUTING.rst",
"LICENSE",
"Makefile",
"admin",
"admin/**",
"bin",
"bin/*",
"ci",
"ci/**",
"codecov.yaml",
"conftest.py",
"doc8.ini",
"docs",
"docs/**",
"lint.mk",
"readthedocs.yaml",
"spelling_private_dict.txt",
"src/*/_setuptools_scm_version.py",
"tests",
"tests-pylintrc",
"tests/**",
]
[tool.deptry]
pep621_dev_dependency_groups = [
"dev",
"packaging",
"release",
]
[tool.pyproject-fmt]
indent = 4
keep_full_version = true
max_supported_python = "3.13"
[tool.pytest.ini_options]
xfail_strict = true
log_cli = true
[tool.coverage.run]
branch = true
omit = [
'src/*/_setuptools_scm_version.py',
'src/doccmd/__main__.py',
]
[tool.coverage.report]
exclude_also = [
"if TYPE_CHECKING:",
"class .*\\bProtocol\\):",
"@overload",
]
[tool.mypy]
strict = true
files = [ "." ]
exclude = [ "build" ]
[tool.pyright]
reportUnnecessaryTypeIgnoreComment = true
typeCheckingMode = "strict"
[tool.interrogate]
fail-under = 100
omit-covered-files = true
ignore-overloaded-functions = true
verbose = 2
exclude = [
"src/*/_setuptools_scm_version.py",
]
[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.vulture]
# Ideally we would limit the paths to the source code where we want to ignore names,
# but Vulture does not enable this.
ignore_names = [
# pytest configuration
"pytest_collect_file",
"pytest_collection_modifyitems",
"pytest_plugins",
# pytest fixtures - we name fixtures like this for this purpose
"fixture_*",
# Sphinx
"autoclass_content",
"autoclass_content",
"autodoc_member_order",
"copybutton_exclude",
"extensions",
"html_show_copyright",
"html_show_sourcelink",
"html_show_sphinx",
"html_theme",
"html_theme_options",
"html_title",
"htmlhelp_basename",
"intersphinx_mapping",
"language",
"linkcheck_ignore",
"linkcheck_retries",
"master_doc",
"nitpicky",
"project_copyright",
"pygments_style",
"rst_prolog",
"source_suffix",
"spelling_word_list_filename",
"templates_path",
"warning_is_error",
]
exclude = [
# Duplicate some of .gitignore
".venv",
# We ignore the version file as it is generated by setuptools_scm.
"_setuptools_scm_version.py",
]
[tool.yamlfix]
section_whitelines = 1
whitelines = 1