Skip to content

Commit

Permalink
refactor: Use dataclasses for configuration/options and automate sche…
Browse files Browse the repository at this point in the history
…ma generation
  • Loading branch information
pawamoy committed Jan 23, 2025
1 parent 83823be commit 8e1e8cc
Show file tree
Hide file tree
Showing 19 changed files with 1,230 additions and 676 deletions.
3 changes: 2 additions & 1 deletion config/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ testpaths =
# action:message_regex:warning_class:module_regex:line
filterwarnings =
error
# TODO: remove once pytest-xdist 4 is released
# TODO: Remove once pytest-xdist 4 is released.
ignore:.*rsyncdir:DeprecationWarning:xdist
# TODO: Remove once mkdocstrings stops setting fallback function.
ignore:.*fallback anchor function:DeprecationWarning:mkdocstrings
316 changes: 0 additions & 316 deletions docs/schema.json

This file was deleted.

7 changes: 0 additions & 7 deletions docs/usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,13 +199,6 @@ in the following pages:
- [Docstrings options](configuration/docstrings.md): options related to docstrings (parsing and rendering)
- [Signature options](configuration/signatures.md): options related to signatures and type annotations

#### Options summary

::: mkdocstrings_handlers.python.handler.PythonHandler.default_config
options:
show_root_heading: false
show_root_toc_entry: false

## Finding modules

There are multiple ways to tell the handler where to find your packages/modules.
Expand Down
2 changes: 2 additions & 0 deletions duties.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@ def check_types(ctx: Context) -> None:
ctx.run(
tools.mypy(*PY_SRC_LIST, config_file="config/mypy.ini"),
title=pyprefix("Type-checking"),
# TODO: Update when Pydantic supports 3.14.
nofail=sys.version_info >= (3, 14),
)


Expand Down
5 changes: 5 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ validation:
absolute_links: warn
unrecognized_links: warn

hooks:
- scripts/mkdocs_hooks.py

nav:
- Home:
- Overview: index.md
Expand Down Expand Up @@ -160,6 +163,8 @@ plugins:
docstring_options:
ignore_init_summary: true
docstring_section_style: list
extensions:
- scripts/griffe_extensions.py
filters: ["!^_"]
heading_level: 1
inherited_members: true
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,10 @@ classifiers = [
"Typing :: Typed",
]
dependencies = [
"mkdocstrings>=0.26",
"mkdocstrings>=0.28",
"mkdocs-autorefs>=1.2",
"griffe>=0.49",
"typing-extensions>=4.0; python_version < '3.11'",
]

[project.urls]
Expand Down Expand Up @@ -106,10 +107,12 @@ dev = [
"mkdocs-git-revision-date-localized-plugin>=1.2",
"mkdocs-literate-nav>=0.6",
"mkdocs-material>=9.5",
"pydantic>=2.10",
"mkdocs-minify-plugin>=0.8",
# YORE: EOL 3.10: Remove line.
"tomli>=2.0; python_version < '3.11'",
]

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

0 comments on commit 8e1e8cc

Please sign in to comment.