commit 950e35d86434ebce5fbcad346391118b00da0217 Author: MSVSphere Packaging Team Date: Tue Nov 26 18:58:30 2024 +0300 import python-ply-3.11-24.el10 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..77ebc9a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +SOURCES/ply-3.11.tar.gz diff --git a/.python-ply.metadata b/.python-ply.metadata new file mode 100644 index 0000000..10195f1 --- /dev/null +++ b/.python-ply.metadata @@ -0,0 +1 @@ +10a555a32095991fbc7f7ed10c677a14e21fad1d SOURCES/ply-3.11.tar.gz diff --git a/SOURCES/262.patch b/SOURCES/262.patch new file mode 100644 index 0000000..561817d --- /dev/null +++ b/SOURCES/262.patch @@ -0,0 +1,799 @@ +diff -up ply-3.11/test/testlex.py.262 ply-3.11/test/testlex.py +--- ply-3.11/test/testlex.py.262 2018-02-15 13:44:15.000000000 -0500 ++++ ply-3.11/test/testlex.py 2021-12-30 13:21:51.894852923 -0500 +@@ -97,68 +97,68 @@ class LexErrorWarningTests(unittest.Test + def test_lex_doc1(self): + self.assertRaises(SyntaxError,run_import,"lex_doc1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_doc1.py:18: No regular expression defined for rule 't_NUMBER'\n")) + def test_lex_dup1(self): + self.assertRaises(SyntaxError,run_import,"lex_dup1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_dup1.py:20: Rule t_NUMBER redefined. Previously defined on line 18\n" )) + + def test_lex_dup2(self): + self.assertRaises(SyntaxError,run_import,"lex_dup2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_dup2.py:22: Rule t_NUMBER redefined. Previously defined on line 18\n" )) + + def test_lex_dup3(self): + self.assertRaises(SyntaxError,run_import,"lex_dup3") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_dup3.py:20: Rule t_NUMBER redefined. Previously defined on line 18\n" )) + + def test_lex_empty(self): + self.assertRaises(SyntaxError,run_import,"lex_empty") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "No rules of the form t_rulename are defined\n" + "No rules defined for state 'INITIAL'\n")) + + def test_lex_error1(self): + run_import("lex_error1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "No t_error rule is defined\n")) + + def test_lex_error2(self): + self.assertRaises(SyntaxError,run_import,"lex_error2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Rule 't_error' must be defined as a function\n") + ) + + def test_lex_error3(self): + self.assertRaises(SyntaxError,run_import,"lex_error3") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_error3.py:20: Rule 't_error' requires an argument\n")) + + def test_lex_error4(self): + self.assertRaises(SyntaxError,run_import,"lex_error4") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_error4.py:20: Rule 't_error' has too many arguments\n")) + + def test_lex_ignore(self): + self.assertRaises(SyntaxError,run_import,"lex_ignore") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_ignore.py:20: Rule 't_ignore' must be defined as a string\n")) + + def test_lex_ignore2(self): + run_import("lex_ignore2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "t_ignore contains a literal backslash '\\'\n")) + + +@@ -169,20 +169,20 @@ class LexErrorWarningTests(unittest.Test + msg = "Invalid regular expression for rule 't_NUMBER'. unbalanced parenthesis\n" + else: + msg = "Invalid regular expression for rule 't_NUMBER'. missing ), unterminated subpattern at position 0" +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + msg, + contains=True)) + + def test_lex_re2(self): + self.assertRaises(SyntaxError,run_import,"lex_re2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Regular expression for rule 't_PLUS' matches empty string\n")) + + def test_lex_re3(self): + self.assertRaises(SyntaxError,run_import,"lex_re3") + result = sys.stderr.getvalue() +-# self.assert_(check_expected(result, ++# self.assertTrue(check_expected(result, + # "Invalid regular expression for rule 't_POUND'. unbalanced parenthesis\n" + # "Make sure '#' in rule 't_POUND' is escaped with '\\#'\n")) + +@@ -192,78 +192,78 @@ class LexErrorWarningTests(unittest.Test + else: + msg = ("Invalid regular expression for rule 't_POUND'. missing ), unterminated subpattern at position 0\n" + "ERROR: Make sure '#' in rule 't_POUND' is escaped with '\#'") +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + msg, + contains=True), result) + + def test_lex_rule1(self): + self.assertRaises(SyntaxError,run_import,"lex_rule1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "t_NUMBER not defined as a function or string\n")) + + def test_lex_rule2(self): + self.assertRaises(SyntaxError,run_import,"lex_rule2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_rule2.py:18: Rule 't_NUMBER' requires an argument\n")) + + def test_lex_rule3(self): + self.assertRaises(SyntaxError,run_import,"lex_rule3") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "lex_rule3.py:18: Rule 't_NUMBER' has too many arguments\n")) + + + def test_lex_state1(self): + self.assertRaises(SyntaxError,run_import,"lex_state1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "states must be defined as a tuple or list\n")) + + def test_lex_state2(self): + self.assertRaises(SyntaxError,run_import,"lex_state2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Invalid state specifier 'comment'. Must be a tuple (statename,'exclusive|inclusive')\n" + "Invalid state specifier 'example'. Must be a tuple (statename,'exclusive|inclusive')\n")) + + def test_lex_state3(self): + self.assertRaises(SyntaxError,run_import,"lex_state3") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "State name 1 must be a string\n" + "No rules defined for state 'example'\n")) + + def test_lex_state4(self): + self.assertRaises(SyntaxError,run_import,"lex_state4") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "State type for state comment must be 'inclusive' or 'exclusive'\n")) + + + def test_lex_state5(self): + self.assertRaises(SyntaxError,run_import,"lex_state5") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "State 'comment' already defined\n")) + + def test_lex_state_noerror(self): + run_import("lex_state_noerror") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "No error rule is defined for exclusive state 'comment'\n")) + + def test_lex_state_norule(self): + self.assertRaises(SyntaxError,run_import,"lex_state_norule") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "No rules defined for state 'example'\n")) + + def test_lex_token1(self): + self.assertRaises(SyntaxError,run_import,"lex_token1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "No token list is defined\n" + "Rule 't_NUMBER' defined for an unspecified token NUMBER\n" + "Rule 't_PLUS' defined for an unspecified token PLUS\n" +@@ -273,7 +273,7 @@ class LexErrorWarningTests(unittest.Test + def test_lex_token2(self): + self.assertRaises(SyntaxError,run_import,"lex_token2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "tokens must be a list or tuple\n" + "Rule 't_NUMBER' defined for an unspecified token NUMBER\n" + "Rule 't_PLUS' defined for an unspecified token PLUS\n" +@@ -283,14 +283,14 @@ class LexErrorWarningTests(unittest.Test + def test_lex_token3(self): + self.assertRaises(SyntaxError,run_import,"lex_token3") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Rule 't_MINUS' defined for an unspecified token MINUS\n")) + + + def test_lex_token4(self): + self.assertRaises(SyntaxError,run_import,"lex_token4") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Bad token name '-'\n")) + + +@@ -299,25 +299,25 @@ class LexErrorWarningTests(unittest.Test + run_import("lex_token5") + except ply.lex.LexError: + e = sys.exc_info()[1] +- self.assert_(check_expected(str(e),"lex_token5.py:19: Rule 't_NUMBER' returned an unknown token type 'NUM'")) ++ self.assertTrue(check_expected(str(e),"lex_token5.py:19: Rule 't_NUMBER' returned an unknown token type 'NUM'")) + + def test_lex_token_dup(self): + run_import("lex_token_dup") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Token 'MINUS' multiply defined\n")) + + + def test_lex_literal1(self): + self.assertRaises(SyntaxError,run_import,"lex_literal1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Invalid literal '**'. Must be a single character\n")) + + def test_lex_literal2(self): + self.assertRaises(SyntaxError,run_import,"lex_literal2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Invalid literals specification. literals must be a sequence of characters\n")) + + import os +@@ -340,7 +340,7 @@ class LexBuildOptionTests(unittest.TestC + def test_lex_module(self): + run_import("lex_module") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) +@@ -348,7 +348,7 @@ class LexBuildOptionTests(unittest.TestC + def test_lex_object(self): + run_import("lex_object") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) +@@ -356,7 +356,7 @@ class LexBuildOptionTests(unittest.TestC + def test_lex_closure(self): + run_import("lex_closure") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) +@@ -377,34 +377,34 @@ class LexBuildOptionTests(unittest.TestC + run_import("lex_optimize") + + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) +- self.assert_(os.path.exists("lextab.py")) ++ self.assertTrue(os.path.exists("lextab.py")) + + p = subprocess.Popen([sys.executable,'-O','lex_optimize.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() + +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) + if test_pyo: +- self.assert_(pymodule_out_exists("lextab.pyo", 1)) ++ self.assertTrue(pymodule_out_exists("lextab.pyo", 1)) + pymodule_out_remove("lextab.pyo", 1) + + p = subprocess.Popen([sys.executable,'-OO','lex_optimize.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) + + if test_pyo: +- self.assert_(pymodule_out_exists("lextab.pyo", 2)) ++ self.assertTrue(pymodule_out_exists("lextab.pyo", 2)) + try: + os.remove("lextab.py") + except OSError: +@@ -433,31 +433,31 @@ class LexBuildOptionTests(unittest.TestC + pass + run_import("lex_optimize2") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) +- self.assert_(os.path.exists("opt2tab.py")) ++ self.assertTrue(os.path.exists("opt2tab.py")) + + p = subprocess.Popen([sys.executable,'-O','lex_optimize2.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) + if test_pyo: +- self.assert_(pymodule_out_exists("opt2tab.pyo", 1)) ++ self.assertTrue(pymodule_out_exists("opt2tab.pyo", 1)) + pymodule_out_remove("opt2tab.pyo", 1) + p = subprocess.Popen([sys.executable,'-OO','lex_optimize2.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) + if test_pyo: +- self.assert_(pymodule_out_exists("opt2tab.pyo", 2)) ++ self.assertTrue(pymodule_out_exists("opt2tab.pyo", 2)) + try: + os.remove("opt2tab.py") + except OSError: +@@ -483,32 +483,32 @@ class LexBuildOptionTests(unittest.TestC + open("lexdir/sub/__init__.py","w").write("") + run_import("lex_optimize3") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) +- self.assert_(os.path.exists("lexdir/sub/calctab.py")) ++ self.assertTrue(os.path.exists("lexdir/sub/calctab.py")) + + p = subprocess.Popen([sys.executable,'-O','lex_optimize3.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) + if test_pyo: +- self.assert_(pymodule_out_exists("lexdir/sub/calctab.pyo", 1)) ++ self.assertTrue(pymodule_out_exists("lexdir/sub/calctab.pyo", 1)) + pymodule_out_remove("lexdir/sub/calctab.pyo", 1) + + p = subprocess.Popen([sys.executable,'-OO','lex_optimize3.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(PLUS,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) + if test_pyo: +- self.assert_(pymodule_out_exists("lexdir/sub/calctab.pyo", 2)) ++ self.assertTrue(pymodule_out_exists("lexdir/sub/calctab.pyo", 2)) + try: + shutil.rmtree("lexdir") + except OSError: +@@ -549,33 +549,33 @@ class LexBuildOptionTests(unittest.TestC + pass + run_import("lex_opt_alias") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(+,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) +- self.assert_(os.path.exists("aliastab.py")) ++ self.assertTrue(os.path.exists("aliastab.py")) + + p = subprocess.Popen([sys.executable,'-O','lex_opt_alias.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(+,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) + if test_pyo: +- self.assert_(pymodule_out_exists("aliastab.pyo", 1)) ++ self.assertTrue(pymodule_out_exists("aliastab.pyo", 1)) + pymodule_out_remove("aliastab.pyo", 1) + + p = subprocess.Popen([sys.executable,'-OO','lex_opt_alias.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,3,1,0)\n" + "(+,'+',1,1)\n" + "(NUMBER,4,1,2)\n")) + + if test_pyo: +- self.assert_(pymodule_out_exists("aliastab.pyo", 2)) ++ self.assertTrue(pymodule_out_exists("aliastab.pyo", 2)) + try: + os.remove("aliastab.py") + except OSError: +@@ -604,7 +604,7 @@ class LexBuildOptionTests(unittest.TestC + pass + run_import("lex_many_tokens") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(TOK34,'TOK34:',1,0)\n" + "(TOK143,'TOK143:',1,7)\n" + "(TOK269,'TOK269:',1,15)\n" +@@ -614,13 +614,13 @@ class LexBuildOptionTests(unittest.TestC + "(TOK999,'TOK999:',1,47)\n" + )) + +- self.assert_(os.path.exists("manytab.py")) ++ self.assertTrue(os.path.exists("manytab.py")) + + if implementation() == 'CPython': + p = subprocess.Popen([sys.executable,'-O','lex_many_tokens.py'], + stdout=subprocess.PIPE) + result = p.stdout.read() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(TOK34,'TOK34:',1,0)\n" + "(TOK143,'TOK143:',1,7)\n" + "(TOK269,'TOK269:',1,15)\n" +@@ -630,7 +630,7 @@ class LexBuildOptionTests(unittest.TestC + "(TOK999,'TOK999:',1,47)\n" + )) + +- self.assert_(pymodule_out_exists("manytab.pyo", 1)) ++ self.assertTrue(pymodule_out_exists("manytab.pyo", 1)) + pymodule_out_remove("manytab.pyo", 1) + try: + os.remove("manytab.py") +@@ -657,7 +657,7 @@ class LexRunTests(unittest.TestCase): + def test_lex_hedit(self): + run_import("lex_hedit") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(H_EDIT_DESCRIPTOR,'abc',1,0)\n" + "(H_EDIT_DESCRIPTOR,'abcdefghij',1,6)\n" + "(H_EDIT_DESCRIPTOR,'xy',1,20)\n")) +@@ -665,7 +665,7 @@ class LexRunTests(unittest.TestCase): + def test_lex_state_try(self): + run_import("lex_state_try") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "(NUMBER,'3',1,0)\n" + "(PLUS,'+',1,2)\n" + "(NUMBER,'4',1,4)\n" +diff -up ply-3.11/test/testyacc.py.262 ply-3.11/test/testyacc.py +--- ply-3.11/test/testyacc.py.262 2018-02-15 13:44:15.000000000 -0500 ++++ ply-3.11/test/testyacc.py 2021-12-30 13:18:40.237690758 -0500 +@@ -97,14 +97,14 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_badargs(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_badargs") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_badargs.py:23: Rule 'p_statement_assign' has too many arguments\n" + "yacc_badargs.py:27: Rule 'p_statement_expr' requires an argument\n" + )) + def test_yacc_badid(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_badid") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_badid.py:32: Illegal name 'bad&rule' in rule 'statement'\n" + "yacc_badid.py:36: Illegal rule name 'bad&rule'\n" + )) +@@ -114,20 +114,20 @@ class YaccErrorWarningTests(unittest.Tes + run_import("yacc_badprec") + except ply.yacc.YaccError: + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "precedence must be a list or tuple\n" + )) + def test_yacc_badprec2(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_badprec2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Bad precedence table\n" + )) + + def test_yacc_badprec3(self): + run_import("yacc_badprec3") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Precedence already specified for terminal 'MINUS'\n" + "Generating LALR tables\n" + +@@ -136,7 +136,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_badrule(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_badrule") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_badrule.py:24: Syntax error. Expected ':'\n" + "yacc_badrule.py:28: Syntax error in rule 'statement'\n" + "yacc_badrule.py:33: Syntax error. Expected ':'\n" +@@ -148,13 +148,13 @@ class YaccErrorWarningTests(unittest.Tes + run_import("yacc_badtok") + except ply.yacc.YaccError: + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "tokens must be a list or tuple\n")) + + def test_yacc_dup(self): + run_import("yacc_dup") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_dup.py:27: Function p_statement redefined. Previously defined on line 23\n" + "Token 'EQUALS' defined, but not used\n" + "There is 1 unused token\n" +@@ -166,7 +166,7 @@ class YaccErrorWarningTests(unittest.Tes + run_import("yacc_error1") + except ply.yacc.YaccError: + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_error1.py:61: p_error() requires 1 argument\n")) + + def test_yacc_error2(self): +@@ -174,7 +174,7 @@ class YaccErrorWarningTests(unittest.Tes + run_import("yacc_error2") + except ply.yacc.YaccError: + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_error2.py:61: p_error() requires 1 argument\n")) + + def test_yacc_error3(self): +@@ -183,13 +183,13 @@ class YaccErrorWarningTests(unittest.Tes + except ply.yacc.YaccError: + e = sys.exc_info()[1] + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "'p_error' defined, but is not a function or method\n")) + + def test_yacc_error4(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_error4") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_error4.py:62: Illegal rule name 'error'. Already defined as a token\n" + )) + +@@ -197,7 +197,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_error5(self): + run_import("yacc_error5") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Group at 3:10 to 3:12\n" + "Undefined name 'a'\n" + "Syntax error at 'b'\n" +@@ -209,7 +209,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_error6(self): + run_import("yacc_error6") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "a=7\n" + "Line 3: Syntax error at '*'\n" + "c=21\n" +@@ -218,7 +218,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_error7(self): + run_import("yacc_error7") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "a=7\n" + "Line 3: Syntax error at '*'\n" + "c=21\n" +@@ -227,7 +227,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_inf(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_inf") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Token 'NUMBER' defined, but not used\n" + "There is 1 unused token\n" + "Infinite recursion detected for symbol 'statement'\n" +@@ -236,27 +236,27 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_literal(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_literal") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_literal.py:36: Literal token '**' in rule 'expression' may only be a single character\n" + )) + def test_yacc_misplaced(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_misplaced") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_misplaced.py:32: Misplaced '|'\n" + )) + + def test_yacc_missing1(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_missing1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_missing1.py:24: Symbol 'location' used, but not defined as a token or a rule\n" + )) + + def test_yacc_nested(self): + run_import("yacc_nested") + result = sys.stdout.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "A\n" + "A\n" + "A\n", +@@ -265,7 +265,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_nodoc(self): + run_import("yacc_nodoc") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_nodoc.py:27: No documentation string specified in function 'p_statement_expr' (ignored)\n" + "Generating LALR tables\n" + )) +@@ -273,7 +273,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_noerror(self): + run_import("yacc_noerror") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "no p_error() function is defined\n" + "Generating LALR tables\n" + )) +@@ -281,7 +281,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_nop(self): + run_import("yacc_nop") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_nop.py:27: Possible grammar rule 'statement_expr' defined without p_ prefix\n" + "Generating LALR tables\n" + )) +@@ -289,7 +289,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_notfunc(self): + run_import("yacc_notfunc") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "'p_statement_assign' not defined as a function\n" + "Token 'EQUALS' defined, but not used\n" + "There is 1 unused token\n" +@@ -300,13 +300,13 @@ class YaccErrorWarningTests(unittest.Tes + run_import("yacc_notok") + except ply.yacc.YaccError: + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "No token list is defined\n")) + + def test_yacc_rr(self): + run_import("yacc_rr") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Generating LALR tables\n" + "1 reduce/reduce conflict\n" + "reduce/reduce conflict in state 15 resolved using rule (statement -> NAME EQUALS NUMBER)\n" +@@ -317,7 +317,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_rr_unused(self): + run_import("yacc_rr_unused") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "no p_error() function is defined\n" + "Generating LALR tables\n" + "3 reduce/reduce conflicts\n" +@@ -333,14 +333,14 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_simple(self): + run_import("yacc_simple") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Generating LALR tables\n" + )) + + def test_yacc_sr(self): + run_import("yacc_sr") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Generating LALR tables\n" + "20 shift/reduce conflicts\n" + )) +@@ -348,21 +348,21 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_term1(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_term1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_term1.py:24: Illegal rule name 'NUMBER'. Already defined as a token\n" + )) + + def test_yacc_unicode_literals(self): + run_import("yacc_unicode_literals") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Generating LALR tables\n" + )) + + def test_yacc_unused(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_unused") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_unused.py:62: Symbol 'COMMA' used, but not defined as a token or a rule\n" + "Symbol 'COMMA' is unreachable\n" + "Symbol 'exprlist' is unreachable\n" +@@ -370,7 +370,7 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_unused_rule(self): + run_import("yacc_unused_rule") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_unused_rule.py:62: Rule 'integer' defined, but not used\n" + "There is 1 unused rule\n" + "Symbol 'integer' is unreachable\n" +@@ -380,21 +380,21 @@ class YaccErrorWarningTests(unittest.Tes + def test_yacc_uprec(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_uprec") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_uprec.py:37: Nothing known about the precedence of 'UMINUS'\n" + )) + + def test_yacc_uprec2(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_uprec2") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "yacc_uprec2.py:37: Syntax error. Nothing follows %prec\n" + )) + + def test_yacc_prec1(self): + self.assertRaises(ply.yacc.YaccError,run_import,"yacc_prec1") + result = sys.stderr.getvalue() +- self.assert_(check_expected(result, ++ self.assertTrue(check_expected(result, + "Precedence rule 'left' defined for unknown symbol '+'\n" + "Precedence rule 'left' defined for unknown symbol '*'\n" + "Precedence rule 'left' defined for unknown symbol '-'\n" diff --git a/SPECS/python-ply.spec b/SPECS/python-ply.spec new file mode 100644 index 0000000..8709507 --- /dev/null +++ b/SPECS/python-ply.spec @@ -0,0 +1,271 @@ +%global modname ply + +%bcond_without tests + +Name: python-%{modname} +Summary: Python Lex-Yacc +Version: 3.11 +Release: 24%{?dist} +License: BSD-3-Clause +URL: http://www.dabeaz.com/ply/ +Source0: http://www.dabeaz.com/ply/%{modname}-%{version}.tar.gz +# Fix build against Python 3.11 +# https://github.com/dabeaz/ply/pull/262 +Patch0: 262.patch +BuildArch: noarch + +%description +PLY is a straightforward lex/yacc implementation. Here is a list of its +essential features: +* It is implemented entirely in Python. +* It uses LR-parsing which is reasonably efficient and well suited for larger + grammars. +* PLY provides most of the standard lex/yacc features including support + for empty productions, precedence rules, error recovery, and support + for ambiguous grammars. +* PLY is straightforward to use and provides very extensive error checking. +* PLY doesn't try to do anything more or less than provide the basic lex/yacc + functionality. In other words, it's not a large parsing framework or a + component of some larger system. + +%package -n python3-%{modname} +Summary: Python Lex-Yacc +%{?python_provide:%python_provide python3-%{modname}} +BuildRequires: python3-devel +BuildRequires: python3-setuptools + +%description -n python3-%{modname} +PLY is a straightforward lex/yacc implementation. Here is a list of its +essential features: +* It is implemented entirely in Python. +* It uses LR-parsing which is reasonably efficient and well suited for larger + grammars. +* PLY provides most of the standard lex/yacc features including support + for empty productions, precedence rules, error recovery, and support + for ambiguous grammars. +* PLY is straightforward to use and provides very extensive error checking. +* PLY doesn't try to do anything more or less than provide the basic lex/yacc + functionality. In other words, it's not a large parsing framework or a + component of some larger system. + +Python 3 version. + +%prep +%setup -n %{modname}-%{version} +%patch0 -p1 -b .262 +find example/ -type f -executable -exec chmod -x {} ';' +find example/ -type f -name '*.py' -exec sed -i \ + -e '1{\@^#!/usr/bin/env python@d}' -e '1{\@^#!/usr/local/bin/python@d}' \ + {} ';' +rm -rf *.egg-info +# extract license block from beginning of README.md +grep -B1000 "POSSIBILITY OF SUCH DAMAGE" README.md > LICENSE + +%build +%py3_build + +%install +%py3_install + +%if %{with tests} +%check +pushd test + ./cleanup.sh + %{__python3} testlex.py + %{__python3} testyacc.py +popd +%endif + +%files -n python3-%{modname} +%doc CHANGES README.md +%license LICENSE +%{python3_sitelib}/%{modname}/ +%{python3_sitelib}/%{modname}-%{version}-*.egg-info/ + +%changelog +* Tue Nov 26 2024 MSVSphere Packaging Team - 3.11-24 +- Rebuilt for MSVSphere 10 + +* Mon Jun 24 2024 Troy Dawson - 3.11-24 +- Bump release for June 2024 mass rebuild + +* Fri Jan 26 2024 Fedora Release Engineering - 3.11-23 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Mon Jan 22 2024 Fedora Release Engineering - 3.11-22 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild + +* Tue Aug 22 2023 Rob Crittenden - 3.11-21 +- migrated to SPDX license + +* Fri Jul 21 2023 Fedora Release Engineering - 3.11-20 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild + +* Tue Jun 13 2023 Python Maint - 3.11-19 +- Rebuilt for Python 3.12 + +* Fri Jan 20 2023 Fedora Release Engineering - 3.11-18 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild + +* Fri Jul 22 2022 Fedora Release Engineering - 3.11-17 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild + +* Mon Jun 13 2022 Python Maint - 3.11-16 +- Rebuilt for Python 3.11 + +* Fri Jan 21 2022 Fedora Release Engineering - 3.11-15 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild + +* Thu Dec 30 2021 Tom Callaway - 3.11-14 +- fix build against python 3.11, thanks to Hugo van Kemenade + +* Fri Jul 23 2021 Fedora Release Engineering - 3.11-13 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild + +* Wed Jun 02 2021 Python Maint - 3.11-12 +- Rebuilt for Python 3.10 + +* Wed Jan 27 2021 Fedora Release Engineering - 3.11-11 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild + +* Tue Jan 5 15:25:57 CET 2021 Christian Heimes - 3.11-10 +- Extract and ship license file (#1912893) + +* Wed Jul 29 2020 Fedora Release Engineering - 3.11-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild + +* Sat May 23 2020 Miro Hrončok - 3.11-8 +- Rebuilt for Python 3.9 + +* Thu Jan 30 2020 Fedora Release Engineering - 3.11-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild + +* Sun Oct 20 2019 Miro Hrončok - 3.11-6 +- Subpackage python2-ply has been removed + See https://fedoraproject.org/wiki/Changes/Mass_Python_2_Package_Removal + +* Thu Oct 03 2019 Miro Hrončok - 3.11-5 +- Rebuilt for Python 3.8.0rc1 (#1748018) + +* Thu Aug 15 2019 Miro Hrončok - 3.11-4 +- Rebuilt for Python 3.8 + +* Fri Jul 26 2019 Fedora Release Engineering - 3.11-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild + +* Sat Feb 02 2019 Fedora Release Engineering - 3.11-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Fri Jan 11 2019 Igor Gnatenko - 3.11-1 +- Update to 3.11 + +* Sat Jul 14 2018 Fedora Release Engineering - 3.9-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Fri Jun 15 2018 Miro Hrončok - 3.9-7 +- Rebuilt for Python 3.7 + +* Fri Feb 09 2018 Fedora Release Engineering - 3.9-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Wed Sep 27 2017 Troy Dawson - 3.9-5 +- Cleanup spec file conditionals + +* Thu Jul 27 2017 Fedora Release Engineering - 3.9-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Sat Feb 11 2017 Fedora Release Engineering - 3.9-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild + +* Fri Dec 09 2016 Charalampos Stratakis - 3.9-2 +- Rebuild for Python 3.6 + +* Tue Nov 8 2016 Orion Poplawski - 3.9-1 +- Update to 3.9 + +* Tue Jul 19 2016 Fedora Release Engineering - 3.8-2 +- https://fedoraproject.org/wiki/Changes/Automatic_Provides_for_Python_RPM_Packages + +* Sun Apr 10 2016 Igor Gnatenko - 3.8-1 +- Update to 3.8 +- Follow new packaging guidelines +- Run tests + +* Thu Feb 04 2016 Fedora Release Engineering - 3.6-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Oct 13 2015 Robert Kuska - 3.6-3 +- Rebuilt for Python3.5 rebuild + +* Tue Aug 18 2015 Stephen Gallagher 3.6-2 +- Fixes for chromium and SlimIt +- Resolves: rhbz#1242929 +- Resolves: rhbz#1254372 + +* Tue Jul 14 2015 Stephen Gallagher 3.6-1 +- Update to latest ply 3.6 for Python 3 fixes + +* Thu Jun 18 2015 Fedora Release Engineering - 3.4-8 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Sat Jun 07 2014 Fedora Release Engineering - 3.4-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Mon May 12 2014 Bohuslav Kabrda - 3.4-6 +- Rebuilt for https://fedoraproject.org/wiki/Changes/Python_3.4 + +* Sun Aug 04 2013 Fedora Release Engineering - 3.4-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Thu Feb 14 2013 Fedora Release Engineering - 3.4-4 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild + +* Sat Aug 04 2012 David Malcolm - 3.4-3 +- rebuild for https://fedoraproject.org/wiki/Features/Python_3.3 + +* Sat Jul 21 2012 Fedora Release Engineering - 3.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Mon Mar 19 2012 Tom Callaway - 3.4-1 +- update to 3.4 + +* Sat Jan 14 2012 Fedora Release Engineering - 3.3-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Feb 08 2011 Fedora Release Engineering - 3.3-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Wed Aug 25 2010 Thomas Spura - 3.3-4 +- update to most recent python packaging guidelines +- rebuild with python3.2 + http://lists.fedoraproject.org/pipermail/devel/2010-August/141368.html + +* Thu Jul 22 2010 David Malcolm - 3.3-3 +- Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild + +* Sat Apr 3 2010 David Malcolm - 3.3-2 +- add python3-ply subpackage + +* Mon Oct 19 2009 Tom "spot" Callaway - 3.3-1 +- update to 3.3 + +* Sun Jul 26 2009 Fedora Release Engineering - 3.2-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Wed Apr 22 2009 Tom "spot" Callaway 3.2-1 +- update to 3.2, license change to BSD + +* Thu Feb 26 2009 Fedora Release Engineering - 2.5-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Sat Nov 29 2008 Ignacio Vazquez-Abrams - 2.5-2 +- Rebuild for Python 2.6 + +* Fri Oct 17 2008 Tom "spot" Callaway 2.5-1 +- update to 2.5 + +* Mon Mar 24 2008 Tom "spot" Callaway 0.2.3-2 +- add example dir as doc + +* Sat Mar 15 2008 Tom "spot" Callaway 0.2.3-1 +- Initial package for Fedora