14
0

Accepting request 1134191 from home:dgarcia:branches:devel:languages:python:Factory

- Fix tests with python 3.11.7
- Add patch python3117.patch (gh#candlepin/python-iniparse#29) and
  refresh patch python311-compat.patch

OBS-URL: https://build.opensuse.org/request/show/1134191
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-iniparse?expand=0&rev=39
This commit is contained in:
2023-12-20 11:44:44 +00:00
committed by Git OBS Bridge
parent c42bdce608
commit b2951cc04d
4 changed files with 42 additions and 14 deletions

View File

@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Dec 20 11:37:21 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Fix tests with python 3.11.7
- Add patch python3117.patch (gh#candlepin/python-iniparse#29) and
refresh patch python311-compat.patch
-------------------------------------------------------------------
Mon Aug 14 21:46:26 UTC 2023 - Dirk Müller <dmueller@suse.com>

View File

@@ -33,6 +33,8 @@ Patch1: python-iniparse-no-python2.patch
Patch2: python-iniparse-no-six.patch
# from https://github.com/candlepin/python-iniparse/pull/24
Patch3: python311-compat.patch
# PATCH-FIX-UPSTREAM: python3117.patch gh#candlepin/python-iniparse#29
Patch4: python3117.patch
BuildRequires: %{python_module setuptools}
BuildRequires: fdupes
BuildRequires: python-rpm-macros
@@ -55,6 +57,7 @@ are preserved when data is updated), and is more convenient to use.
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
chmod 644 html/index.html
sed -i "/.*test_multiprocessing.*/d" tests/__init__.py # NOTE(saschpe): Doesn't work and I'm lazy

View File

@@ -11,11 +11,11 @@ Subject: [PATCH] Fix compatibility issues with Python 3.11
tests/test_fuzz.py | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/tests/test_compat.py b/tests/test_compat.py
index ad36683..c8e6aca 100644
--- a/tests/test_compat.py
+++ b/tests/test_compat.py
@@ -96,16 +96,16 @@ def test_basic(self):
Index: iniparse-0.5/tests/test_compat.py
===================================================================
--- iniparse-0.5.orig/tests/test_compat.py
+++ iniparse-0.5/tests/test_compat.py
@@ -92,16 +92,16 @@ class TestCaseBase(unittest.TestCase):
eq(cf.get('Spaces', 'key with spaces'), 'value')
eq(cf.get('Spaces', 'another with spaces'), 'splat!')
@@ -36,7 +36,7 @@ index ad36683..c8e6aca 100644
"remove_option() failed to report non-existance of option"
" that was removed")
@@ -127,10 +127,10 @@ def test_case_sensitivity(self):
@@ -123,10 +123,10 @@ class TestCaseBase(unittest.TestCase):
eq(cf.options("a"), ["b"])
eq(cf.get("a", "b"), "value",
"could not locate option, expecting case-insensitive option names")
@@ -49,7 +49,7 @@ index ad36683..c8e6aca 100644
cf.has_option("A", opt),
"has_option() returned false for option which should exist")
eq(cf.options("A"), ["a-b"])
@@ -147,7 +147,7 @@ def test_case_sensitivity(self):
@@ -143,7 +143,7 @@ class TestCaseBase(unittest.TestCase):
# SF bug #561822:
cf = self.fromstring("[section]\nnekey=nevalue\n",
defaults={"key":"value"})
@@ -58,7 +58,7 @@ index ad36683..c8e6aca 100644
def test_default_case_sensitivity(self):
cf = self.newconfig({"foo": "Bar"})
@@ -182,7 +182,7 @@ def test_query_errors(self):
@@ -178,7 +178,7 @@ class TestCaseBase(unittest.TestCase):
cf = self.newconfig()
self.assertEqual(cf.sections(), [],
"new ConfigParser should have no defined sections")
@@ -67,7 +67,7 @@ index ad36683..c8e6aca 100644
"new ConfigParser should have no acknowledged sections")
self.assertRaises(ConfigParser.NoSectionError,
cf.options, "Foo")
@@ -221,8 +221,8 @@ def test_boolean(self):
@@ -217,8 +217,8 @@ class TestCaseBase(unittest.TestCase):
"E5=FALSE AND MORE"
)
for x in range(1, 5):
@@ -78,11 +78,11 @@ index ad36683..c8e6aca 100644
self.assertRaises(ValueError,
cf.getboolean, 'BOOLTEST', 'e%d' % x)
diff --git a/tests/test_fuzz.py b/tests/test_fuzz.py
index df568bb..874ef2e 100644
--- a/tests/test_fuzz.py
+++ b/tests/test_fuzz.py
@@ -102,7 +102,7 @@ def test_fuzz(self):
Index: iniparse-0.5/tests/test_fuzz.py
===================================================================
--- iniparse-0.5.orig/tests/test_fuzz.py
+++ iniparse-0.5/tests/test_fuzz.py
@@ -102,7 +102,7 @@ class TestFuzz(unittest.TestCase):
cc = compat.RawConfigParser()
cc.readfp(StringIO(s))
cc_py = configparser.RawConfigParser()

18
python3117.patch Normal file
View File

@@ -0,0 +1,18 @@
Index: iniparse-0.5/tests/test_compat.py
===================================================================
--- iniparse-0.5.orig/tests/test_compat.py
+++ iniparse-0.5/tests/test_compat.py
@@ -1,3 +1,4 @@
+import os
from iniparse import compat as ConfigParser
from io import StringIO
try:
@@ -263,6 +264,8 @@ class TestCaseBase(unittest.TestCase):
def test_read_returns_file_list(self):
file1 = test_support.findfile("cfgparser.1")
+ if not os.path.exists(file1):
+ file1 = test_support.findfile("configdata/cfgparser.1")
# check when we pass a mix of readable and non-readable files:
cf = self.newconfig()
parsed_files = cf.read([file1, "nonexistant-file"])