[packages/python-ply] restore tests compatibility with python >= 3.12; rel 10
atler
atler at pld-linux.org
Tue Mar 25 03:22:29 CET 2025
commit 519d3bfcbb6c8e3c79ac1bf677377cc25a3cdfff
Author: Jan Palus <atler at pld-linux.org>
Date: Tue Mar 25 01:35:05 2025 +0100
restore tests compatibility with python >= 3.12; rel 10
python-ply.spec | 6 +++++-
python3.12-tests.patch | 40 ++++++++++++++++++++++++++++++++++++++++
2 files changed, 45 insertions(+), 1 deletion(-)
---
diff --git a/python-ply.spec b/python-ply.spec
index 872ebc0..402db79 100644
--- a/python-ply.spec
+++ b/python-ply.spec
@@ -10,23 +10,26 @@ Summary(pl.UTF-8): lex i yacc dla Pythona 2
Name: python-%{module}
# note: keep 3.x here for python2 support; for 4+ create python3- .spec instead
Version: 3.11
-Release: 9
+Release: 10
License: BSD
Group: Libraries/Python
Source0: http://www.dabeaz.com/ply/ply-%{version}.tar.gz
# Source0-md5: 6465f602e656455affcd7c5734c638f8
+Patch0: python3.12-tests.patch
URL: http://www.dabeaz.com/ply/
BuildRequires: rpmbuild(macros) >= 1.714
%if %{with python2}
BuildRequires: python >= 1:2.7
%if %{with tests}
BuildRequires: python-setuptools
+BuildRequires: python-six
%endif
%endif
%if %{with python3}
BuildRequires: python3 >= 1:3.2
%if %{with tests}
BuildRequires: python3-setuptools
+BuildRequires: python3-six
%endif
%endif
Requires: python-modules >= 1:2.7
@@ -100,6 +103,7 @@ lex i yacc dla Pythona - przykłady.
%prep
%setup -q -n %{module}-%{version}
+%patch -P0 -p1
%{__sed} -i -e '1s,/usr/bin/env python,%{__python},' \
example/{,new}classcalc/calc.py
diff --git a/python3.12-tests.patch b/python3.12-tests.patch
new file mode 100644
index 0000000..53dcc07
--- /dev/null
+++ b/python3.12-tests.patch
@@ -0,0 +1,40 @@
+--- ply-3.11/test/testyacc.py.orig 2018-02-15 19:44:15.000000000 +0100
++++ ply-3.11/test/testyacc.py 2025-03-25 00:14:17.453624163 +0100
+@@ -90,6 +90,8 @@
+ if sys.hexversion >= 0x3020000:
+ warnings.filterwarnings('ignore', category=ResourceWarning)
+ warnings.filterwarnings('ignore', category=DeprecationWarning)
++ if sys.hexversion >= 0x30c0000:
++ setattr(YaccErrorWarningTests, 'assert_', unittest.TestCase.assertTrue)
+
+ def tearDown(self):
+ sys.stderr = sys.__stderr__
+--- ply-3.11/test/testlex.py.orig 2018-02-15 19:44:15.000000000 +0100
++++ ply-3.11/test/testlex.py 2025-03-25 01:32:04.567205158 +0100
+@@ -90,6 +90,8 @@
+ sys.stdout = StringIO.StringIO()
+ if sys.hexversion >= 0x3020000:
+ warnings.filterwarnings('ignore',category=ResourceWarning)
++ if sys.hexversion >= 0x30c0000:
++ setattr(LexErrorWarningTests, 'assert_', unittest.TestCase.assertTrue)
+
+ def tearDown(self):
+ sys.stderr = sys.__stderr__
+@@ -329,6 +331,8 @@
+ def setUp(self):
+ sys.stderr = StringIO.StringIO()
+ sys.stdout = StringIO.StringIO()
++ if sys.hexversion >= 0x30c0000:
++ setattr(LexBuildOptionTests, 'assert_', unittest.TestCase.assertTrue)
+ def tearDown(self):
+ sys.stderr = sys.__stderr__
+ sys.stdout = sys.__stdout__
+@@ -650,6 +654,8 @@
+ def setUp(self):
+ sys.stderr = StringIO.StringIO()
+ sys.stdout = StringIO.StringIO()
++ if sys.hexversion >= 0x30c0000:
++ setattr(LexRunTests, 'assert_', unittest.TestCase.assertTrue)
+ def tearDown(self):
+ sys.stderr = sys.__stderr__
+ sys.stdout = sys.__stdout__
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/python-ply.git/commitdiff/519d3bfcbb6c8e3c79ac1bf677377cc25a3cdfff
More information about the pld-cvs-commit
mailing list