Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump version to 3.7 #1475

Merged
merged 2 commits into from
Aug 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion markdown/__meta__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
11 changes: 5 additions & 6 deletions scripts/griffe_extensions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand All @@ -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
Expand Down
Loading