forked from pool/python-html5lib
Compare commits
4 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 8776a4eb4e | |||
| 24e2ba5196 | |||
| efe461f0d2 | |||
| 65a699e34b |
@@ -1,3 +1,14 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue Nov 4 00:18:04 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
|
||||
|
||||
- Add patch support-python314.patch:
|
||||
* Don't use ast.Str to parse the version if it isn't available.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Wed May 28 11:27:09 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
- Convert to pip-based build
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu Jul 27 07:50:37 UTC 2023 - Markéta Machová <mmachova@suse.com>
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package python-html5lib
|
||||
#
|
||||
# Copyright (c) 2023 SUSE LLC
|
||||
# Copyright (c) 2025 SUSE LLC and contributors
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@@ -16,7 +16,6 @@
|
||||
#
|
||||
|
||||
|
||||
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
|
||||
%{?sle15_python_module_pythons}
|
||||
Name: python-html5lib
|
||||
Version: 1.1
|
||||
@@ -31,13 +30,18 @@ Patch0: pytest6.patch
|
||||
Patch1: python-html5lib-no-mock.patch
|
||||
# PATCH-FIX-UPSTREAM https://github.com/html5lib/html5lib-python/pull/570 adapt testsuite to changes in pytest 7.4
|
||||
Patch2: pytest74.patch
|
||||
# PATCH-FIX-UPSTREAM gh#html5lib/html5lib-python#589
|
||||
Patch3: support-python314.patch
|
||||
BuildRequires: %{python_module Genshi}
|
||||
BuildRequires: %{python_module lxml}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pip}
|
||||
BuildRequires: %{python_module pytest >= 4.0}
|
||||
BuildRequires: %{python_module pytest-expect}
|
||||
BuildRequires: %{python_module setuptools >= 18.5}
|
||||
BuildRequires: %{python_module six >= 1.9}
|
||||
BuildRequires: %{python_module webencodings}
|
||||
BuildRequires: %{python_module wheel}
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: python-rpm-macros
|
||||
Requires: python-six >= 1.9
|
||||
@@ -62,10 +66,10 @@ simple custom format
|
||||
%autopatch -p1
|
||||
|
||||
%build
|
||||
%python_build
|
||||
%pyproject_wheel
|
||||
|
||||
%install
|
||||
%python_install
|
||||
%pyproject_install
|
||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||
|
||||
%check
|
||||
@@ -75,6 +79,6 @@ simple custom format
|
||||
%license LICENSE
|
||||
%doc CHANGES.rst README.rst
|
||||
%{python_sitelib}/html5lib/
|
||||
%{python_sitelib}/html5lib-%{version}-py%{python_version}.egg-info
|
||||
%{python_sitelib}/html5lib-%{version}*-info
|
||||
|
||||
%changelog
|
||||
|
||||
38
support-python314.patch
Normal file
38
support-python314.patch
Normal file
@@ -0,0 +1,38 @@
|
||||
From b90dafff1bf342d34d539098013d0b9f318c7641 Mon Sep 17 00:00:00 2001
|
||||
From: Andrew Sukach <andrew@sukach.org>
|
||||
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,
|
||||
Reference in New Issue
Block a user