mkdocstrings-python 1.14.2__py3-none-any.whl → 1.14.4__py3-none-any.whl
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.
- mkdocstrings_handlers/python/config.py +17 -9
- mkdocstrings_handlers/python/handler.py +7 -2
- {mkdocstrings_python-1.14.2.dist-info → mkdocstrings_python-1.14.4.dist-info}/METADATA +1 -1
- {mkdocstrings_python-1.14.2.dist-info → mkdocstrings_python-1.14.4.dist-info}/RECORD +7 -7
- {mkdocstrings_python-1.14.2.dist-info → mkdocstrings_python-1.14.4.dist-info}/WHEEL +0 -0
- {mkdocstrings_python-1.14.2.dist-info → mkdocstrings_python-1.14.4.dist-info}/entry_points.txt +0 -0
- {mkdocstrings_python-1.14.2.dist-info → mkdocstrings_python-1.14.4.dist-info}/licenses/LICENSE +0 -0
|
@@ -7,12 +7,18 @@ import sys
|
|
|
7
7
|
from dataclasses import field, fields
|
|
8
8
|
from typing import TYPE_CHECKING, Annotated, Any, Literal
|
|
9
9
|
|
|
10
|
+
from mkdocstrings.loggers import get_logger
|
|
11
|
+
|
|
10
12
|
# YORE: EOL 3.10: Replace block with line 2.
|
|
11
13
|
if sys.version_info >= (3, 11):
|
|
12
14
|
from typing import Self
|
|
13
15
|
else:
|
|
14
16
|
from typing_extensions import Self
|
|
15
17
|
|
|
18
|
+
|
|
19
|
+
logger = get_logger(__name__)
|
|
20
|
+
|
|
21
|
+
|
|
16
22
|
try:
|
|
17
23
|
# When Pydantic is available, use it to validate options (done automatically).
|
|
18
24
|
# Users can therefore opt into validation by installing Pydantic in development/CI.
|
|
@@ -30,6 +36,17 @@ try:
|
|
|
30
36
|
if getattr(pydantic, "__version__", "1.").startswith("1."):
|
|
31
37
|
raise ImportError # noqa: TRY301
|
|
32
38
|
|
|
39
|
+
if sys.version_info < (3, 10):
|
|
40
|
+
try:
|
|
41
|
+
import eval_type_backport # noqa: F401
|
|
42
|
+
except ImportError:
|
|
43
|
+
logger.debug(
|
|
44
|
+
"Pydantic needs the `eval-type-backport` package to be installed "
|
|
45
|
+
"for modern type syntax to work on Python 3.9. "
|
|
46
|
+
"Deactivating Pydantic validation for Python handler options.",
|
|
47
|
+
)
|
|
48
|
+
raise
|
|
49
|
+
|
|
33
50
|
from inspect import cleandoc
|
|
34
51
|
|
|
35
52
|
from pydantic import Field as BaseField
|
|
@@ -843,15 +860,6 @@ class PythonInputOptions:
|
|
|
843
860
|
copy = data.copy()
|
|
844
861
|
return {name: copy.pop(name) for name in data if name not in field_names}, copy
|
|
845
862
|
|
|
846
|
-
# YORE: Bump 2: Remove block.
|
|
847
|
-
def __init__(self, **kwargs: Any) -> None:
|
|
848
|
-
"""Initialize the instance."""
|
|
849
|
-
extra_fields = self._extract_extra(kwargs)
|
|
850
|
-
for name, value in kwargs.items():
|
|
851
|
-
object.__setattr__(self, name, value)
|
|
852
|
-
if extra_fields:
|
|
853
|
-
object.__setattr__(self, "_extra", extra_fields)
|
|
854
|
-
|
|
855
863
|
@classmethod
|
|
856
864
|
def coerce(cls, **data: Any) -> MutableMapping[str, Any]:
|
|
857
865
|
"""Coerce data."""
|
|
@@ -186,12 +186,17 @@ class PythonHandler(BaseHandler):
|
|
|
186
186
|
|
|
187
187
|
extra = {**self.global_options.get("extra", {}), **local_options.get("extra", {})}
|
|
188
188
|
options = {**self.global_options, **local_options, "extra": extra}
|
|
189
|
-
# YORE: Bump 2: Replace `, **unknown_extra` with `` within line.
|
|
190
189
|
try:
|
|
191
|
-
return
|
|
190
|
+
# YORE: Bump 2: Replace `opts =` with `return` within line.
|
|
191
|
+
opts = PythonOptions.from_data(**options)
|
|
192
192
|
except Exception as error:
|
|
193
193
|
raise PluginError(f"Invalid options: {error}") from error
|
|
194
194
|
|
|
195
|
+
# YORE: Bump 2: Remove block.
|
|
196
|
+
for key, value in unknown_extra.items():
|
|
197
|
+
object.__setattr__(opts, key, value)
|
|
198
|
+
return opts
|
|
199
|
+
|
|
195
200
|
def collect(self, identifier: str, options: PythonOptions) -> CollectorItem: # noqa: D102
|
|
196
201
|
module_name = identifier.split(".", 1)[0]
|
|
197
202
|
unknown_module = module_name not in self._modules_collection
|
|
@@ -148,9 +148,9 @@ mkdocstrings_handlers/python/.mypy_cache/3.12/watchdog/observers/polling.data.js
|
|
|
148
148
|
mkdocstrings_handlers/python/.mypy_cache/3.12/watchdog/observers/polling.meta.json,sha256=EDv6SusmmK9nmVtgCfInvJ8BlI91GDkqFeYVkybpql0,1941
|
|
149
149
|
mkdocstrings_handlers/python/.mypy_cache/CACHEDIR.TAG,sha256=8cE6_FVTWMkDOw8fMKqhd_6IvaQPS4okWYQA1UeHatw,190
|
|
150
150
|
mkdocstrings_handlers/python/__init__.py,sha256=k-0NWvXysr5RqWjtGyCozookveBB-ADZHIhgxvI1px8,128
|
|
151
|
-
mkdocstrings_handlers/python/config.py,sha256=
|
|
151
|
+
mkdocstrings_handlers/python/config.py,sha256=dZTBl2BbEyVc_o8PW0rReWHDzdqYstOP7fnlWioRVk0,31459
|
|
152
152
|
mkdocstrings_handlers/python/debug.py,sha256=4vqIbCbbz_vcjcFk6jPoF8E1kLig8AQEsQ93ybcjIVc,2894
|
|
153
|
-
mkdocstrings_handlers/python/handler.py,sha256=
|
|
153
|
+
mkdocstrings_handlers/python/handler.py,sha256=ucz0l8mbt-Ez3RAnPOCx3_e5L8PvRsMRJ--ODTOpbZI,14577
|
|
154
154
|
mkdocstrings_handlers/python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
155
155
|
mkdocstrings_handlers/python/rendering.py,sha256=0j1LmGkwJg8zsnNYTnn_a62iqUJv0McIJMSrmh_ap_8,21628
|
|
156
156
|
mkdocstrings_handlers/python/templates/material/_base/attribute.html,sha256=nn0671f4bE7VqnTs-VQL3SGPACWAxb2uJBRcP2nwYng,427
|
|
@@ -327,8 +327,8 @@ mkdocstrings_handlers/python/templates/readthedocs/languages/ja.html.jinja,sha25
|
|
|
327
327
|
mkdocstrings_handlers/python/templates/readthedocs/languages/zh.html,sha256=OuvrkorxuL0gKZNYneann1bwd1Z2i5bBY7SbC496HDw,46
|
|
328
328
|
mkdocstrings_handlers/python/templates/readthedocs/languages/zh.html.jinja,sha256=OuvrkorxuL0gKZNYneann1bwd1Z2i5bBY7SbC496HDw,46
|
|
329
329
|
mkdocstrings_handlers/python/templates/readthedocs/style.css,sha256=Ds8vF1rSxc2B0c4P10osx4cqXHWMntcSCxmRfX-nfzw,971
|
|
330
|
-
mkdocstrings_python-1.14.
|
|
331
|
-
mkdocstrings_python-1.14.
|
|
332
|
-
mkdocstrings_python-1.14.
|
|
333
|
-
mkdocstrings_python-1.14.
|
|
334
|
-
mkdocstrings_python-1.14.
|
|
330
|
+
mkdocstrings_python-1.14.4.dist-info/METADATA,sha256=6PHKMXHWmm30GibflICH_8ZHh1IZ-JJOo1zvZUvpDpE,5570
|
|
331
|
+
mkdocstrings_python-1.14.4.dist-info/WHEEL,sha256=thaaA2w1JzcGC48WYufAs8nrYZjJm8LqNfnXFOFyCC4,90
|
|
332
|
+
mkdocstrings_python-1.14.4.dist-info/entry_points.txt,sha256=6OYgBcLyFCUgeqLgnvMyOJxPCWzgy7se4rLPKtNonMs,34
|
|
333
|
+
mkdocstrings_python-1.14.4.dist-info/licenses/LICENSE,sha256=JGb4pdPEM8TTjjhr-uNCO7oXkiVrwG5Pz0JamcjNF_s,754
|
|
334
|
+
mkdocstrings_python-1.14.4.dist-info/RECORD,,
|
|
File without changes
|
{mkdocstrings_python-1.14.2.dist-info → mkdocstrings_python-1.14.4.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{mkdocstrings_python-1.14.2.dist-info → mkdocstrings_python-1.14.4.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|