Rebuild with python 3.14
This commit is contained in:
@@ -1,13 +1,14 @@
|
|||||||
name: python-html5lib
|
name: python-html5lib
|
||||||
description: A Python HTML parser/tokenizer based on the WHATWG HTML5 spec
|
description: A Python HTML parser/tokenizer based on the WHATWG HTML5 spec
|
||||||
version: "1.1"
|
version: "1.1"
|
||||||
revision: 1
|
revision: 2
|
||||||
url: https://github.com/html5lib/html5lib-python
|
url: https://github.com/html5lib/html5lib-python
|
||||||
license: MIT
|
license: MIT
|
||||||
architecture: any
|
architecture: any
|
||||||
output_architecture: any
|
output_architecture: any
|
||||||
type: source
|
type: source
|
||||||
depends:
|
depends:
|
||||||
|
- python3=3.14.*
|
||||||
- python-six
|
- python-six
|
||||||
- python-webencodings
|
- python-webencodings
|
||||||
optional_depends:
|
optional_depends:
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
From b90dafff1bf342d34d539098013d0b9f318c7641 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andrew Sukach <[email protected]>
|
||||||
|
Date: Fri, 12 Sep 2025 21:53:31 -0700
|
||||||
|
Subject: [PATCH] `setup.py`: fix version parsing on Python 3.14 (ast.Str
|
||||||
|
removed)
|
||||||
|
|
||||||
|
Python 3.14 removes the ast.Str node type. String literals now appear
|
||||||
|
as ast.Constant(value=str).
|
||||||
|
Update the AST check to accept both ast.Str (for older Pythons) and
|
||||||
|
ast.Constant with a string value (for Python 3.8+), allowing html5lib to
|
||||||
|
build successfully on Python 3.14 while remaining compatible with older
|
||||||
|
version.
|
||||||
|
---
|
||||||
|
setup.py | 11 ++++++++---
|
||||||
|
1 file changed, 8 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index 30ee0575..42ab6f67 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -92,9 +92,14 @@ def default_environment():
|
||||||
|
for a in assignments:
|
||||||
|
if (len(a.targets) == 1 and
|
||||||
|
isinstance(a.targets[0], ast.Name) and
|
||||||
|
- a.targets[0].id == "__version__" and
|
||||||
|
- isinstance(a.value, ast.Str)):
|
||||||
|
- version = a.value.s
|
||||||
|
+ a.targets[0].id == "__version__"):
|
||||||
|
+ if hasattr(ast, "Str") and isinstance(a.value, ast.Str):
|
||||||
|
+ version = a.value.s
|
||||||
|
+ elif (hasattr(ast, "Constant")
|
||||||
|
+ and isinstance(a.value, ast.Constant)
|
||||||
|
+ and isinstance(a.value.value, str)):
|
||||||
|
+ version = a.value.value
|
||||||
|
+assert version is not None
|
||||||
|
|
||||||
|
setup(name='html5lib',
|
||||||
|
version=version,
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
From 1dbc19cd6db72cb919885827bc4883423e0cb647 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Rui Chen <[email protected]>
|
||||||
|
Date: Mon, 9 Feb 2026 18:36:08 -0500
|
||||||
|
Subject: [PATCH] setup.py: handle missing pkg_resources import
|
||||||
|
|
||||||
|
Signed-off-by: Rui Chen <[email protected]>
|
||||||
|
---
|
||||||
|
setup.py | 9 ++++++---
|
||||||
|
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/setup.py b/setup.py
|
||||||
|
index 30ee0575..768c314f 100644
|
||||||
|
--- a/setup.py
|
||||||
|
+++ b/setup.py
|
||||||
|
@@ -6,9 +6,12 @@
|
||||||
|
|
||||||
|
from os.path import join, dirname
|
||||||
|
from setuptools import setup, find_packages, __version__ as setuptools_version
|
||||||
|
-from pkg_resources import parse_version
|
||||||
|
-
|
||||||
|
-import pkg_resources
|
||||||
|
+try:
|
||||||
|
+ from pkg_resources import parse_version
|
||||||
|
+ import pkg_resources
|
||||||
|
+except ModuleNotFoundError:
|
||||||
|
+ from setuptools._vendor.packaging.version import parse as parse_version
|
||||||
|
+ pkg_resources = None
|
||||||
|
|
||||||
|
try:
|
||||||
|
import _markerlib.markers
|
||||||
@@ -2,6 +2,15 @@
|
|||||||
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
|
# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE
|
||||||
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
|
# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT
|
||||||
|
|
||||||
|
# The prepare function is executed in the root of the temp directory
|
||||||
|
# This function is used for putting downloaded files to the correct location or applying patches
|
||||||
|
prepare() {
|
||||||
|
cd "$BPM_SOURCE"
|
||||||
|
# Fix building with Python 3.14
|
||||||
|
patch -Np1 -i "$BPM_WORKDIR"/handle-missing-pkg_resources-import.patch
|
||||||
|
patch -Np1 -i "$BPM_WORKDIR"/fix-version-parsing.patch
|
||||||
|
}
|
||||||
|
|
||||||
# The build function is executed in the source directory
|
# The build function is executed in the source directory
|
||||||
# This function is used to compile the source code
|
# This function is used to compile the source code
|
||||||
build() {
|
build() {
|
||||||
|
|||||||
Reference in New Issue
Block a user