Skip to content

Commit 50d135a

Browse files
committed
chore: Template upgrade
1 parent 2b7db12 commit 50d135a

File tree

3 files changed

+12
-37
lines changed

3 files changed

+12
-37
lines changed

.copier-answers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Changes here will be overwritten by Copier.
2-
_commit: 1.6.0
2+
_commit: 1.6.1
33
_src_path: gh:mkdocstrings/handler-template
44
author_email: [email protected]
55
author_fullname: Timothée Mazzucotelli

duties.py

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,12 @@
55
import os
66
import re
77
import sys
8-
from contextlib import contextmanager
9-
from importlib.metadata import version as pkgversion
108
from pathlib import Path
119
from typing import TYPE_CHECKING
1210

1311
from duty import duty, tools
1412

1513
if TYPE_CHECKING:
16-
from collections.abc import Iterator
17-
1814
from duty.context import Context
1915

2016

@@ -36,18 +32,6 @@ def pyprefix(title: str) -> str:
3632
return title
3733

3834

39-
@contextmanager
40-
def material_insiders() -> Iterator[bool]:
41-
if "+insiders" in pkgversion("mkdocs-material"):
42-
os.environ["MATERIAL_INSIDERS"] = "true"
43-
try:
44-
yield True
45-
finally:
46-
os.environ.pop("MATERIAL_INSIDERS")
47-
else:
48-
yield False
49-
50-
5135
def _get_changelog_version() -> str:
5236
changelog_version_re = re.compile(r"^## \[(\d+\.\d+\.\d+)\].*$")
5337
with Path(__file__).parent.joinpath("CHANGELOG.md").open("r", encoding="utf8") as file:
@@ -88,11 +72,10 @@ def check_docs(ctx: Context) -> None:
8872
"""Check if the documentation builds correctly."""
8973
Path("htmlcov").mkdir(parents=True, exist_ok=True)
9074
Path("htmlcov/index.html").touch(exist_ok=True)
91-
with material_insiders():
92-
ctx.run(
93-
tools.mkdocs.build(strict=True, verbose=True),
94-
title=pyprefix("Building documentation"),
95-
)
75+
ctx.run(
76+
tools.mkdocs.build(strict=True, verbose=True),
77+
title=pyprefix("Building documentation"),
78+
)
9679

9780

9881
@duty(nofail=PY_VERSION == PY_DEV)
@@ -126,22 +109,18 @@ def docs(ctx: Context, *cli_args: str, host: str = "127.0.0.1", port: int = 8000
126109
host: The host to serve the docs from.
127110
port: The port to serve the docs on.
128111
"""
129-
with material_insiders():
130-
ctx.run(
131-
tools.mkdocs.serve(dev_addr=f"{host}:{port}").add_args(*cli_args),
132-
title="Serving documentation",
133-
capture=False,
134-
)
112+
ctx.run(
113+
tools.mkdocs.serve(dev_addr=f"{host}:{port}").add_args(*cli_args),
114+
title="Serving documentation",
115+
capture=False,
116+
)
135117

136118

137119
@duty(skip_if=sys.version_info < (3, 13), skip_reason=pyprefix("Skipped: docs require modern generics syntax"))
138120
def docs_deploy(ctx: Context) -> None:
139121
"""Deploy the documentation to GitHub pages."""
140122
os.environ["DEPLOY"] = "true"
141-
with material_insiders() as insiders:
142-
if not insiders:
143-
ctx.run(lambda: False, title="Not deploying docs without Material for MkDocs Insiders!")
144-
ctx.run(tools.mkdocs.gh_deploy(force=True), title="Deploying documentation")
123+
ctx.run(tools.mkdocs.gh_deploy(force=True), title="Deploying documentation")
145124

146125

147126
@duty

mkdocs.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -197,11 +197,7 @@ plugins:
197197
reference/mkdocstrings_handlers/python/debug.md: reference/api.md#mkdocstrings_handlers.python.debug
198198
reference/mkdocstrings_handlers/python/handler.md: reference/api.md#mkdocstrings_handlers.python.handler
199199
reference/mkdocstrings_handlers/python/rendering.md: reference/api.md#mkdocstrings_handlers.python.rendering
200-
201-
- group:
202-
enabled: !ENV [MATERIAL_INSIDERS, false]
203-
plugins:
204-
- typeset
200+
- typeset
205201

206202
extra:
207203
social:

0 commit comments

Comments
 (0)