mkdocstrings-python-xref 1.14.0__tar.gz → 1.16__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mkdocstrings-python-xref
3
- Version: 1.14.0
3
+ Version: 1.16
4
4
  Summary: Enhanced mkdocstrings python handler
5
5
  Project-URL: Repository, https://github.com/analog-garage/mkdocstrings-python-xref
6
6
  Project-URL: Documentation, https://analog-garage.github.io/mkdocstrings-python-xref/
@@ -17,7 +17,7 @@ Classifier: Programming Language :: Python :: 3.13
17
17
  Classifier: Topic :: Software Development :: Documentation
18
18
  Requires-Python: >=3.9
19
19
  Requires-Dist: griffe>=1.0
20
- Requires-Dist: mkdocstrings-python<2.0,>=1.14
20
+ Requires-Dist: mkdocstrings-python<2.0,>=1.16.6
21
21
  Description-Content-Type: text/markdown
22
22
 
23
23
  # mkdocstrings-python-xref
@@ -19,7 +19,7 @@ import re
19
19
  from typing import Callable, List, Optional, cast
20
20
 
21
21
  from griffe import Docstring, Object
22
- from mkdocstrings.loggers import get_logger
22
+ from mkdocstrings import get_logger
23
23
 
24
24
  __all__ = [
25
25
  "substitute_relative_crossrefs"
@@ -322,7 +322,7 @@ def substitute_relative_crossrefs(obj: Object, checkref: Optional[Callable[[str]
322
322
  """Recursively expand relative cross-references in all docstrings in tree.
323
323
 
324
324
  Arguments:
325
- obj: a Griffe [Object][griffe.dataclasses.] whose docstrings should be modified
325
+ obj: a Griffe [Object][griffe.] whose docstrings should be modified
326
326
  checkref: optional function to check whether computed cross-reference is valid.
327
327
  Should return True if valid, False if not valid.
328
328
  """
@@ -20,15 +20,12 @@ from __future__ import annotations
20
20
  import sys
21
21
  from dataclasses import dataclass, fields
22
22
  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
25
24
  from warnings import warn
26
25
 
27
26
  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
32
29
 
33
30
  from .crossref import substitute_relative_crossrefs
34
31
 
@@ -38,14 +35,6 @@ __all__ = [
38
35
 
39
36
  logger = get_logger(__name__)
40
37
 
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
-
49
38
  # TODO python 3.9 - remove when 3.9 support is dropped
50
39
  _dataclass_options = {"frozen": True}
51
40
  if sys.version_info >= (3, 10):
@@ -53,23 +42,7 @@ if sys.version_info >= (3, 10):
53
42
 
54
43
  @dataclass(**_dataclass_options)
55
44
  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
73
46
 
74
47
  class PythonRelXRefHandler(PythonHandler):
75
48
  """Extended version of mkdocstrings Python handler
@@ -25,7 +25,7 @@ keywords = [
25
25
  dynamic = ["version"]
26
26
  requires-python = ">=3.9"
27
27
  dependencies = [
28
- "mkdocstrings-python >=1.14,<2.0",
28
+ "mkdocstrings-python >=1.16.6,<2.0",
29
29
  "griffe >=1.0"
30
30
  ]
31
31