From c294b8f7784bb70c011c1846494c0568a5d85186 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 16 Aug 2024 11:08:24 -0400 Subject: [PATCH 1/2] Update griffe_extensions to support Griffe v 1.0. --- scripts/griffe_extensions.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/griffe_extensions.py b/scripts/griffe_extensions.py index 551687fd..210933ec 100644 --- a/scripts/griffe_extensions.py +++ b/scripts/griffe_extensions.py @@ -3,11 +3,10 @@ from __future__ import annotations import ast -from typing import TYPE_CHECKING +from typing import TYPE_CHECKING, Any import textwrap -from griffe import Docstring, Extension -from griffe.docstrings.dataclasses import DocstringSectionAdmonition, DocstringSectionText +from griffe import Docstring, Extension, DocstringSectionAdmonition, DocstringSectionText, Visitor, Inspector if TYPE_CHECKING: from griffe import Class, Function, ObjectNode @@ -29,13 +28,13 @@ def _insert_message(self, obj: Function | Class, message: str) -> None: sections = obj.docstring.parsed sections.insert(0, DocstringSectionAdmonition(kind="warning", text=message, title="Deprecated")) - def on_class_instance(self, node: ast.AST | ObjectNode, cls: Class) -> None: # noqa: ARG002 + def on_class_instance(self, node: ast.AST | ObjectNode, cls: Class, agent: Visitor | Inspector, **kwargs: Any) -> None: # noqa: ARG002 """Add section to docstrings of deprecated classes.""" if message := _deprecated(cls): self._insert_message(cls, message) cls.labels.add("deprecated") - def on_function_instance(self, node: ast.AST | ObjectNode, func: Function) -> None: # noqa: ARG002 + def on_function_instance(self, node: ast.AST | ObjectNode, func: Function, agent: Visitor | Inspector, **kwargs: Any) -> None: # noqa: ARG002 """Add section to docstrings of deprecated functions.""" if message := _deprecated(func): self._insert_message(func, message) @@ -53,7 +52,7 @@ def linked_obj(self, value: str, path: str) -> str: """ Wrap object name in reference link. """ return f'[`{value}`][{path}.{value}]' - def on_function_instance(self, node: ast.AST | ObjectNode, func: Function) -> None: # noqa: ARG002 + def on_function_instance(self, node: ast.AST | ObjectNode, func: Function, agent: Visitor | Inspector, **kwargs: Any) -> None: # noqa: ARG002 """Add table to specified function docstrings.""" if self.paths and func.path not in self.paths: return # skip objects that were not selected From 32823aeb5e7666c5b1e2e22039a7ff4e4a4081d0 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Fri, 16 Aug 2024 10:54:41 -0400 Subject: [PATCH 2/2] Bump version to 3.7 --- docs/changelog.md | 2 +- markdown/__meta__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/changelog.md b/docs/changelog.md index 082ca6d5..cb1919de 100644 --- a/docs/changelog.md +++ b/docs/changelog.md @@ -8,7 +8,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). See the [Contributing Guide](contributing.md) for details. -## [unreleased] +## [3.7] -- 2024-08-16 ### Changed diff --git a/markdown/__meta__.py b/markdown/__meta__.py index 06a51078..640d23fb 100644 --- a/markdown/__meta__.py +++ b/markdown/__meta__.py @@ -28,7 +28,7 @@ from __future__ import annotations -__version_info__ = (3, 6, 0, 'final', 0) +__version_info__ = (3, 7, 0, 'final', 0) def _get_version(version_info):