Bump lxml-stubs from 0.4.0 to 0.5.1 (#16885)

This commit is contained in:
dependabot[bot] 2024-02-06 09:29:17 +00:00 committed by GitHub
parent 71e8634069
commit 871f51c270
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 9 deletions

8
poetry.lock generated
View File

@ -1212,17 +1212,17 @@ source = ["Cython (>=3.0.7)"]
[[package]] [[package]]
name = "lxml-stubs" name = "lxml-stubs"
version = "0.4.0" version = "0.5.1"
description = "Type annotations for the lxml package" description = "Type annotations for the lxml package"
optional = false optional = false
python-versions = "*" python-versions = "*"
files = [ files = [
{file = "lxml-stubs-0.4.0.tar.gz", hash = "sha256:184877b42127256abc2b932ba8bd0ab5ea80bd0b0fee618d16daa40e0b71abee"}, {file = "lxml-stubs-0.5.1.tar.gz", hash = "sha256:e0ec2aa1ce92d91278b719091ce4515c12adc1d564359dfaf81efa7d4feab79d"},
{file = "lxml_stubs-0.4.0-py3-none-any.whl", hash = "sha256:3b381e9e82397c64ea3cc4d6f79d1255d015f7b114806d4826218805c10ec003"}, {file = "lxml_stubs-0.5.1-py3-none-any.whl", hash = "sha256:1f689e5dbc4b9247cb09ae820c7d34daeb1fdbd1db06123814b856dae7787272"},
] ]
[package.extras] [package.extras]
test = ["coverage[toml] (==5.2)", "pytest (>=6.0.0)", "pytest-mypy-plugins (==1.9.3)"] test = ["coverage[toml] (>=7.2.5)", "mypy (>=1.2.0)", "pytest (>=7.3.0)", "pytest-mypy-plugins (>=1.10.1)"]
[[package]] [[package]]
name = "markdown-it-py" name = "markdown-it-py"

View File

@ -256,12 +256,11 @@ def calc_description_and_urls(open_graph_response: JsonDict, html_body: str) ->
parser = etree.HTMLParser(recover=True, encoding="utf-8") parser = etree.HTMLParser(recover=True, encoding="utf-8")
# Attempt to parse the body. If this fails, log and return no metadata. # Attempt to parse the body. If this fails, log and return no metadata.
# TODO Develop of lxml-stubs has this correct. tree = etree.fromstring(html_body, parser)
tree = etree.fromstring(html_body, parser) # type: ignore[arg-type]
# The data was successfully parsed, but no tree was found. # The data was successfully parsed, but no tree was found.
if tree is None: if tree is None:
return # type: ignore[unreachable] return
# Attempt to find interesting URLs (images, videos, embeds). # Attempt to find interesting URLs (images, videos, embeds).
if "og:image" not in open_graph_response: if "og:image" not in open_graph_response:

View File

@ -160,8 +160,7 @@ def decode_body(
# Attempt to parse the body. Returns None if the body was successfully # Attempt to parse the body. Returns None if the body was successfully
# parsed, but no tree was found. # parsed, but no tree was found.
# TODO Develop of lxml-stubs has this correct. return etree.fromstring(body, parser)
return etree.fromstring(body, parser) # type: ignore[arg-type]
def _get_meta_tags( def _get_meta_tags(