Skip to content

Commit 55da25c

Browse files
committed
refactor: Use dataclasses for configuration/options and automate schema generation
1 parent 941d0e5 commit 55da25c

File tree

18 files changed

+989
-676
lines changed

18 files changed

+989
-676
lines changed

config/pytest.ini

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +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 Griffe releases v1
16-
ignore:.*`get_logger`:DeprecationWarning:_griffe
17-
ignore:.*`name`:DeprecationWarning:_griffe
15+
# TODO: Remove once mkdocstrings stops setting fallback function.
16+
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: 3 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

pyproject.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ classifiers = [
3030
"Typing :: Typed",
3131
]
3232
dependencies = [
33-
"mkdocstrings>=0.26",
33+
"mkdocstrings>=0.28",
3434
"mkdocs-autorefs>=1.2",
3535
"griffe>=0.49",
3636
]
@@ -113,3 +113,4 @@ dev = [
113113

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

scripts/insiders.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
def human_readable_amount(amount: int) -> str: # noqa: D103
2727
str_amount = str(amount)
2828
if len(str_amount) >= 4: # noqa: PLR2004
29-
return f"{str_amount[:len(str_amount)-3]},{str_amount[-3:]}"
29+
return f"{str_amount[: len(str_amount) - 3]},{str_amount[-3:]}"
3030
return str_amount
3131

3232

0 commit comments

Comments
 (0)