public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/python-et_xmlfile] rawhide: Fix build with Python 3.15.0b1
@ 2026-06-03 10:05 Karolina Surma
0 siblings, 0 replies; only message in thread
From: Karolina Surma @ 2026-06-03 10:05 UTC (permalink / raw)
To: git-commits
A new commit has been pushed.
Repo : rpms/python-et_xmlfile
Branch : rawhide
Commit : 801adf395fcda83fa4aaf0c7be7de39329f941a5
Author : Karolina Surma <ksurma@redhat.com>
Date : 2026-06-01T13:09:20+02:00
Stats : +62/-8 in 2 file(s)
URL : https://src.fedoraproject.org/rpms/python-et_xmlfile/c/801adf395fcda83fa4aaf0c7be7de39329f941a5?branch=rawhide
Log:
Fix build with Python 3.15.0b1
---
diff --git a/Differentiate-assertion-based-on-Python-version.patch b/Differentiate-assertion-based-on-Python-version.patch
index e3324ac..d2dc005 100644
--- a/Differentiate-assertion-based-on-Python-version.patch
+++ b/Differentiate-assertion-based-on-Python-version.patch
@@ -1,28 +1,78 @@
-From 97f676ee84dbb58a204c279a39d7f55a2dee9685 Mon Sep 17 00:00:00 2001
+From e63e2e7b4204235f338a359bbb84028a4a40eb9c Mon Sep 17 00:00:00 2001
From: Karolina Surma <ksurma@redhat.com>
Date: Fri, 30 May 2025 10:14:08 +0200
Subject: [PATCH] Differentiate assertion based on Python version
---
- et_xmlfile/tests/_vendor/test/test_xml_etree.py | 5 ++++-
- 1 file changed, 4 insertions(+), 1 deletion(-)
+ .../tests/_vendor/test/test_xml_etree.py | 24 +++++++++++++++----
+ 1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/et_xmlfile/tests/_vendor/test/test_xml_etree.py b/et_xmlfile/tests/_vendor/test/test_xml_etree.py
-index 1d7c821..4ea26f7 100644
+index 1d7c821..4ddc85d 100644
--- a/et_xmlfile/tests/_vendor/test/test_xml_etree.py
+++ b/et_xmlfile/tests/_vendor/test/test_xml_etree.py
-@@ -329,7 +329,10 @@ class ElementTreeTest(unittest.TestCase):
+@@ -329,7 +329,12 @@ class ElementTreeTest(unittest.TestCase):
self.serialize_check(element, '<tag key="value" />') # 5
with self.assertRaises(ValueError) as cm:
element.remove(subelement)
- self.assertEqual(str(cm.exception), 'list.remove(x): x not in list')
-+ if sys.version_info >= (3, 14):
++ if sys.version_info >= (3, 15):
++ self.assertIn('not in', str(cm.exception))
++ elif sys.version_info >= (3, 14):
+ self.assertEqual(str(cm.exception), 'Element.remove(x): element not found')
+ else:
+ self.assertEqual(str(cm.exception), 'list.remove(x): x not in list')
self.serialize_check(element, '<tag key="value" />') # 6
element[0:0] = [subelement, subelement, subelement]
self.serialize_check(element[1], '<subtag />')
+@@ -649,16 +654,25 @@ class ElementTreeTest(unittest.TestCase):
+ it = iterparse(TESTFN)
+ action, elem = next(it)
+ self.assertEqual((action, elem.tag), ('end', 'document'))
+- with warnings_helper.check_no_resource_warning(self):
++ if sys.version_info >= (3, 15):
+ with self.assertRaises(ET.ParseError) as cm:
+ next(it)
+ self.assertEqual(str(cm.exception),
+ 'junk after document element: line 1, column 12')
+ del cm, it
++ else:
++ with warnings_helper.check_no_resource_warning(self):
++ with self.assertRaises(ET.ParseError) as cm:
++ next(it)
++ self.assertEqual(str(cm.exception),
++ 'junk after document element: line 1, column 12')
++ del cm, it
+
+ # Not exhausting the iterator still closes the resource (bpo-43292)
+ with warnings_helper.check_no_resource_warning(self):
+ it = iterparse(SIMPLE_XMLFILE)
++ if sys.version_info >= (3, 15):
++ it.close()
+ del it
+
+ with warnings_helper.check_no_resource_warning(self):
+@@ -670,6 +684,8 @@ class ElementTreeTest(unittest.TestCase):
+ it = iterparse(SIMPLE_XMLFILE)
+ action, elem = next(it)
+ self.assertEqual((action, elem.tag), ('end', 'element'))
++ if sys.version_info >= (3, 15):
++ it.close()
+ del it, elem
+
+ with warnings_helper.check_no_resource_warning(self):
+@@ -4093,9 +4109,9 @@ class KeywordArgsTest(unittest.TestCase):
+ e2 = ET.SubElement(elements[0], 'foobar', attrib={'key1': 'value1'})
+ self.assertEqual(e2.attrib['key1'], 'value1')
+
+- with self.assertRaisesRegex(TypeError, 'must be dict, not str'):
++ with self.assertRaisesRegex(TypeError, 'must be dict'):
+ ET.Element('a', "I'm not a dict")
+- with self.assertRaisesRegex(TypeError, 'must be dict, not str'):
++ with self.assertRaisesRegex(TypeError, 'must be dict'):
+ ET.Element('a', attrib="I'm not a dict")
+
+ # --------------------------------------------------------------------
--
-2.49.0
+2.54.0
diff --git a/python-et_xmlfile.spec b/python-et_xmlfile.spec
index 827e0e9..db93567 100644
--- a/python-et_xmlfile.spec
+++ b/python-et_xmlfile.spec
@@ -8,12 +8,13 @@ the openpyxl project but is now a standalone module.
Name: python-%{pypi_name}
Version: 2.0.0
-Release: 7%{?dist}
+Release: 8%{?dist}
Summary: %{sum}
License: MIT
URL: https://pypi.python.org/pypi/%{pypi_name}
Source0: https://foss.heptapod.net/openpyxl/et_xmlfile/-/archive/2.0.0/et_xmlfile-2.0.0.tar.gz
+# Updated for Python 3.15
Patch: Differentiate-assertion-based-on-Python-version.patch
BuildArch: noarch
@@ -62,6 +63,9 @@ Requires: %py3_dist lxml
%license LICENCE.rst
%changelog
+* Mon Jun 01 2026 Karolina Surma <ksurma@redhat.com> - 2.0.0-8
+- Fix test failures with Python 3.15
+
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 2.0.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-03 10:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-06-03 10:05 [rpms/python-et_xmlfile] rawhide: Fix build with Python 3.15.0b1 Karolina Surma
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox