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 13, 2025
1 parent 941d0e5 commit 55da25c
Show file tree
Hide file tree
Showing 18 changed files with 989 additions and 676 deletions.
7 changes: 3 additions & 4 deletions config/pytest.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +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 Griffe releases v1
ignore:.*`get_logger`:DeprecationWarning:_griffe
ignore:.*`name`:DeprecationWarning:_griffe
# 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
3 changes: 3 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
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
"Typing :: Typed",
]
dependencies = [
"mkdocstrings>=0.26",
"mkdocstrings>=0.28",
"mkdocs-autorefs>=1.2",
"griffe>=0.49",
]
Expand Down Expand Up @@ -113,3 +113,4 @@ dev = [

[tool.inline-snapshot]
storage-dir = "tests/snapshots"
format-command = "ruff format --config config/ruff.toml --stdin-filename {filename}"
2 changes: 1 addition & 1 deletion scripts/insiders.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
def human_readable_amount(amount: int) -> str: # noqa: D103
str_amount = str(amount)
if len(str_amount) >= 4: # noqa: PLR2004
return f"{str_amount[:len(str_amount)-3]},{str_amount[-3:]}"
return f"{str_amount[: len(str_amount) - 3]},{str_amount[-3:]}"
return str_amount


Expand Down
Loading

0 comments on commit 55da25c

Please sign in to comment.