From 71afc181e1df50020d6ab459fae741a431fb01f1 Mon Sep 17 00:00:00 2001 From: donBarbos Date: Thu, 27 Mar 2025 20:31:19 +0400 Subject: [PATCH] Complete stubs for `commonmark` --- pyrightconfig.stricter.json | 1 - stubs/commonmark/@tests/stubtest_allowlist.txt | 2 ++ stubs/commonmark/METADATA.toml | 4 ---- stubs/commonmark/commonmark/entitytrans.pyi | 2 ++ stubs/commonmark/commonmark/inlines.pyi | 4 ++-- stubs/commonmark/commonmark/normalize_reference.pyi | 2 ++ 6 files changed, 8 insertions(+), 7 deletions(-) create mode 100644 stubs/commonmark/@tests/stubtest_allowlist.txt diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index a0e8bddda967..acb00ae85677 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -34,7 +34,6 @@ "stubs/cffi", "stubs/click-default-group", "stubs/click-web", - "stubs/commonmark", "stubs/corus", "stubs/dateparser", "stubs/defusedxml", diff --git a/stubs/commonmark/@tests/stubtest_allowlist.txt b/stubs/commonmark/@tests/stubtest_allowlist.txt new file mode 100644 index 000000000000..cc9f553f2f7e --- /dev/null +++ b/stubs/commonmark/@tests/stubtest_allowlist.txt @@ -0,0 +1,2 @@ +# Testing modules are not included in type stubs +commonmark.tests.* diff --git a/stubs/commonmark/METADATA.toml b/stubs/commonmark/METADATA.toml index e085ecf4529b..aa3a1922c3a1 100644 --- a/stubs/commonmark/METADATA.toml +++ b/stubs/commonmark/METADATA.toml @@ -1,6 +1,2 @@ version = "0.9.*" upstream_repository = "https://github.com/rtfd/commonmark.py" -partial_stub = true - -[tool.stubtest] -ignore_missing_stub = true diff --git a/stubs/commonmark/commonmark/entitytrans.pyi b/stubs/commonmark/commonmark/entitytrans.pyi index b8b0efae5fc8..da7067b2e8cc 100644 --- a/stubs/commonmark/commonmark/entitytrans.pyi +++ b/stubs/commonmark/commonmark/entitytrans.pyi @@ -1 +1,3 @@ def _unescape(s: str) -> str: ... + +__all__ = ["_unescape"] diff --git a/stubs/commonmark/commonmark/inlines.pyi b/stubs/commonmark/commonmark/inlines.pyi index 5202a01bdc97..ace221d82903 100644 --- a/stubs/commonmark/commonmark/inlines.pyi +++ b/stubs/commonmark/commonmark/inlines.pyi @@ -50,14 +50,14 @@ class InlineParser: def removeDelimiter(self, delim: dict[str, Any]) -> None: ... @staticmethod def removeDelimitersBetween(bottom: dict[str, Any], top: dict[str, Any]) -> None: ... - def processEmphasis(self, stack_bottom) -> None: ... + def processEmphasis(self, stack_bottom: dict[str, Any]) -> None: ... def parseLinkTitle(self) -> str | None: ... def parseLinkDestination(self) -> str | None: ... def parseLinkLabel(self) -> int: ... def parseOpenBracket(self, block: Node) -> Literal[True]: ... def parseBang(self, block: Node) -> Literal[True]: ... def parseCloseBracket(self, block: Node) -> Literal[True]: ... - def addBracket(self, node, index, image) -> None: ... + def addBracket(self, node: Node, index: int, image: bool | None) -> None: ... def removeBracket(self) -> None: ... def parseEntity(self, block: Node) -> bool: ... def parseString(self, block: Node) -> bool: ... diff --git a/stubs/commonmark/commonmark/normalize_reference.pyi b/stubs/commonmark/commonmark/normalize_reference.pyi index 0386213d006b..ae5fc6e0564e 100644 --- a/stubs/commonmark/commonmark/normalize_reference.pyi +++ b/stubs/commonmark/commonmark/normalize_reference.pyi @@ -1 +1,3 @@ def normalize_reference(string: str) -> str: ... + +__all__ = ["normalize_reference"]