From 3b94e712803ad6f689364fd5abe448bb6e4a1a54 Mon Sep 17 00:00:00 2001 From: Avasam Date: Thu, 5 Jan 2023 05:40:17 -0500 Subject: [PATCH] Add `types-html5lib` as a dependency of `types-beautifulsoup4` (#9462) Remove the need for subclassing `Any` --- stubs/beautifulsoup4/METADATA.toml | 1 + stubs/beautifulsoup4/bs4/builder/_html5lib.pyi | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/stubs/beautifulsoup4/METADATA.toml b/stubs/beautifulsoup4/METADATA.toml index 5c2d0f17b..7b261bc19 100644 --- a/stubs/beautifulsoup4/METADATA.toml +++ b/stubs/beautifulsoup4/METADATA.toml @@ -1,4 +1,5 @@ version = "4.11.*" +requires = ["types-html5lib"] [tool.stubtest] extras = ["lxml", "html5lib"] diff --git a/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi b/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi index 3f46c4ed5..1ee1b0e17 100644 --- a/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi +++ b/stubs/beautifulsoup4/bs4/builder/_html5lib.pyi @@ -1,6 +1,7 @@ from typing import Any from bs4.builder import HTMLTreeBuilder +from html5lib.treebuilders import base as treebuilder_base class HTML5TreeBuilder(HTMLTreeBuilder): NAME: str @@ -15,7 +16,7 @@ class HTML5TreeBuilder(HTMLTreeBuilder): def create_treebuilder(self, namespaceHTMLElements): ... def test_fragment_to_document(self, fragment): ... -class TreeBuilderForHtml5lib(Any): # html5lib.treebuilders.base.TreeBuilder +class TreeBuilderForHtml5lib(treebuilder_base.TreeBuilder): soup: Any parser: Any store_line_numbers: Any @@ -42,7 +43,7 @@ class AttrList: def __getitem__(self, name): ... def __contains__(self, name): ... -class Element(Any): # html5lib.treebuilders.base.Node +class Element(treebuilder_base.Node): element: Any soup: Any namespace: Any