[med-svn] [Git][python-team/packages/python-schema-salad][master] 3 commits: d/control: change build-dep to python3-all-dev (not just python3-dev).

Michael R. Crusoe (@crusoe) gitlab at salsa.debian.org
Wed Jan 3 10:45:34 GMT 2024



Michael R. Crusoe pushed to branch master at Debian Python Team / packages / python-schema-salad


Commits:
d0a90aec by Michael R. Crusoe at 2024-01-02T14:21:52+01:00
d/control: change build-dep to python3-all-dev (not just python3-dev).

- - - - -
2ef4a4e4 by Michael R. Crusoe at 2024-01-02T14:32:06+01:00
New version Closes: #1058270

- - - - -
ec7c0d17 by Michael R. Crusoe at 2024-01-02T15:41:00+01:00
d/patches/mistune3.patch: add Francis Charette Migneault's fixes for mistune3.

- - - - -


6 changed files:

- debian/changelog
- debian/control
- + debian/patches/mistune3.patch
- debian/patches/rework_all
- debian/patches/series
- debian/patches/typescript_license


Changes:

=====================================
debian/changelog
=====================================
@@ -1,9 +1,15 @@
 python-schema-salad (8.5.20231201181309-1) UNRELEASED; urgency=medium
 
-  * Team upload.
-  * New upstream version
+  [ Andreas Tille ]
+  * New upstream version. Closes: #1058270
+
+  [ Michael R. Crusoe ]
+  * d/control: change build-dep to python3-all-dev (not just python3-dev).
+  * d/patches/mistune3.patch: add Francis Charette Migneault's fixes for
+    mistune3.
+  * d/control: bump python3-mistune dependency to at least version 3
 
- -- Andreas Tille <tille at debian.org>  Thu, 21 Dec 2023 08:43:52 +0100
+ -- Michael R. Crusoe <crusoe at debian.org>  Tue, 02 Jan 2024 14:12:47 +0100
 
 python-schema-salad (8.4.20230808163024-1) unstable; urgency=medium
 


=====================================
debian/control
=====================================
@@ -7,11 +7,11 @@ Build-Depends: debhelper-compat (= 13),
                dh-sequence-python3,
                python3,
                python3-all,
-               python3-dev,
+               python3-all-dev,
                python3-future,
                python3-setuptools,
                python3-setuptools-scm,
-               python3-mistune (>> 2),
+               python3-mistune (>> 3),
                python3-requests,
                python3-yaml,
                python3-rdflib,
@@ -37,7 +37,7 @@ Rules-Requires-Root: no
 Package: python3-schema-salad
 Architecture: any
 Depends: ${python3:Depends},
-         python3-mistune0,
+         python3-mistune ( >> 3),
          python3-filelock,
          ${misc:Depends},
          libjs-bootstrap


