tools/check-version-history: avoid DeprecationWarning with newer lxml (#36860)

We get the same warning thousands of times:
/work/src/tools/check-version-history.py:28: FutureWarning: This search
incorrectly ignores the root element, and will be fixed in a future
version. If you rely on the current behaviour, change it to

"./refsynopsisdiv/funcsynopsis/funcprototype/funcdef/function[.='udev_device_get_properties_list_entry']"

We also need to update the ignorelist to the new form.
This commit is contained in:
Luca Boccassi
2025-03-25 19:34:44 +00:00
committed by GitHub
3 changed files with 580 additions and 579 deletions
+1
View File
@@ -9,6 +9,7 @@
.deps/
.venv/
.mypy_cache/
.mkosi-private/
__pycache__/
/*.gcda
/*.gcno
+2 -2
View File
@@ -24,7 +24,7 @@ def find_undocumented_functions(pages, ignorelist):
hist_section = pagetree.find("refsect1[title='History']")
for func in pagetree.findall("//funcprototype/funcdef/function"):
path = f"/refsynopsisdiv/funcsynopsis/funcprototype/funcdef/function[.='{func.text}']"
path = f"./refsynopsisdiv/funcsynopsis/funcprototype/funcdef/function[.='{func.text}']"
assert pagetree.findall(path) == [func]
if (
@@ -40,7 +40,7 @@ def construct_path(element):
tag = element.tag
if tag == "refentry":
return ""
return "."
predicate = ""
if tag == "varlistentry":
+577 -577
View File
File diff suppressed because it is too large Load Diff