From 4a20aeaa60f3efbcb4781a369feef3b4826ff1df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Tue, 15 Feb 2022 13:25:22 +0100 Subject: [PATCH 1/3] fix: Fix rendering init method source when merged into class --- .../python/templates/material/_base/class.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mkdocstrings_handlers/python/templates/material/_base/class.html b/src/mkdocstrings_handlers/python/templates/material/_base/class.html index 97a5640b..8f47fb84 100644 --- a/src/mkdocstrings_handlers/python/templates/material/_base/class.html +++ b/src/mkdocstrings_handlers/python/templates/material/_base/class.html @@ -91,10 +91,10 @@ {% if config.show_source %} {% if config.merge_init_into_class %} - {% if "__init__" in class.members %} + {% if "__init__" in class.members and class.members["__init__"].source %}
Source code in {{ class.relative_filepath }} - {{ class.members["__init__"].source|highlight(language="python", linestart=class.lineno, linenums=True) }} + {{ class.members["__init__"].source|highlight(language="python", linestart=class.members["__init__"].lineno, linenums=True) }}
{% endif %} {% elif class.source %} From bde32afb5d99539813b1884a4c735de5845f62ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Thu, 17 Feb 2022 18:27:07 +0100 Subject: [PATCH 2/3] fix: Don't pop from fallback config --- src/mkdocstrings_handlers/python/collector.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mkdocstrings_handlers/python/collector.py b/src/mkdocstrings_handlers/python/collector.py index 02502e05..eb1879bd 100644 --- a/src/mkdocstrings_handlers/python/collector.py +++ b/src/mkdocstrings_handlers/python/collector.py @@ -55,7 +55,7 @@ def collect(self, identifier: str, config: dict) -> CollectorItem: # noqa: WPS2 """ module_name = identifier.split(".", 1)[0] unknown_module = module_name not in self._modules_collection - if config.pop("fallback", False) and unknown_module: + if config.get("fallback", False) and unknown_module: raise CollectionError("Not loading additional modules during fallback") final_config = ChainMap(config, self.default_config) From ad6c7dceabbcedc841578796542f93498c53ac59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Mazzucotelli?= Date: Thu, 17 Feb 2022 18:29:28 +0100 Subject: [PATCH 3/3] chore: Prepare release 0.6.1 --- CHANGELOG.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9b51648e..818971b2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,15 @@ 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). +## [0.6.1](https://github.com/mkdocstrings/python/releases/tag/0.6.1) - 2022-02-17 + +[Compare with 0.6.0](https://github.com/mkdocstrings/python/compare/0.6.0...0.6.1) + +### Bug Fixes +- Don't pop from fallback config ([bde32af](https://github.com/mkdocstrings/python/commit/bde32afb5d99539813b1884a4c735de5845f62ae) by Timothée Mazzucotelli). +- Fix rendering init method source when merged into class ([4a20aea](https://github.com/mkdocstrings/python/commit/4a20aeaa60f3efbcb4781a369feef3b4826ff1df) by Timothée Mazzucotelli). + + ## [0.6.0](https://github.com/mkdocstrings/python/releases/tag/0.6.0) - 2022-02-13 [Compare with 0.5.4](https://github.com/mkdocstrings/python/compare/0.5.4...0.6.0)