From nobody Sat Apr 16 04:25:27 2022 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id EDF557CECF8; Sat, 16 Apr 2022 04:25:28 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4KgKqq6Ztyz3PhF; Sat, 16 Apr 2022 04:25:27 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650083128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ha5u1Iw/gVTXGcZ50/dgXm4mSaoV1NgNC3ipsHBRT5s=; b=IiqY4gSt4TY5JWsl19aehPvNhEeCLCalgV83klJU0ba5/YAHrurOeNNEud3VscTPm7RG8O EaIoBAdrspWCeDrSxYLlAovUQbj0m+WnLJv5iuBmWD3FM81Giml02OBEWC0lyscpxuCmPa QfdLPz/rzG4y3io3/J9YGUg1qYaXxCLwxc/L1DGtKnvfW9dO0i2Pq/+xugErBD2C786F21 RT6rneRPFk9YhQAgPUB5dS2PxudNWsuONuyFy+9GTNrm+wStOASMZSBxAyLAlH1rictNyX Wo9aogz6O3JKXVkkXEDRIMpMOBG7mBJVugtqBKjeqhHMWAeih7SOsOy3LvM47w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id A3C072300F; Sat, 16 Apr 2022 04:25:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 23G4PRwa008790; Sat, 16 Apr 2022 04:25:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 23G4PRIE008789; Sat, 16 Apr 2022 04:25:27 GMT (envelope-from git) Date: Sat, 16 Apr 2022 04:25:27 GMT Message-Id: <202204160425.23G4PRIE008789@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Po-Chuan Hsieh Subject: git: 45e6d20f876f - main - devel/py-zope.tales: Fix build with setuptools 58.0.0+ List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: sunpoet X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 45e6d20f876ff9c7afba3dbd361281a55331c936 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1650083128; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=Ha5u1Iw/gVTXGcZ50/dgXm4mSaoV1NgNC3ipsHBRT5s=; b=c3NsECUIU/VORTMsrqak0rBKZJQxpPPRAcTMhOCU4kMyUWQgpME1WevqTyH/WT6H+W5qPc 3WMq1CW7VM+NxZBjuj7v+nGPLcGJ/VVsdlbWYSjUlBVAGTWjWTj31lXt+QrPsl6jaQC59S MEkoj+uUFoLqqLFgSIEYSa415QqUuyEyLj2PQmpKbQox+bOp4GqMeT7/+TgYq26eaG7vVO HHLX3eECpSXbpoKw3TiKS1RXg6vN5eweanizNF4p7dFTc5JLmtbGoOtTmXLUh+LPXzL7/K oH9ldIvBs2rmaRusAUZs1hpjpomt8XWIuSPEKA3DgO4nM7ElplOz9JBdMqVFeQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1650083128; a=rsa-sha256; cv=none; b=fFnqyKyyk7mzI1RKmgPE2+aqr4Y7diGtUe5oEXBgJYsoBJaoKB9ypvIAfSSEfav3VgeNBV Up0kh2WiuiT4v6TI8kltWyncgLECYB0fgDuQ5Mw2xND0ASfa3QW3CJzaoMKa7bF+XJhDht vdGVlQnplxSUK/8Wrfvl+RLQ050r0S1lBiZJs8s3vr/0ZFR2BANj5nkUkx5cNVGorvJw6o JkkeRwPut3qWJrv+mDSj6q9+YlnflbEMKi9bAuXvv8o3QJ3T2qhKhthveTg+Vn8Xqe8RCr JbhN5QAwk17J8lhma603IuQwchXURcdKMLmtM+IAZNt+ZoI9nZ9R2y96HaLhjg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by sunpoet: URL: https://cgit.FreeBSD.org/ports/commit/?id=45e6d20f876ff9c7afba3dbd361281a55331c936 commit 45e6d20f876ff9c7afba3dbd361281a55331c936 Author: Po-Chuan Hsieh AuthorDate: 2022-04-16 04:15:32 +0000 Commit: Po-Chuan Hsieh CommitDate: 2022-04-16 04:19:53 +0000 devel/py-zope.tales: Fix build with setuptools 58.0.0+ With hat: python --- devel/py-zope.tales/files/patch-2to3 | 393 +++++++++++++++++++++++++++++++++++ 1 file changed, 393 insertions(+) diff --git a/devel/py-zope.tales/files/patch-2to3 b/devel/py-zope.tales/files/patch-2to3 new file mode 100644 index 000000000000..98bfba1cab24 --- /dev/null +++ b/devel/py-zope.tales/files/patch-2to3 @@ -0,0 +1,393 @@ +--- src/zope/tales/expressions.py.orig 2012-05-23 15:44:50 UTC ++++ src/zope/tales/expressions.py +@@ -93,7 +93,7 @@ class SubPathExpr(object): + # check for initial function + raise engine.getCompilerError()( + 'Namespace function specified in first subpath element') +- elif isinstance(first, basestring): ++ elif isinstance(first, str): + # check for initial ? + raise engine.getCompilerError()( + 'Dynamic name specified in first subpath element') +@@ -122,11 +122,11 @@ class SubPathExpr(object): + for element in compiled_path: + if isinstance(element, tuple): + ob = self._traverser(ob, element, econtext) +- elif isinstance(element, basestring): ++ elif isinstance(element, str): + val = vars[element] + # If the value isn't a string, assume it's a sequence + # of path names. +- if isinstance(val, basestring): ++ if isinstance(val, str): + val = (val,) + ob = self._traverser(ob, val, econtext) + elif callable(element): +@@ -207,7 +207,7 @@ class PathExpr(object): + # support calling old style classes which don't have a + # __call__. + if (getattr(ob, '__call__', _marker) is not _marker +- or isinstance(ob, types.ClassType)): ++ or isinstance(ob, type)): + return ob() + return ob + +@@ -217,10 +217,10 @@ class PathExpr(object): + return self._eval(econtext) + + def __str__(self): +- return '%s expression (%s)' % (self._name, `self._s`) ++ return '%s expression (%s)' % (self._name, repr(self._s)) + + def __repr__(self): +- return '' % (self._name, `self._s`) ++ return '' % (self._name, repr(self._s)) + + + +@@ -265,10 +265,10 @@ class StringExpr(object): + return self._expr % tuple(vvals) + + def __str__(self): +- return 'string expression (%s)' % `self._s` ++ return 'string expression (%s)' % repr(self._s) + + def __repr__(self): +- return '' % `self._s` ++ return '' % repr(self._s) + + + class NotExpr(object): +@@ -282,7 +282,7 @@ class NotExpr(object): + return int(not econtext.evaluateBoolean(self._c)) + + def __repr__(self): +- return '' % `self._s` ++ return '' % repr(self._s) + + + class DeferWrapper(object): +@@ -308,7 +308,7 @@ class DeferExpr(object): + return DeferWrapper(self._c, econtext) + + def __repr__(self): +- return '' % `self._s` ++ return '' % repr(self._s) + + + class LazyWrapper(DeferWrapper): +@@ -331,7 +331,7 @@ class LazyExpr(DeferExpr): + return LazyWrapper(self._c, econtext) + + def __repr__(self): +- return 'lazy:%s' % `self._s` ++ return 'lazy:%s' % repr(self._s) + + + class SimpleModuleImporter(object): +--- src/zope/tales/pythonexpr.py.orig 2012-05-23 15:44:50 UTC ++++ src/zope/tales/pythonexpr.py +@@ -23,7 +23,7 @@ class PythonExpr(object): + self.text = text + try: + code = self._compile(text, '') +- except SyntaxError, e: ++ except SyntaxError as e: + raise engine.getCompilerError()(str(e)) + self._code = code + self._varnames = code.co_names +--- src/zope/tales/tests/simpleexpr.py.orig 2012-05-23 15:44:50 UTC ++++ src/zope/tales/tests/simpleexpr.py +@@ -27,4 +27,4 @@ class SimpleExpr(object): + def __call__(self, econtext): + return self._name, self._expr + def __repr__(self): +- return '' % (self._name, `self._expr`) ++ return '' % (self._name, repr(self._expr)) +--- src/zope/tales/tests/test_expressions.py.orig 2012-05-23 15:44:50 UTC ++++ src/zope/tales/tests/test_expressions.py +@@ -35,7 +35,7 @@ class Data(object): + class ErrorGenerator: + + def __getitem__(self, name): +- import __builtin__ ++ import builtins + if name == 'Undefined': + e = Undefined + else: +@@ -111,7 +111,7 @@ class ExpressionTests(ExpressionTestBase): + from zope.tales.tales import CompilerError + try: + self.engine.compile('?x') +- except CompilerError,e: ++ except CompilerError as e: + self.assertEqual(e.args[0], + 'Dynamic name specified in first subpath element') + else: +@@ -122,14 +122,14 @@ class ExpressionTests(ExpressionTestBase): + pass + self.context.vars['oldstyleclass'] = AnOldStyleClass + expr = self.engine.compile('oldstyleclass') +- self.assert_(isinstance(expr(self.context), AnOldStyleClass)) ++ self.assertTrue(isinstance(expr(self.context), AnOldStyleClass)) + + def testString(self): + expr = self.engine.compile('string:Fred') + context=self.context + result = expr(context) + self.assertEqual(result, 'Fred') +- self.failUnless(isinstance(result, str)) ++ self.assertTrue(isinstance(result, str)) + + def testStringSub(self): + expr = self.engine.compile('string:A$B') +@@ -162,16 +162,16 @@ class ExpressionTests(ExpressionTestBase): + + def testStringUnicode(self): + # Unicode string expressions should return unicode strings +- expr = self.engine.compile(u'string:Fred') ++ expr = self.engine.compile('string:Fred') + context=self.context + result = expr(context) +- self.assertEqual(result, u'Fred') +- self.failUnless(isinstance(result, unicode)) ++ self.assertEqual(result, 'Fred') ++ self.assertTrue(isinstance(result, str)) + + def testStringFailureWhenMixed(self): + # Mixed Unicode and 8bit string interpolation fails with a + # UnicodeDecodeError, assuming there is no default encoding +- expr = self.engine.compile(u'string:a ${eightBits}') ++ expr = self.engine.compile('string:a ${eightBits}') + self.assertRaises(UnicodeDecodeError, expr, self.context) + + def testPython(self): +@@ -210,7 +210,7 @@ class ExpressionTests(ExpressionTestBase): + self.context.vars['acallable']) + self.assertEqual(eval('foo | string:x'), 'x') + self.assertEqual(eval('foo | string:$one'), '1') +- self.assert_(eval('foo | exists:x')) ++ self.assertTrue(eval('foo | exists:x')) + + def testEmptyPathSegmentRaisesCompilerError(self): + CompilerError = self.engine.getCompilerError() +@@ -246,13 +246,13 @@ class ExpressionTests(ExpressionTestBase): + from zope.tales.expressions import DeferWrapper + expr = self.engine.compile('defer: b') + context=self.context +- self.failUnless(isinstance(expr(context), DeferWrapper)) ++ self.assertTrue(isinstance(expr(context), DeferWrapper)) + + def test_lazy_expression_returns_wrapper(self): + from zope.tales.expressions import LazyWrapper + expr = self.engine.compile('lazy: b') + context=self.context +- self.failUnless(isinstance(expr(context), LazyWrapper)) ++ self.assertTrue(isinstance(expr(context), LazyWrapper)) + + + class FunctionTests(ExpressionTestBase): +@@ -279,7 +279,7 @@ class FunctionTests(ExpressionTestBase): + def __getitem__(self,key): + if key=='jump': + return self.context._d +- raise KeyError,key ++ raise KeyError(key) + + self.TestNameSpace = TestNameSpace + self.engine.registerFunctionNamespace('namespace', self.TestNameSpace) +@@ -308,7 +308,7 @@ class FunctionTests(ExpressionTestBase): + from zope.tales.tales import CompilerError + try: + self.engine.compile('adapterTest/badnamespace:title') +- except CompilerError,e: ++ except CompilerError as e: + self.assertEqual(e.args[0],'Unknown namespace "badnamespace"') + else: + self.fail('Engine accepted unknown namespace') +@@ -337,7 +337,7 @@ class FunctionTests(ExpressionTestBase): + from zope.tales.tales import CompilerError + try: + self.engine.compile('adapterTest/1foo:bar') +- except CompilerError,e: ++ except CompilerError as e: + self.assertEqual(e.args[0], + 'Invalid namespace name "1foo"') + else: +@@ -348,8 +348,8 @@ class FunctionTests(ExpressionTestBase): + try: + expr = self.engine.compile('adapterTest/namespace:title') + expr(self.context) +- except KeyError,e: +- self.assertEquals(e.args[0],'title') ++ except KeyError as e: ++ self.assertEqual(e.args[0],'title') + else: + self.fail('Engine accepted unknown function') + +--- src/zope/tales/tests/test_tales.py.orig 2012-05-23 15:44:50 UTC ++++ src/zope/tales/tests/test_tales.py +@@ -30,7 +30,7 @@ class TALESTests(unittest.TestCase): + # Test sample Iterator class + context = Harness(self) + it = tales.Iterator('name', (), context) +- self.assert_( not it.next(), "Empty iterator") ++ self.assertTrue( not next(it), "Empty iterator") + context._complete_() + + def testIterator1(self): +@@ -38,7 +38,7 @@ class TALESTests(unittest.TestCase): + context = Harness(self) + it = tales.Iterator('name', (1,), context) + context._assert_('setLocal', 'name', 1) +- self.assert_( it.next() and not it.next(), "Single-element iterator") ++ self.assertTrue( next(it) and not next(it), "Single-element iterator") + context._complete_() + + def testIterator2(self): +@@ -48,15 +48,15 @@ class TALESTests(unittest.TestCase): + for c in 'text': + context._assert_('setLocal', 'text', c) + for c in 'text': +- self.assert_(it.next(), "Multi-element iterator") +- self.assert_( not it.next(), "Multi-element iterator") ++ self.assertTrue(next(it), "Multi-element iterator") ++ self.assertTrue( not next(it), "Multi-element iterator") + context._complete_() + + def testRegisterType(self): + # Test expression type registration + e = tales.ExpressionEngine() + e.registerType('simple', SimpleExpr) +- self.assert_( e.getTypes()['simple'] == SimpleExpr) ++ self.assertTrue( e.getTypes()['simple'] == SimpleExpr) + + def testRegisterTypeUnique(self): + # Test expression type registration uniqueness +@@ -67,7 +67,7 @@ class TALESTests(unittest.TestCase): + except tales.RegistrationError: + pass + else: +- self.assert_( 0, "Duplicate registration accepted.") ++ self.assertTrue( 0, "Duplicate registration accepted.") + + def testRegisterTypeNameConstraints(self): + # Test constraints on expression type names +@@ -78,15 +78,15 @@ class TALESTests(unittest.TestCase): + except tales.RegistrationError: + pass + else: +- self.assert_( 0, 'Invalid type name "%s" accepted.' % name) ++ self.assertTrue( 0, 'Invalid type name "%s" accepted.' % name) + + def testCompile(self): + # Test expression compilation + e = tales.ExpressionEngine() + e.registerType('simple', SimpleExpr) + ce = e.compile('simple:x') +- self.assert_( ce(None) == ('simple', 'x'), ( +- 'Improperly compiled expression %s.' % `ce`)) ++ self.assertTrue( ce(None) == ('simple', 'x'), ( ++ 'Improperly compiled expression %s.' % repr(ce))) + + def testGetContext(self): + # Test Context creation +@@ -97,13 +97,13 @@ class TALESTests(unittest.TestCase): + def getContext(self, **kws): + e = tales.ExpressionEngine() + e.registerType('simple', SimpleExpr) +- return apply(e.getContext, (), kws) ++ return e.getContext(*(), **kws) + + def testContext0(self): + # Test use of Context + se = self.getContext().evaluate('simple:x') +- self.assert_( se == ('simple', 'x'), ( +- 'Improperly evaluated expression %s.' % `se`)) ++ self.assertTrue( se == ('simple', 'x'), ( ++ 'Improperly evaluated expression %s.' % repr(se))) + + def testVariables(self): + # Test variables +@@ -113,22 +113,22 @@ class TALESTests(unittest.TestCase): + ctxt.setLocal('v2', 2) + + c = ctxt.vars +- self.assert_( c['v1'] == 1, 'Variable "v1"') ++ self.assertTrue( c['v1'] == 1, 'Variable "v1"') + + ctxt.beginScope() + ctxt.setLocal('v1', 3) + ctxt.setGlobal('g', 1) + + c = ctxt.vars +- self.assert_( c['v1'] == 3, 'Inner scope') +- self.assert_( c['v2'] == 2, 'Outer scope') +- self.assert_( c['g'] == 1, 'Global') ++ self.assertTrue( c['v1'] == 3, 'Inner scope') ++ self.assertTrue( c['v2'] == 2, 'Outer scope') ++ self.assertTrue( c['g'] == 1, 'Global') + + ctxt.endScope() + + c = ctxt.vars +- self.assert_( c['v1'] == 1, "Uncovered local") +- self.assert_( c['g'] == 1, "Global from inner scope") ++ self.assertTrue( c['v1'] == 1, "Uncovered local") ++ self.assertTrue( c['g'] == 1, "Global from inner scope") + + ctxt.endScope() + +@@ -142,7 +142,7 @@ class Harness(object): + self._callstack.append((name, args, kwargs)) + + def _complete_(self): +- self._testcase.assert_(len(self._callstack) == 0, ++ self._testcase.assertTrue(len(self._callstack) == 0, + "Harness methods called") + + def __getattr__(self, name): +@@ -159,19 +159,19 @@ class HarnessMethod(object): + self = self._harness + + cs = self._callstack +- self._testcase.assert_( ++ self._testcase.assertTrue( + len(cs), + 'Unexpected harness method call "%s".' % name + ) +- self._testcase.assert_( ++ self._testcase.assertTrue( + cs[0][0] == name, + 'Harness method name "%s" called, "%s" expected.' % + (name, cs[0][0]) + ) + + name, aargs, akwargs = self._callstack.pop(0) +- self._testcase.assert_(aargs == args, "Harness method arguments") +- self._testcase.assert_(akwargs == kwargs, ++ self._testcase.assertTrue(aargs == args, "Harness method arguments") ++ self._testcase.assertTrue(akwargs == kwargs, + "Harness method keyword args") + + +--- src/zope/tales/tests/test_traverser.py.orig 2012-05-23 15:44:50 UTC ++++ src/zope/tales/tests/test_traverser.py +@@ -17,7 +17,7 @@ class ItemTraversable(object): + def __getitem__(self, name): + if name == 'attr': + return 'foo' +- raise KeyError, name ++ raise KeyError(name) + + class AllTraversable(AttrTraversable, ItemTraversable): + """Traversable by attribute and item access""" +@@ -33,7 +33,7 @@ def getitem(ob, name, default=_marker): + except KeyError: + if default is not _marker: + return default +- raise KeyError, name ++ raise KeyError(name) + else: + return item +