fix(deps): update dependency mistletoe to v1.5.1 #17

Merged
kfickel merged 2 commits from renovate/mistletoe-1.x into main 2026-01-18 18:20:22 +01:00
3 changed files with 20 additions and 14 deletions

View file

@ -6,7 +6,7 @@ readme = "README.md"
requires-python = ">=3.12" requires-python = ">=3.12"
dependencies = [ dependencies = [
"click==8.3.1", "click==8.3.1",
"mistletoe==1.4.0", "mistletoe==1.5.1",
"pydantic==2.12.5", "pydantic==2.12.5",
"pydantic-settings[yaml]==2.12.0", "pydantic-settings[yaml]==2.12.0",
"rich==14.2.0", "rich==14.2.0",

View file

@ -1,12 +1,18 @@
from typing import Optional
from mistletoe import Document
from mistletoe.block_token import Paragraph, BlockToken, Heading, List, ListItem
from collections import Counter from collections import Counter
from .markdown_tag import TagMarkdownRenderer from mistletoe.block_token import (
BlockToken,
Document,
Heading,
List,
ListItem,
Paragraph,
)
from .extract_tag import extract_markers_and_tags, has_markers from .extract_tag import extract_markers_and_tags, has_markers
from .shard import Shard, StreamFile
from .list import split_at from .list import split_at
from .markdown_tag import TagMarkdownRenderer
from .shard import Shard, StreamFile
def get_line_number(block_token: BlockToken) -> int: def get_line_number(block_token: BlockToken) -> int:
@ -71,7 +77,7 @@ def find_headings_by_level(
def calculate_heading_level_for_next_split( def calculate_heading_level_for_next_split(
block_tokens: list[BlockToken], block_tokens: list[BlockToken],
) -> Optional[int]: ) -> int | None:
""" """
If there is no marker in any heading, then return None. If there is no marker in any heading, then return None.
If only the first token is a heading with a marker, then return None. If only the first token is a heading with a marker, then return None.
@ -98,7 +104,7 @@ def calculate_heading_level_for_next_split(
def parse_single_block_shards( def parse_single_block_shards(
block_token: BlockToken, start_line: int, end_line: int block_token: BlockToken, start_line: int, end_line: int
) -> tuple[Optional[Shard], list[str]]: ) -> tuple[Shard | None, list[str]]:
markers, tags, children = [], [], [] markers, tags, children = [], [], []
if isinstance(block_token, List): if isinstance(block_token, List):
@ -137,7 +143,7 @@ def parse_multiple_block_shards(
start_line: int, start_line: int,
end_line: int, end_line: int,
enforce_shard: bool = False, enforce_shard: bool = False,
) -> tuple[Optional[Shard], list[str]]: ) -> tuple[Shard | None, list[str]]:
is_first_block_heading = isinstance(block_tokens[0], Heading) and has_markers( is_first_block_heading = isinstance(block_tokens[0], Heading) and has_markers(
block_tokens[0] block_tokens[0]
) )
@ -180,7 +186,7 @@ def parse_header_shards(
start_line: int, start_line: int,
end_line: int, end_line: int,
use_first_child_as_header: bool = False, use_first_child_as_header: bool = False,
) -> Optional[Shard]: ) -> Shard | None:
if len(block_tokens) == 0: if len(block_tokens) == 0:
return build_shard(start_line, end_line) return build_shard(start_line, end_line)

8
uv.lock generated
View file

@ -76,11 +76,11 @@ wheels = [
[[package]] [[package]]
name = "mistletoe" name = "mistletoe"
version = "1.4.0" version = "1.5.1"
source = { registry = "https://pypi.org/simple" } source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/11/96/ea46a376a7c4cd56955ecdfff0ea68de43996a4e6d1aee4599729453bd11/mistletoe-1.4.0.tar.gz", hash = "sha256:1630f906e5e4bbe66fdeb4d29d277e2ea515d642bb18a9b49b136361a9818c9d", size = 107203, upload-time = "2024-07-14T10:17:35.212Z" } sdist = { url = "https://files.pythonhosted.org/packages/31/ae/d33647e2a26a8899224f36afc5e7b7a670af30f1fd87231e9f07ca19d673/mistletoe-1.5.1.tar.gz", hash = "sha256:c5571ce6ca9cfdc7ce9151c3ae79acb418e067812000907616427197648030a3", size = 111769, upload-time = "2025-12-07T16:19:01.066Z" }
wheels = [ wheels = [
{ url = "https://files.pythonhosted.org/packages/2a/0f/b5e545f0c7962be90366af3418989b12cf441d9da1e5d89d88f2f3e5cf8f/mistletoe-1.4.0-py3-none-any.whl", hash = "sha256:44a477803861de1237ba22e375c6b617690a31d2902b47279d1f8f7ed498a794", size = 51304, upload-time = "2024-07-14T10:17:33.243Z" }, { url = "https://files.pythonhosted.org/packages/20/60/0980fefdc4d12c18c1bbab9d62852f27aded8839233c7b0a9827aaf395f5/mistletoe-1.5.1-py3-none-any.whl", hash = "sha256:d3e97664798261503f685f6a6281b092628367cf3128fc68a015a993b0c4feb3", size = 55331, upload-time = "2025-12-07T16:18:59.65Z" },
] ]
[[package]] [[package]]
@ -381,7 +381,7 @@ dev = [
[package.metadata] [package.metadata]
requires-dist = [ requires-dist = [
{ name = "click", specifier = "==8.3.1" }, { name = "click", specifier = "==8.3.1" },
{ name = "mistletoe", specifier = "==1.4.0" }, { name = "mistletoe", specifier = "==1.5.1" },
{ name = "pydantic", specifier = "==2.12.5" }, { name = "pydantic", specifier = "==2.12.5" },
{ name = "pydantic-settings", extras = ["yaml"], specifier = "==2.12.0" }, { name = "pydantic-settings", extras = ["yaml"], specifier = "==2.12.0" },
{ name = "rich", specifier = "==14.2.0" }, { name = "rich", specifier = "==14.2.0" },