17
0

6 Commits

Author SHA256 Message Date
02fc1de243 Accepting request 1320257 from devel:languages:python
- Add patch pytest9.patch:
  * Balanced on top of the other 2 pytest patches, support pytest 9 changes.
- Use autosetup macro.

OBS-URL: https://build.opensuse.org/request/show/1320257
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-html5lib?expand=0&rev=29
2025-12-02 12:18:21 +00:00
00ed064bb2 - Add patch pytest9.patch:
* Balanced on top of the other 2 pytest patches, support pytest 9 changes.
- Use autosetup macro.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html5lib?expand=0&rev=61
2025-11-26 23:48:53 +00:00
8776a4eb4e Accepting request 1315393 from devel:languages:python
- Add patch support-python314.patch:
  * Don't use ast.Str to parse the version if it isn't available.

OBS-URL: https://build.opensuse.org/request/show/1315393
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-html5lib?expand=0&rev=28
2025-11-05 15:17:50 +00:00
24e2ba5196 - Add patch support-python314.patch:
* Don't use ast.Str to parse the version if it isn't available.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html5lib?expand=0&rev=59
2025-11-04 00:18:59 +00:00
efe461f0d2 Accepting request 1280836 from devel:languages:python
- Convert to pip-based build

OBS-URL: https://build.opensuse.org/request/show/1280836
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/python-html5lib?expand=0&rev=27
2025-05-30 12:21:38 +00:00
65a699e34b - Convert to pip-based build
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-html5lib?expand=0&rev=57
2025-05-28 11:27:24 +00:00
4 changed files with 130 additions and 8 deletions

61
pytest9.patch Normal file
View File

@@ -0,0 +1,61 @@
From b502a5e2b3048a996ada4c4246aafad99d3dd14c Mon Sep 17 00:00:00 2001
From: Steve Kowalik <steven@wedontsleep.org>
Date: Thu, 27 Nov 2025 10:44:40 +1100
Subject: [PATCH] Support pytest 9 changes
The old py.path arguments to the hook functions have been removed as of
pytest 9, switch to the shiny new pathlib ones.
---
html5lib/tests/conftest.py | 18 +++++++++---------
requirements-test.txt | 2 +-
2 files changed, 10 insertions(+), 10 deletions(-)
Index: html5lib-1.1/html5lib/tests/conftest.py
===================================================================
--- html5lib-1.1.orig/html5lib/tests/conftest.py
+++ html5lib-1.1/html5lib/tests/conftest.py
@@ -90,22 +90,22 @@ def pytest_configure(config):
pytest.exit("\n".join(msgs))
-def pytest_collect_file(path, parent):
- dir = os.path.abspath(path.dirname)
+def pytest_collect_file(file_path, parent):
+ dir = file_path.parent
dir_and_parents = set()
while dir not in dir_and_parents:
dir_and_parents.add(dir)
- dir = os.path.dirname(dir)
+ dir = dir.parent
if _tree_construction in dir_and_parents:
- if path.ext == ".dat":
- return TreeConstructionFile.from_parent(parent, fspath=path)
+ if file_path.suffix == ".dat":
+ return TreeConstructionFile.from_parent(parent, path=file_path)
elif _tokenizer in dir_and_parents:
- if path.ext == ".test":
- return TokenizerFile.from_parent(parent, fspath=path)
+ if file_path.suffix == ".test":
+ return TokenizerFile.from_parent(parent, path=file_path)
elif _sanitizer_testdata in dir_and_parents:
- if path.ext == ".dat":
- return SanitizerFile.from_parent(parent, fspath=path)
+ if file_path.suffix == ".dat":
+ return SanitizerFile.from_parent(parent, path=file_path)
# Tiny wrapper to allow .from_parent constructors on older pytest for PY27
Index: html5lib-1.1/requirements-test.txt
===================================================================
--- html5lib-1.1.orig/requirements-test.txt
+++ html5lib-1.1/requirements-test.txt
@@ -3,7 +3,7 @@
tox>=3.15.1,<4
flake8>=3.8.1,<3.9
pytest>=4.6.10,<5 ; python_version < '3'
-pytest>=5.4.2,<7 ; python_version >= '3'
+pytest>=7,<10 ; python_version >= '3'
coverage>=5.1,<6
pytest-expect>=1.1.0,<2
mock>=3.0.5,<4 ; python_version < '3.6'

View File

@@ -1,3 +1,21 @@
-------------------------------------------------------------------
Wed Nov 26 23:48:39 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch pytest9.patch:
* Balanced on top of the other 2 pytest patches, support pytest 9 changes.
- Use autosetup macro.
-------------------------------------------------------------------
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>

View File

@@ -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,20 @@ 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
# PATCH-FIX-UPSTREAM Based on gh#html5lib/html5lib-python#590
Patch4: pytest9.patch
BuildRequires: %{python_module Genshi}
BuildRequires: %{python_module lxml}
BuildRequires: %{python_module pytest >= 4.0}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pytest >= 7}
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
@@ -58,14 +64,13 @@ DOM, ElementTree, lxml and BeautifulSoup tree formats as well as a
simple custom format
%prep
%setup -q -n html5lib-%{version}
%autopatch -p1
%autosetup -p1 -n html5lib-%{version}
%build
%python_build
%pyproject_wheel
%install
%python_install
%pyproject_install
%python_expand %fdupes %{buildroot}%{$python_sitelib}
%check
@@ -75,6 +80,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}.dist-info
%changelog

38
support-python314.patch Normal file
View 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,