Skip to content

Commit 5ebeda6

Browse files
committed
refactor: Use dataclasses for configuration/options and automate schema generation
1 parent 7d60842 commit 5ebeda6

File tree

18 files changed

+1265
-679
lines changed

18 files changed

+1265
-679
lines changed

config/pytest.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ testpaths =
1010
# action:message_regex:warning_class:module_regex:line
1111
filterwarnings =
1212
error
13-
# TODO: remove once pytest-xdist 4 is released
13+
# TODO: Remove once pytest-xdist 4 is released.
1414
ignore:.*rsyncdir:DeprecationWarning:xdist
15+
# TODO: Remove once mkdocstrings stops setting fallback function.
1516
ignore:.*fallback anchor function:DeprecationWarning:mkdocstrings

docs/schema.json

Lines changed: 0 additions & 316 deletions
This file was deleted.

docs/usage/index.md

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,6 @@ in the following pages:
199199
- [Docstrings options](configuration/docstrings.md): options related to docstrings (parsing and rendering)
200200
- [Signature options](configuration/signatures.md): options related to signatures and type annotations
201201

202-
#### Options summary
203-
204-
::: mkdocstrings_handlers.python.handler.PythonHandler.default_config
205-
options:
206-
show_root_heading: false
207-
show_root_toc_entry: false
208-
209202
## Finding modules
210203

211204
There are multiple ways to tell the handler where to find your packages/modules.

duties.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,8 @@ def check_types(ctx: Context) -> None:
8888
ctx.run(
8989
tools.mypy(*PY_SRC_LIST, config_file="config/mypy.ini"),
9090
title=pyprefix("Type-checking"),
91+
# TODO: Update when Pydantic supports 3.14.
92+
nofail=sys.version_info >= (3, 14),
9193
)
9294

9395

mkdocs.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ validation:
1313
absolute_links: warn
1414
unrecognized_links: warn
1515

16+
hooks:
17+
- scripts/mkdocs_hooks.py
18+
1619
nav:
1720
- Home:
1821
- Overview: index.md
@@ -160,6 +163,8 @@ plugins:
160163
docstring_options:
161164
ignore_init_summary: true
162165
docstring_section_style: list
166+
extensions:
167+
- scripts/griffe_extensions.py
163168
filters: ["!^_"]
164169
heading_level: 1
165170
inherited_members: true

pyproject.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,10 @@ classifiers = [
3030
"Typing :: Typed",
3131
]
3232
dependencies = [
33-
"mkdocstrings>=0.26",
33+
"mkdocstrings>=0.28",
3434
"mkdocs-autorefs>=1.2",
3535
"griffe>=0.49",
36+
"typing-extensions>=4.0; python_version < '3.11'",
3637
]
3738

3839
[project.urls]
@@ -106,10 +107,12 @@ dev = [
106107
"mkdocs-git-revision-date-localized-plugin>=1.2",
107108
"mkdocs-literate-nav>=0.6",
108109
"mkdocs-material>=9.5",
110+
"pydantic>=2.10",
109111
"mkdocs-minify-plugin>=0.8",
110112
# YORE: EOL 3.10: Remove line.
111113
"tomli>=2.0; python_version < '3.11'",
112114
]
113115

114116
[tool.inline-snapshot]
115117
storage-dir = "tests/snapshots"
118+
format-command = "ruff format --config config/ruff.toml --stdin-filename {filename}"

0 commit comments

Comments
 (0)