Skip to content

Commit 232be0c

Browse files
mkdocstrings-python 1.16.6 compatibility (#32)
1 parent 315f56e commit 232be0c

File tree

5 files changed

+12
-31
lines changed

5 files changed

+12
-31
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# mkdocstring-python-xref changes
22

3+
## 1.16.0
4+
5+
* Compatibility with mkdocstrings-python 1.16.*
6+
37
## 1.14.1
48

59
* Restrict to mkdocstrings-python <1.16 (see bug #32)

environment.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ channels:
55
dependencies:
66
# runtime
77
- python >=3.9,<3.14
8-
- mkdocstrings-python >=1.14,<1.16 # BUG: #32
8+
- mkdocstrings-python >=1.16.6,<2
99
- griffe >=1.0
1010
# build
1111
- python-build >=1.0.0
@@ -24,3 +24,4 @@ dependencies:
2424
- mkdocs >=1.5.3,<2.0
2525
- mkdocs-material >=9.5.4
2626
- linkchecker >=10.4
27+
- pydantic >=2.0

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ keywords = [
2525
dynamic = ["version"]
2626
requires-python = ">=3.9"
2727
dependencies = [
28-
"mkdocstrings-python >=1.14,<1.16", # BUG: #32
28+
"mkdocstrings-python >=1.16.6,<2.0",
2929
"griffe >=1.0"
3030
]
3131

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
1.14.1
1+
1.16
2+

src/mkdocstrings_handlers/python_xref/handler.py

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,13 @@
2020
import sys
2121
from dataclasses import dataclass, fields
2222
from pathlib import Path
23-
from textwrap import dedent
24-
from typing import Annotated, Any, ClassVar, Mapping, MutableMapping, Optional
23+
from typing import Any, ClassVar, Mapping, MutableMapping, Optional
2524
from warnings import warn
2625

2726
from mkdocs.config.defaults import MkDocsConfig
2827
from mkdocstrings.handlers.base import CollectorItem
2928
from mkdocstrings.loggers import get_logger
30-
from mkdocstrings_handlers.python.config import PythonOptions, Field, PythonConfig
29+
from mkdocstrings_handlers.python import PythonOptions, PythonConfig
3130
from mkdocstrings_handlers.python.handler import PythonHandler
3231

3332
from .crossref import substitute_relative_crossrefs
@@ -38,38 +37,14 @@
3837

3938
logger = get_logger(__name__)
4039

41-
42-
# TODO mkdocstrings 0.28
43-
# - `name` and `domain` (py) must be specified as class attributes
44-
# - `handler` arg to superclass is deprecated
45-
# - add `mdx` arg to constructor to pass on to superclass
46-
# - `config_file_path` arg will no longer be passed
47-
#
48-
4940
# TODO python 3.9 - remove when 3.9 support is dropped
5041
_dataclass_options = {"frozen": True}
5142
if sys.version_info >= (3, 10):
5243
_dataclass_options["kw_only"] = True
5344

5445
@dataclass(**_dataclass_options)
5546
class PythonRelXRefOptions(PythonOptions):
56-
check_crossrefs: Annotated[
57-
bool,
58-
Field(
59-
group="docstrings",
60-
parent="docstring_options",
61-
description=dedent(
62-
"""
63-
Enables early checking of all cross-references.
64-
65-
Note that this option only takes affect if **relative_crossrefs** is
66-
also true. This option is true by default, so this option is used to
67-
disable checking. Checking can also be disabled on a per-case basis by
68-
prefixing the reference with '?', e.g. `[something][?dontcheckme]`.
69-
"""
70-
),
71-
),
72-
] = True
47+
check_crossrefs: bool = True
7348

7449
class PythonRelXRefHandler(PythonHandler):
7550
"""Extended version of mkdocstrings Python handler

0 commit comments

Comments
 (0)