=====================================
debian/patches/mistune3.patch
=====================================
@@ -0,0 +1,573 @@
+From 29f90c7a7541465934a0669edc4a87816b53b6e1 Mon Sep 17 00:00:00 2001
+From: Francis Charette Migneault <francis.charette.migneault at gmail.com>
+Date: Sat, 14 Oct 2023 00:03:42 -0400
+Subject: [PATCH] update makedoc using mistune v3
+
+---
+ mypy-stubs/mistune/__init__.pyi         |  28 -----
+ mypy-stubs/mistune/_types.pyi           |   5 -
+ mypy-stubs/mistune/block_parser.pyi     | 147 ------------------------
+ mypy-stubs/mistune/inline_parser.pyi    |  76 ------------
+ mypy-stubs/mistune/markdown.pyi         |  35 ------
+ mypy-stubs/mistune/plugins/__init__.pyi |  21 ----
+ mypy-stubs/mistune/plugins/table.pyi    |  17 ---
+ mypy-stubs/mistune/renderers.pyi        | 109 ------------------
+ mypy-stubs/mistune/scanner.pyi          |  62 ----------
+ mypy-stubs/mistune/util.pyi             |   7 --
+ requirements.txt                        |   2 +-
+ schema_salad/makedoc.py                 |  42 ++++---
+ setup.py                                |   2 +-
+ 13 files changed, 29 insertions(+), 524 deletions(-)
+ delete mode 100644 mypy-stubs/mistune/__init__.pyi
+ delete mode 100644 mypy-stubs/mistune/_types.pyi
+ delete mode 100644 mypy-stubs/mistune/block_parser.pyi
+ delete mode 100644 mypy-stubs/mistune/inline_parser.pyi
+ delete mode 100644 mypy-stubs/mistune/markdown.pyi
+ delete mode 100644 mypy-stubs/mistune/plugins/__init__.pyi
+ delete mode 100644 mypy-stubs/mistune/plugins/table.pyi
+ delete mode 100644 mypy-stubs/mistune/renderers.pyi
+ delete mode 100644 mypy-stubs/mistune/scanner.pyi
+ delete mode 100644 mypy-stubs/mistune/util.pyi
+
+--- python-schema-salad.orig/mypy-stubs/mistune/__init__.pyi
++++ python-schema-salad/mypy-stubs/mistune/__init__.pyi
+@@ -1,28 +1,26 @@
+-from typing import Iterable, Optional, Union
++from typing import Iterable, Optional, Union, Any
+ 
+ from mistune._types import *
+-from mistune.inline_parser import RendererT
+-from mistune.markdown import Markdown, ParseHook, RenderHook
+-from mistune.plugins import Plugin, PluginName
+-from mistune.renderers import BaseRenderer, DataT, HTMLRenderer, HTMLType
++from mistune.markdown import Markdown
++from mistune.core import BaseRenderer
++from mistune.renderers.html import HTMLRenderer
+ from typing_extensions import Literal
+ 
+-html: Markdown[HTMLType, HTMLRenderer]
++html: Markdown
+ 
+-RendererRef = Union[Literal["html", "ast"], BaseRenderer[DataT]]
+-PluginRef = Union[PluginName, Plugin]  # reference to register a plugin
++RendererRef = Union[Literal["html", "ast"], BaseRenderer]
+ 
+ def create_markdown(
+     escape: bool = False,
+     hard_wrap: bool = False,
+-    renderer: Optional[RendererRef[DataT]] = None,
+-    plugins: Optional[Iterable[PluginRef]] = None,
+-) -> Markdown[DataT, RendererT]: ...
++    renderer: Optional[RendererRef] = None,
++    plugins: Optional[Iterable[Any]] = None,
++) -> Markdown: ...
+ def markdown(
+     text: str,
+     escape: bool = True,
+-    renderer: Optional[BaseRenderer[DataT]] = None,
+-    plugins: Optional[Iterable[PluginRef]] = None,
++    renderer: Optional[BaseRenderer] = None,
++    plugins: Optional[Iterable[Any]] = None,
+ ) -> str: ...
+ 
+ __version__: str
+--- python-schema-salad.orig/mypy-stubs/mistune/block_parser.pyi
++++ python-schema-salad/mypy-stubs/mistune/block_parser.pyi
+@@ -14,8 +14,6 @@
+ )
+ 
+ from mistune._types import State, Tokens
+-from mistune.inline_parser import InlineParser, RendererT
+-from mistune.renderers import DataT
+ from mistune.scanner import Matcher, ScannerParser
+ from typing_extensions import Literal, NotRequired, Required, TypeAlias, TypedDict
+ 
+@@ -91,57 +89,5 @@
+     ParsedBlockListItem = ParsedBlock
+     ParsedBlockParagraph = ParsedBlock
+ 
+-class BlockParser(ScannerParser):
+-    NEWLINE: Pattern[str]
+-    DEF_LINK: Pattern[str]
+-    AXT_HEADING: Pattern[str]
+-    SETEX_HEADING: Pattern[str]
+-    THEMATIC_BREAK: Pattern[str]
+-    INDENT_CODE: Pattern[str]
+-    FENCED_CODE: Pattern[str]
+-    BLOCK_QUOTE: Pattern[str]
+-    LIST_START: Pattern[str]
+-    BLOCK_HTML: Pattern[str]
+-    LIST_MAX_DEPTH: ClassVar[int]
+-    BLOCK_QUOTE_MAX_DEPTH: ClassVar[int]
+-
+-    scanner_cls: ClassVar[Type[Matcher]] = Matcher
+-    block_quote_rules: List[str]
+-    list_rules = List[str]
+-
+-    def __init__(self) -> None: ...
+-    def parse_newline(self, m: Match[str], state: State) -> ParsedBlockNewline: ...
+-    def parse_thematic_break(self, m: Match[str], state: State) -> ParsedBlockThematicBreak: ...
+-    def parse_indent_code(self, m: Match[str], state: State) -> ParsedBlockBlockCode: ...
+-    def parse_fenced_code(self, m: Match[str], state: State) -> ParsedBlockBlockCode: ...
+-    def tokenize_block_code(
+-        self, code: str, info: Tuple[str, ...], state: State
+-    ) -> ParsedBlockBlockCode: ...
+-    def parse_axt_heading(self, m: Match[str], state: State) -> ParsedBlockHeading: ...
+-    def parse_setex_heading(self, m: Match[str], state: State) -> ParsedBlockHeading: ...
+-    def tokenize_heading(self, text: str, level: int, state: State) -> ParsedBlockHeading: ...
+-    def get_block_quote_rules(self, depth: int) -> List[str]: ...
+-    def parse_block_quote(self, m: Match[str], state: State) -> ParsedBlockBlockQuote: ...
+-    def get_list_rules(self, depth: int) -> List[str]: ...
+-    def parse_list_start(
+-        self, m: Match[str], state: State, string: str
+-    ) -> Tuple[ParsedBlockList, int]: ...
+-    def parse_list_item(
+-        self, text: str, depth: int, state: State, rules: List[str]
+-    ) -> ParsedBlockListItem: ...
+-    def normalize_list_item_text(self, text: str) -> str: ...
+-    def parse_block_html(self, m: Match[str], state: State) -> ParsedBlockBlockHTML: ...
+-    def parse_def_link(self, m: Match[str], state: State) -> None: ...
+-    def parse_text(
+-        self, text: str, state: State
+-    ) -> Union[ParsedBlockBlockText, List[ParsedBlockParagraph]]: ...
+-    def parse(self, s: str, state: State, rules: Optional[List[str]] = None) -> Tokens: ...
+-    def render(
+-        self, tokens: Tokens, inline: InlineParser[RendererT], state: State
+-    ) -> Any: ...  # technically DataT, but defined by 'inline.renderer.finalize'
+-    def _iter_render(
+-        self, tokens: Tokens, inline: InlineParser[RendererT], state: State
+-    ) -> Iterator[DataT]: ...
+-
+ def cleanup_lines(s: str) -> str: ...
+ def expand_leading_tab(text: str) -> str: ...
+--- python-schema-salad.orig/mypy-stubs/mistune/inline_parser.pyi
++++ python-schema-salad/mypy-stubs/mistune/inline_parser.pyi
+@@ -12,7 +12,7 @@
+ )
+ 
+ from mistune._types import State
+-from mistune.renderers import AstRenderer, DataT, HTMLRenderer
++#from mistune.renderers import AstRenderer, DataT, HTMLRenderer
+ from mistune.scanner import ScannerParser
+ from mistune.util import ESCAPE_TEXT
+ from typing_extensions import Literal
+@@ -24,53 +24,6 @@
+ LINK_LABEL: str
+ 
+ # Union[BaseRenderer[DataT], AstRenderer, HTMLRenderer]
+-RendererT = TypeVar("RendererT", bound=Union[AstRenderer, HTMLRenderer])
++# RendererT = TypeVar("RendererT", bound=Union[AstRenderer, HTMLRenderer])
+ 
+-class InlineParser(ScannerParser, Generic[RendererT]):
+-    ESCAPE: ClassVar[str] = ESCAPE_TEXT
+-    AUTO_LINK: ClassVar[str]
+-    STD_LINK: ClassVar[str]
+-    REF_LINK: ClassVar[str]
+-    REF_LINK2: ClassVar[str]
+-    ASTERISK_EMPHASIS: ClassVar[str]
+-    UNDERSCORE_EMPHASIS: ClassVar[str]
+-    CODESPAN: ClassVar[str]
+-    LINEBREAK: ClassVar[str]
+-    INLINE_HTML: ClassVar[str]
+-    RULE_NAMES: ClassVar[Tuple[str, ...]]
+ 
+-    renderer: RendererT
+-
+-    def __init__(self, renderer: RendererT, hard_wrap: bool = False) -> None: ...
+-    def parse_escape(self, m: Match[str], state: State) -> Tuple[Literal["text"], str]: ...
+-    def parse_autolink(self, m: Match[str], state: State) -> Tuple[Literal["link"], str, str]: ...
+-    def parse_std_link(
+-        self, m: Match[str], state: State
+-    ) -> Tuple[Literal["link"], str, str, str]: ...
+-    def parse_ref_link(
+-        self, m: Match[str], state: State
+-    ) -> Tuple[Literal["link"], str, str, str]: ...
+-    def parse_ref_link2(
+-        self, m: Match[str], state: State
+-    ) -> Tuple[Literal["link"], str, str, str]: ...
+-    def tokenize_link(
+-        self, line: str, link: str, text: str, title: str, state: State
+-    ) -> Tuple[Literal["link"], str, str, str]: ...
+-    def parse_asterisk_emphasis(
+-        self, m: Match[str], state: State
+-    ) -> Tuple[Literal["strong", "emphasis"], str]: ...
+-    def parse_underscore_emphasis(
+-        self, m: Match[str], state: State
+-    ) -> Tuple[Literal["strong", "emphasis"], str]: ...
+-    def tokenize_emphasis(self, m: Match[str], state: State) -> Tuple[str, str]: ...
+-    def parse_codespan(self, m: Match[str], state: State) -> Tuple[Literal["codespan"], str]: ...
+-    def parse_linebreak(self, m: Match[str], state: State) -> Tuple[Literal["linebreak"], str]: ...
+-    def parse_inline_html(
+-        self, m: Match[str], state: State
+-    ) -> Tuple[Literal["inline_html"], str]: ...
+-    def parse_text(self, text: str, state: State) -> Tuple[Literal["text"], str]: ...
+-    def parse(self, s: str, state: State, rules: Optional[List[str]]) -> Iterator[DataT]: ...
+-    def render(
+-        self, s: str, state: State, rules: Optional[List[str]]
+-    ) -> Union[DataT, List[DataT]]: ...
+-    def __call__(self, s: str, state: State) -> Union[DataT, List[DataT]]: ...
+--- python-schema-salad.orig/mypy-stubs/mistune/markdown.pyi
++++ python-schema-salad/mypy-stubs/mistune/markdown.pyi
+@@ -1,29 +1,18 @@
+ from typing import Any, Callable, Dict, Generic, Iterable, List, Match, Optional, Tuple
+ 
+ from mistune._types import State
+-from mistune.block_parser import BlockParser
+-from mistune.inline_parser import InlineParser, RendererT
+-from mistune.plugins import Plugin
+-from mistune.renderers import BaseRenderer, DataT
++from mistune.core import BaseRenderer
+ 
+ Tokens = List[Dict[str, Any]]
+-ParseHook = Callable[[Markdown[DataT, RendererT], DataT, State], Tuple[str, State]]
+-RenderHook = Callable[[Markdown[DataT, RendererT], Tokens, State], Tokens]
+ 
+-class Markdown(Generic[DataT, RendererT]):
+-    renderer: BaseRenderer[DataT]
+-    inline: InlineParser[RendererT]
+-    block: BlockParser
+-    before_parse_hooks: List[ParseHook[DataT, RendererT]]
+-    before_render_hooks: List[RenderHook[DataT, RendererT]]
+-    after_render_hooks: List[RenderHook[DataT, RendererT]]
++class Markdown():
+ 
+     def __init__(
+         self,
+-        renderer: BaseRenderer[DataT],
+-        block: Optional[BlockParser] = None,
+-        inline: Optional[InlineParser[RendererT]] = None,
+-        plugins: Optional[Iterable[Plugin]] = None,
++        renderer: BaseRenderer,
++        block: Optional[Any] = None,
++        inline: Optional[Any] = None,
++        plugins: Optional[Iterable[Any]] = None,
+     ) -> None: ...
+     def before_parse(self, s: str, state: State) -> Tuple[str, State]: ...
+     def before_render(self, tokens: Tokens, state: State) -> Tokens: ...
+--- python-schema-salad.orig/mypy-stubs/mistune/renderers.pyi
++++ /dev/null
+@@ -1,109 +0,0 @@
+-from typing import Any, Callable, ClassVar, Generic, List, Optional, Set, TypeVar, Union
+-
+-from typing_extensions import Literal, NotRequired, Required, TypeAlias, TypedDict
+-
+-AstType = Literal[
+-    "text",
+-    "image",
+-    "codespan",
+-    "linebreak",
+-    "inline_html",
+-    "heading",
+-    "newline",
+-    "thematic_break",
+-    "block_code",
+-    "block_html",
+-    "list",
+-    "list_item",
+-]
+-_AstChildren: TypeAlias = "AstChildren"
+-AstObject = TypedDict(
+-    "AstObject",
+-    {
+-        "type": Required[AstType],
+-        "text": Required[Optional[_AstChildren]],
+-        "link": NotRequired[str],
+-        "info": NotRequired[Optional[str]],
+-        "children": NotRequired[Union[_AstChildren, List[_AstChildren]]],
+-        "ordered": NotRequired[bool],
+-        "level": NotRequired[int],
+-    },
+-    total=False,
+-)
+-AstChildren = Union[AstObject, str]
+-
+-HTMLType = str
+-DataT = TypeVar("DataT", bound=Union[AstChildren, HTMLType])
+-
+-RenderMethod = Union[
+-    Callable[[], DataT],  # blank
+-    Callable[[DataT, Any], DataT],
+-]
+-
+-class BaseRenderer(Generic[DataT]):
+-    NAME: ClassVar[str] = "base"
+-
+-    def _get_method(self, name: AstType) -> RenderMethod[DataT]: ...
+-    def finalize(self, data: DataT) -> Any: ...
+-
+-class AstRenderer(BaseRenderer[AstChildren]):
+-    NAME: ClassVar[Literal["ast"]] = "ast"
+-
+-    def __init__(
+-        self, escape: bool = True, allow_harmful_protocols: Optional[bool] = None
+-    ) -> None: ...
+-    def _create_default_method(self, name: AstType) -> RenderMethod[AstChildren]: ...
+-    def _get_method(self, name: AstType) -> RenderMethod[AstChildren]: ...
+-    def text(self, text: str) -> AstChildren: ...
+-    def link(
+-        self, link: str, text: Optional[str] = None, title: Optional[str] = None
+-    ) -> AstChildren: ...
+-    def image(self, src: str, alt: str = "", title: Optional[str] = None) -> AstChildren: ...
+-    def codespan(self, text: str) -> AstChildren: ...
+-    def linebreak(self, text: str) -> AstChildren: ...
+-    def inline_html(self, text: str) -> AstChildren: ...
+-    def paragraph(self, text: str) -> AstChildren: ...
+-    def heading(self, text: str, level: int) -> AstChildren: ...
+-    def newline(self) -> AstChildren: ...
+-    def thematic_break(self) -> AstChildren: ...
+-    def block_code(self, code: str, info: Optional[str] = None) -> AstChildren: ...
+-    def block_html(self, html: str) -> AstChildren: ...
+-    def list(
+-        self, children: str, ordered: bool, level: int, start: Optional[int] = None
+-    ) -> AstChildren: ...
+-    def list_item(self, children: str, level: int) -> AstChildren: ...
+-    def finalize(self, data: DataT) -> List[DataT]: ...
+-
+-class HTMLRenderer(BaseRenderer[HTMLType]):
+-    NAME: ClassVar[Literal["html"]] = "html"
+-    HARMFUL_PROTOCOLS: ClassVar[Set[str]]
+-    _escape: bool
+-    _allow_harmful_protocols: Optional[bool]
+-
+-    def __init__(
+-        self, escape: bool = True, allow_harmful_protocols: Optional[bool] = None
+-    ) -> None: ...
+-    def _safe_url(self, url: str) -> str: ...
+-    def text(self, text: str) -> HTMLType: ...
+-    def link(
+-        self, link: str, text: Optional[str] = None, title: Optional[str] = None
+-    ) -> HTMLType: ...
+-    def image(self, src: str, alt: str = "", title: Optional[str] = None) -> HTMLType: ...
+-    def emphasis(self, text: str) -> HTMLType: ...
+-    def strong(self, text: str) -> HTMLType: ...
+-    def codespan(self, text: str) -> HTMLType: ...
+-    def linebreak(self, text: str) -> HTMLType: ...
+-    def inline_html(self, text: str) -> HTMLType: ...
+-    def paragraph(self, text: str) -> HTMLType: ...
+-    def heading(self, text: str, level: int) -> HTMLType: ...
+-    def newline(self) -> HTMLType: ...
+-    def thematic_break(self) -> HTMLType: ...
+-    def block_code(self, code: str, info: Optional[str] = None) -> HTMLType: ...
+-    def block_quote(self, text: str) -> HTMLType: ...
+-    def block_html(self, html: str) -> HTMLType: ...
+-    def block_error(self, html: str) -> HTMLType: ...
+-    def list(
+-        self, text: str, ordered: bool, level: int, start: Optional[int] = None
+-    ) -> HTMLType: ...
+-    def list_item(self, text: str, level: int) -> HTMLType: ...
+-    def finalize(self, data: DataT) -> HTMLType: ...
+--- python-schema-salad.orig/requirements.txt
++++ python-schema-salad/requirements.txt
+@@ -1,7 +1,7 @@
+ requests >= 1.0
+ ruamel.yaml >= 0.17.6, < 0.19
+ rdflib>= 4.2.2, < 8.0.0
+-mistune>=2.0.3,<2.1
++mistune>=3,<3.1
+ CacheControl[filecache]>= 0.11.7, < 0.14
+ black>=19.10b0,<23.12
+ mypy_extensions
+--- python-schema-salad.orig/schema_salad/makedoc.py
++++ python-schema-salad/schema_salad/makedoc.py
+@@ -8,10 +8,10 @@
+ from io import StringIO, TextIOWrapper
+ from typing import (
+     IO,
+-    TYPE_CHECKING,
+     Any,
+     Dict,
+     List,
++    Literal,
+     MutableMapping,
+     MutableSequence,
+     Optional,
+@@ -22,23 +22,32 @@
+ from urllib.parse import urldefrag
+ 
+ from mistune import create_markdown
+-from mistune.renderers import HTMLRenderer
+-from mistune.util import escape_html
++from mistune.core import BlockState
++from mistune.markdown import Markdown
++from mistune.renderers.html import HTMLRenderer
+ 
+ from .exceptions import SchemaSaladException, ValidationException
+ from .schema import avro_field_name, extend_and_specialize, get_metaschema
+ from .utils import add_dictlist, aslist
+ from .validate import avro_type_name
+ 
+-if TYPE_CHECKING:
+-    # avoid import error since typing stubs do not exist in actual package
+-    from mistune import State
+-    from mistune.markdown import Markdown
+-    from mistune.plugins import PluginName
++PluginName = Literal[
++    "url",
++    "strikethrough",
++    "footnotes",
++    "table",
++    "task_lists",
++    "def_list",
++    "abbr",
++]
+ 
+ _logger = logging.getLogger("salad")
+ 
+ 
++def escape_html(s: str) -> str:
++    return html.escape(html.unescape(s)).replace('&#x27;', "'")
++
++
+ def vocab_type_name(url: str) -> str:
+     """Remove the avro namespace, if any."""
+     return avro_type_name(url).split(".")[-1]
+@@ -70,7 +79,7 @@
+ class MyRenderer(HTMLRenderer):
+     """Custom renderer with different representations of selected HTML tags."""
+ 
+-    def heading(self, text: str, level: int) -> str:
++    def heading(self, text: str, level: int, **attrs: Any) -> str:
+         """Override HTML heading creation with text IDs."""
+         return """<h{} id="{}" class="section">{} <a href="#{}">§</a></h{}>""".format(
+             level, to_id(text), text, to_id(text), level
+@@ -104,9 +113,10 @@
+         return text + ">" + html.escape(code, quote=self._escape) + "</code></pre>\n"
+ 
+ 
++# FIXME: this can be removed with mistune v3!
+ def markdown_list_hook(
+-    markdown: "Markdown[str, Any]", text: str, state: "State"
+-) -> Tuple[str, "State"]:
++    markdown: Markdown, state: BlockState, text: Optional[str] = None,
++) -> Tuple[str, BlockState]:
+     """Patches problematic Markdown lists for later HTML generation.
+ 
+     When a Markdown list with paragraphs not indented with the list
+@@ -154,6 +164,8 @@
+         r"(?P<remain>.*)",
+         re.MULTILINE,
+     )
++    if text is None:
++        text = state.src
+     matches = list(re.finditer(pattern, text))
+     if not matches:
+         return text, state
+@@ -179,7 +191,7 @@
+                     if line.strip()
+                 ]
+             )
+-            intend_list, _ = markdown_list_hook(markdown, intend_list, state)
++            intend_list, _ = markdown_list_hook(markdown, state, intend_list)
+             # remove final newline from other if/else branch
+             intend_list = intend_list.rstrip()
+             intend_list = "\n".join([indent_prefix + line for line in intend_list.split("\n")])
+@@ -583,7 +595,7 @@
+             f["doc"] = number_headings(self.toc, f["doc"])
+ 
+         doc = doc + "\n\n" + f["doc"]
+-        plugins: List["PluginName"] = [
++        plugins: List[PluginName] = [
+             "strikethrough",
+             "footnotes",
+             "table",
+@@ -592,12 +604,12 @@
+         # if escape active, wraps literal HTML into '<p> {HTML} </p>'
+         # we must pass it to both since 'MyRenderer' is predefined
+         escape = False
+-        markdown2html: "Markdown[str, Any]" = create_markdown(
++        markdown2html: Markdown = create_markdown(
+             renderer=MyRenderer(escape=escape),
+             plugins=plugins,
+             escape=escape,
+         )
+-        markdown2html.before_parse_hooks.append(markdown_list_hook)
++        ##markdown2html.before_parse_hooks.append(markdown_list_hook)  # FIXME: this can be removed with mistune v3!
+         doc = markdown2html(doc)
+ 
+         if f["type"] == "record":
+--- python-schema-salad.orig/setup.py
++++ python-schema-salad/setup.py
+@@ -87,7 +87,7 @@
+     "requests >= 1.0",
+     "ruamel.yaml >= 0.17.6, < 0.19",
+     "rdflib >= 4.2.2, < 8.0.0",
+-    "mistune>=2.0.3,<2.1",
++    "mistune>=3,<3.1",
+     "CacheControl[filecache] >= 0.11.7, < 0.14",
+     "mypy_extensions",
+     "importlib_resources>=1.4;python_version<'3.9'",
+--- /dev/null
++++ python-schema-salad/mypy-stubs/mistune/core.pyi
+@@ -0,0 +1,26 @@
++from typing import Any, Callable, ClassVar, Generic, List, Optional, Set, TypeVar, Union, Mapping
++from collections.abc import Generator
++from typing import Any, Dict
++
++class BlockState:
++    src: str
++    tokens: List[Any]
++    cursor: int
++    cursor_max: int
++    list_tight: bool
++    parent: Any
++    env: Mapping[str, Any]
++    def __init__(self, parent: Optional[Any] = None) -> None: ...
++    def child_state(self, src: str) -> BlockState: ...
++    def process(self, src: str) -> None: ...
++    def get_text(self, end_pos: int) -> str: ...
++    def last_token(self) -> Any: ...
++    def prepend_token(self, token: Dict[str, Any]) -> None: ...
++    def append_token(self, token: Dict[str, Any]) -> None: ...
++    def add_paragraph(self, text: str) -> None: ...
++    def append_paragraph(self) -> None: ...
++    def depth(self) -> int: ...
++
++class BaseRenderer:
++    NAME: ClassVar[str] = "base"
++    def __init__(self) -> None: ...
+--- /dev/null
++++ python-schema-salad/mypy-stubs/mistune/renderers/html.pyi
+@@ -0,0 +1,29 @@
++from ..core import BaseRenderer as BaseRenderer
++from typing import Any, Callable, ClassVar, Generic, List, Optional, Set, TypeVar, Union, Literal
++
++class HTMLRenderer(BaseRenderer):
++    NAME: ClassVar[Literal["html"]] = "html"
++    HARMFUL_PROTOCOLS: ClassVar[Set[str]]
++    GOOD_DATA_PROTOCOLS: ClassVar[Set[str]]
++    _escape: bool
++    def __init__(self, escape: bool = ..., allow_harmful_protocols: Optional[bool] = ...) -> None: ...
++    def text(self, text: str) -> str: ...
++    def emphasis(self, text: str) -> str: ...
++    def strong(self, text: str) -> str: ...
++    def link(self, text: str, url: str, title: Optional[str] = ...) -> str: ...
++    def image(self, text: str, url: str, title: Optional[str] = ...) -> str: ...
++    def codespan(self, text: str) -> str: ...
++    def linebreak(self) -> str: ...
++    def softbreak(self) -> str: ...
++    def inline_html(self, html: str) -> str: ...
++    def paragraph(self, text: str) -> str: ...
++    def heading(self, text: str, level: int, **attrs: Any) -> str: ...
++    def blank_line(self) -> str: ...
++    def thematic_break(self) -> str: ...
++    def block_text(self, text: str) -> str: ...
++    def block_code(self, code: str, info: Optional[str] = ...) -> str: ...
++    def block_quote(self, text: str) -> str: ...
++    def block_html(self, html: str) -> str: ...
++    def block_error(self, text: str) -> str: ...
++    def list(self, text: str, ordered: bool, **attrs: Any) -> str: ...
++    def list_item(self, text: str) -> str: ...
+--- /dev/null
++++ python-schema-salad/mypy-stubs/mistune/renderers/__init__.pyi
+@@ -0,0 +1,2 @@
++
++
+--- python-schema-salad.orig/schema_salad/tests/test_makedoc.py
++++ python-schema-salad/schema_salad/tests/test_makedoc.py
+@@ -239,5 +239,5 @@
+     with open(result, "w") as h:
+         h.write(metaschema_doc)
+     assert (
+-        hasher.hexdigest() == "92730b4fd87186421b7e5f656f15280461beeb8d7bb853e405ae85238bb12580"
++        hasher.hexdigest() == "3218d5a66d13025a874c0c05e0ad9af26d6131a4e27c019589b4aa18aee3c73d"
+     ), result


=====================================
debian/patches/rework_all
=====================================
@@ -7,11 +7,9 @@ Forwarded: not-needed
  schema_salad/tests/test_print_oneline.py | 7 +++----
  1 file changed, 3 insertions(+), 4 deletions(-)
 
-diff --git a/schema_salad/tests/test_print_oneline.py b/schema_salad/tests/test_print_oneline.py
-index 18ed547..47fa401 100644
---- a/schema_salad/tests/test_print_oneline.py
-+++ b/schema_salad/tests/test_print_oneline.py
-@@ -174,10 +174,9 @@ def test_for_invalid_yaml2() -> None:
+--- python-schema-salad.orig/schema_salad/tests/test_print_oneline.py
++++ python-schema-salad/schema_salad/tests/test_print_oneline.py
+@@ -174,10 +174,9 @@
              )
          except ValidationException as e:
              msg = str(e)


=====================================
debian/patches/series
=====================================
@@ -1,3 +1,4 @@
+mistune3.patch
 rework_all
 better_is_fs_case_sensitive
 typescript_license


=====================================
debian/patches/typescript_license
=====================================
@@ -7,11 +7,9 @@ During Debian packaging the extra LICENSE file gets deleted
  schema_salad/typescript_codegen.py | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
-diff --git a/schema_salad/typescript_codegen.py b/schema_salad/typescript_codegen.py
-index 9f6d19b..7986ac3 100644
---- a/schema_salad/typescript_codegen.py
-+++ b/schema_salad/typescript_codegen.py
-@@ -745,7 +745,7 @@ export enum {enum_name} {{
+--- python-schema-salad.orig/schema_salad/typescript_codegen.py
++++ python-schema-salad/schema_salad/typescript_codegen.py
+@@ -794,7 +794,7 @@
  
          expand_resource_template_to("package.json", self.target_dir / "package.json")
          expand_resource_template_to(".gitignore", self.target_dir / ".gitignore")



View it on GitLab: https://salsa.debian.org/python-team/packages/python-schema-salad/-/compare/ac3d3a6d1eb1347932fe09374ce405d94a820b0e...ec7c0d176131ea007fcb1085f5205aae323e9686

-- 
View it on GitLab: https://salsa.debian.org/python-team/packages/python-schema-salad/-/compare/ac3d3a6d1eb1347932fe09374ce405d94a820b0e...ec7c0d176131ea007fcb1085f5205aae323e9686
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20240103/27fbe81f/attachment-0001.htm>


More information about the debian-med-commit mailing list