diff options
| author | Khem Raj <raj.khem@gmail.com> | 2026-01-19 20:46:08 -0800 |
|---|---|---|
| committer | Khem Raj <raj.khem@gmail.com> | 2026-01-20 08:27:13 -0800 |
| commit | 4350c0494943e0ed1a88fd257eed3ddd357523b1 (patch) | |
| tree | 78057bb559193fe70647482a6a6a0ab89031081c /meta-python | |
| parent | 498b49d2a42fa96e84db647318b335cb16153c1d (diff) | |
| download | meta-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-.patch | 41 | ||||
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-html5lib_1.1.bb | 1 |
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 @@ | |||
| 1 | From 39db97412da6b9f4918ae1350ae9561be9af48ea Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Andrew Sukach <andrew@sukach.org> | ||
| 3 | Date: Fri, 12 Sep 2025 21:53:31 -0700 | ||
| 4 | Subject: [PATCH] `setup.py`: fix version parsing on Python 3.14 (ast.Str | ||
| 5 | removed) | ||
| 6 | |||
| 7 | Python 3.14 removes the ast.Str node type. String literals now appear | ||
| 8 | as ast.Constant(value=str). | ||
| 9 | Update the AST check to accept both ast.Str (for older Pythons) and | ||
| 10 | ast.Constant with a string value (for Python 3.8+), allowing html5lib to | ||
| 11 | build successfully on Python 3.14 while remaining compatible with older | ||
| 12 | version. | ||
| 13 | |||
| 14 | Upstream-Status: Submitted [https://github.com/html5lib/html5lib-python/pull/589] | ||
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 16 | --- | ||
| 17 | setup.py | 11 ++++++++--- | ||
| 18 | 1 file changed, 8 insertions(+), 3 deletions(-) | ||
| 19 | |||
| 20 | diff --git a/setup.py b/setup.py | ||
| 21 | index 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" | |||
| 2 | LICENSE = "MIT" | 2 | LICENSE = "MIT" |
| 3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c" | 3 | LIC_FILES_CHKSUM = "file://LICENSE;md5=1ba5ada9e6fead1fdc32f43c9f10ba7c" |
| 4 | 4 | ||
| 5 | SRC_URI += "file://0001-setup.py-fix-version-parsing-on-Python-3.14-ast.Str-.patch" | ||
| 5 | SRC_URI[sha256sum] = "b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f" | 6 | SRC_URI[sha256sum] = "b2e5b40261e20f354d198eae92afc10d750afb487ed5e50f9c4eaf07c184146f" |
| 6 | 7 | ||
| 7 | inherit pypi setuptools3 | 8 | inherit pypi setuptools3 |
