From 15ca6d8cbe8187ae2938b3cc3a6134d10c94a3aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Mon, 3 Feb 2025 17:53:44 +0100 Subject: [PATCH 1/2] fix: Fix type errors with options during collection and docstring parsing --- src/mkdocstrings_handlers/python/handler.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mkdocstrings_handlers/python/handler.py b/src/mkdocstrings_handlers/python/handler.py index bf22876d..7ef6b358 100644 --- a/src/mkdocstrings_handlers/python/handler.py +++ b/src/mkdocstrings_handlers/python/handler.py @@ -195,8 +195,12 @@ def get_options(self, local_options: Mapping[str, Any]) -> HandlerOptions: def collect(self, identifier: str, options: PythonOptions) -> CollectorItem: # noqa: D102 module_name = identifier.split(".", 1)[0] unknown_module = module_name not in self._modules_collection - if options == {} and unknown_module: - raise CollectionError("Not loading additional modules during fallback") + reapply = True + if options == {}: + if unknown_module: + raise CollectionError("Not loading additional modules during fallback") + options = self.get_options({}) + reapply = False parser_name = options.docstring_style parser = parser_name and Parser(parser_name) @@ -244,11 +248,11 @@ def collect(self, identifier: str, options: PythonOptions) -> CollectorItem: # except AliasResolutionError as error: raise CollectionError(str(error)) from error - if not unknown_module: + if not unknown_module and reapply: with suppress(AliasResolutionError): if doc_object.docstring is not None: doc_object.docstring.parser = parser - doc_object.docstring.parser_options = parser_options + doc_object.docstring.parser_options = parser_options or {} return doc_object From e14d5b450ba02f62ce0272ceaf66666e0b01fd1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Mon, 3 Feb 2025 17:53:59 +0100 Subject: [PATCH 2/2] chore: Prepare release 1.14.1 --- CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a464bc4..ac0458eb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.14.1](https://github.com/mkdocstrings/python/releases/tag/1.14.1) - 2025-02-03 + +[Compare with 1.14.0](https://github.com/mkdocstrings/python/compare/1.14.0...1.14.1) + +### Bug Fixes + +- Fix type errors with options during collection and docstring parsing ([15ca6d8](https://github.com/mkdocstrings/python/commit/15ca6d8cbe8187ae2938b3cc3a6134d10c94a3aa) by Timothée Mazzucotelli). + ## [1.14.0](https://github.com/mkdocstrings/python/releases/tag/1.14.0) - 2025-02-03 [Compare with 1.13.0](https://github.com/mkdocstrings/python/compare/1.13.0...1.14.0)