From 20d0b5ce6e4c9d1886f7f3bb657f372b88ab9a6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=98=D0=B2=D1=87=D0=B5=D0=BD=D0=BA=D0=BE=D0=B2?= Date: Sun, 9 Nov 2025 02:27:49 +0300 Subject: [PATCH 1/2] Added several missing annotations to serializer.pyi --- stubs/html5lib/METADATA.toml | 2 ++ stubs/html5lib/html5lib/serializer.pyi | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/stubs/html5lib/METADATA.toml b/stubs/html5lib/METADATA.toml index 23a4684130a6..6e34b51f685f 100644 --- a/stubs/html5lib/METADATA.toml +++ b/stubs/html5lib/METADATA.toml @@ -1,5 +1,7 @@ version = "1.1.*" upstream_repository = "https://github.com/html5lib/html5lib-python" +requires = ["six"] + [tool.stubtest] extras = ["all"] diff --git a/stubs/html5lib/html5lib/serializer.pyi b/stubs/html5lib/html5lib/serializer.pyi index e7232e2e1d11..e667b7a12f53 100644 --- a/stubs/html5lib/html5lib/serializer.pyi +++ b/stubs/html5lib/html5lib/serializer.pyi @@ -1,6 +1,8 @@ from _typeshed import Incomplete from collections.abc import Generator from typing import overload +from six import text_type + k: str v: str | int @@ -32,11 +34,11 @@ class HTMLSerializer: errors: Incomplete strict: bool def __init__(self, **kwargs) -> None: ... - def encode(self, string): ... - def encodeStrict(self, string): ... + def encode(self, string: text_type) -> str: ... + def encodeStrict(self, string: text_type) -> str: ... encoding: Incomplete - def serialize(self, treewalker, encoding=None) -> Generator[Incomplete]: ... - def render(self, treewalker, encoding=None): ... + def serialize(self, treewalker: str, encoding: str) -> str: ... + def render(self, treewalker: str, encoding: str) -> str: ... def serializeError(self, data: str = "XXX ERROR MESSAGE NEEDED") -> None: ... class SerializeError(Exception): ... From b61909702f6e2f095ac7bc635501eca5cd04ec4d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 8 Nov 2025 23:43:04 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/html5lib/html5lib/serializer.pyi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stubs/html5lib/html5lib/serializer.pyi b/stubs/html5lib/html5lib/serializer.pyi index e667b7a12f53..834e2c21a376 100644 --- a/stubs/html5lib/html5lib/serializer.pyi +++ b/stubs/html5lib/html5lib/serializer.pyi @@ -1,8 +1,7 @@ from _typeshed import Incomplete -from collections.abc import Generator from typing import overload -from six import text_type +from six import text_type k: str v: str | int