Skip to content

Commit 00d9536

Browse files
Merge pull request #34 from analog-garage/fix-bug32
Fix bug32
2 parents 315f56e + ad77c5a commit 00d9536

File tree

6 files changed

+15
-35
lines changed

6 files changed

+15
-35
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# mkdocstring-python-xref changes
22

3+
## 1.16.0
4+
5+
* Compatibility with mkdocstrings-python 1.16.*
6+
* Removed some deprecated imports from mkdoctrings
7+
38
## 1.14.1
49

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

environment.yml

+2-1
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

+1-1
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

Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
1.14.1
1+
1.16
2+

src/mkdocstrings_handlers/python_xref/crossref.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
from typing import Callable, List, Optional, cast
2020

2121
from griffe import Docstring, Object
22-
from mkdocstrings.loggers import get_logger
22+
from mkdocstrings import get_logger
2323

2424
__all__ = [
2525
"substitute_relative_crossrefs"

src/mkdocstrings_handlers/python_xref/handler.py

+4-31
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,12 @@
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
28-
from mkdocstrings.handlers.base import CollectorItem
29-
from mkdocstrings.loggers import get_logger
30-
from mkdocstrings_handlers.python.config import PythonOptions, Field, PythonConfig
31-
from mkdocstrings_handlers.python.handler import PythonHandler
27+
from mkdocstrings import CollectorItem, get_logger
28+
from mkdocstrings_handlers.python import PythonHandler, PythonOptions, PythonConfig
3229

3330
from .crossref import substitute_relative_crossrefs
3431

@@ -38,38 +35,14 @@
3835

3936
logger = get_logger(__name__)
4037

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-
4938
# TODO python 3.9 - remove when 3.9 support is dropped
5039
_dataclass_options = {"frozen": True}
5140
if sys.version_info >= (3, 10):
5241
_dataclass_options["kw_only"] = True
5342

5443
@dataclass(**_dataclass_options)
5544
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
45+
check_crossrefs: bool = True
7346

7447
class PythonRelXRefHandler(PythonHandler):
7548
"""Extended version of mkdocstrings Python handler

0 commit comments

Comments
 (0)