Skip to content

Commit 60bdecd

Browse files
AvasamJuan Amari
authored and
Juan Amari
committed
Add types-html5lib as a dependency of types-beautifulsoup4 (python#9462)
Remove the need for subclassing `Any`
1 parent a32534c commit 60bdecd

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

stubs/beautifulsoup4/METADATA.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
version = "4.11.*"
2+
requires = ["types-html5lib"]
23

34
[tool.stubtest]
45
extras = ["lxml", "html5lib"]

stubs/beautifulsoup4/bs4/builder/_html5lib.pyi

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from typing import Any
22

33
from bs4.builder import HTMLTreeBuilder
4+
from html5lib.treebuilders import base as treebuilder_base
45

56
class HTML5TreeBuilder(HTMLTreeBuilder):
67
NAME: str
@@ -15,7 +16,7 @@ class HTML5TreeBuilder(HTMLTreeBuilder):
1516
def create_treebuilder(self, namespaceHTMLElements): ...
1617
def test_fragment_to_document(self, fragment): ...
1718

18-
class TreeBuilderForHtml5lib(Any): # html5lib.treebuilders.base.TreeBuilder
19+
class TreeBuilderForHtml5lib(treebuilder_base.TreeBuilder):
1920
soup: Any
2021
parser: Any
2122
store_line_numbers: Any
@@ -42,7 +43,7 @@ class AttrList:
4243
def __getitem__(self, name): ...
4344
def __contains__(self, name): ...
4445

45-
class Element(Any): # html5lib.treebuilders.base.Node
46+
class Element(treebuilder_base.Node):
4647
element: Any
4748
soup: Any
4849
namespace: Any

0 commit comments

Comments
 (0)