summaryrefslogtreecommitdiffstats
path: root/meta-python
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2026-01-19 20:46:08 -0800
committerKhem Raj <raj.khem@gmail.com>2026-01-20 08:27:13 -0800
commit4350c0494943e0ed1a88fd257eed3ddd357523b1 (patch)
tree78057bb559193fe70647482a6a6a0ab89031081c /meta-python
parent498b49d2a42fa96e84db647318b335cb16153c1d (diff)
downloadmeta-openembedded-4350c0494943e0ed1a88fd257eed3ddd357523b1.tar.gz
python3-html5lib: Fix build with python 3.14
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-python')
-rw-r--r--meta-python/recipes-devtools/python/python3-html5lib/0001-setup.py-fix-version-parsing-on-Python-3.14-ast.Str-.patch41
-rw-r--r--meta-python/recipes-devtools/python/python3-html5lib_1.1.bb1
2 files changed, 42 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-html5lib/0001-setup.py-fix-version-parsing-on-Python-3.14-ast.Str-.patch b/meta-python/recipes-devtools/python/python3-html5lib/0001-setup.py-fix-version-parsing-on-Python-3.14-ast.Str-.patch
new file mode 100644
index 0000000000..4d3c8eec91
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-html5lib/0001-setup.py-fix-version-parsing-on-Python-3.14-ast.Str-.patch
@@ -0,0 +1,41 @@
1From 39db97412da6b9f4918ae1350ae9561be9af48ea Mon Sep 17 00:00:00 2001
2From: Andrew Sukach <andrew@sukach.org>
3Date: Fri, 12 Sep 2025 21:53:31 -0700
4Subject: [PATCH] `setup.py`: fix version parsing on Python 3.14 (ast.Str
5 removed)
6
7Python 3.14 removes the ast.Str node type. String literals now appear
8as ast.Constant(value=str).
9Update the AST check to accept both ast.Str (for older Pythons) and
10ast.Constant with a string value (for Python 3.8+), allowing html5lib to
11build successfully on Python 3.14 while remaining compatible with older
12version.
13
14Upstream-Status: Submitted [https://github.com/html5lib/html5lib-python/pull/589]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 setup.py | 11 ++++++++---
18 1 file changed, 8 insertions(+), 3 deletions(-)
19
20diff --git a/setup.py b/setup.py
21index f84c128..c393c9c 100644
22--- a/setup.py
23+++ b/setup.py
24@@ -89,9 +89,14 @@ with open(join(here, "html5lib", "__init__.py"), "rb") as init_file:
25 for a in assignments:
26 if (len(a.targets) == 1 and
27 isinstance(a.targets[0], ast.Name) and
28- a.targets[0].id == "__version__" and
29- isinstance(a.value, ast.Str)):
30- version = a.value.s
31+ a.targets[0].id == "__version__"):
32+ if hasattr(ast, "Str") and isinstance(a.value, ast.Str):
33+ version = a.value.s
34+ elif (hasattr(ast, "Constant")
35+ and isinstance(a.value, ast.Constant)
36+ and isinstance(a.value.value, str)):
37+ version = a.value.value
38+assert version is not None
39
40 setup(name='html5lib',
41 version=version,
diff --git a/meta-python/recipes-devtools/python/python3-html5lib_1.1.bb b/meta-python/recipes-devtools/python/python3-html5lib_1.1.bb
index 8b32580d4a..3d7e44b87e 100644
--- a/meta-python/recipes-devtools/python/python3-html5lib_1.1.bb
+++ b/meta-python/recipes-devtools/python/python3-html5lib_1.1.bb
@@ -2,6 +2,7 @@ SUMMARY = "HTML parser based on the WHATWG HTML specifcation"
2LICENSE = "MIT" 2LICENSE = "MIT"
3LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c" 3LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c"
4 4
5SRC_URI += "file://0001-setup.py-fix-version-parsing-on-Python-3.14-ast.Str-.patch"
5SRC_URI[sha256sum] = "b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f" 6SRC_URI[sha256sum] = "b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f"
6 7
7inherit pypi setuptools3 8inherit pypi setuptools3