From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 45FD11382C5 for ; Mon, 15 Jun 2020 13:20:35 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id E2CB2E08A8; Mon, 15 Jun 2020 13:20:31 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id A9E77E08A8 for ; Mon, 15 Jun 2020 13:20:31 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 79CA434ED5E for ; Mon, 15 Jun 2020 13:20:07 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 2559FD3 for ; Mon, 15 Jun 2020 13:20:03 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1592227048.3e1e36e8d5a944cfc98584c8353da76f80a69bbd.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/cython/cython-0.29.20-r1.ebuild dev-python/cython/cython-0.29.20-r2.ebuild dev-python/cython/files/cython-0.29.20-py39-classmeth.patch X-VCS-Directories: dev-python/cython/files/ dev-python/cython/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 3e1e36e8d5a944cfc98584c8353da76f80a69bbd X-VCS-Branch: master Date: Mon, 15 Jun 2020 13:20:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 69ec9b92-f3c7-4bec-8560-1a78f0daaf05 X-Archives-Hash: 9adf1370b1731bc841bb049520517927 commit: 3e1e36e8d5a944cfc98584c8353da76f80a69bbd Author: Michał Górny gentoo org> AuthorDate: Mon Jun 15 11:03:57 2020 +0000 Commit: Michał Górny gentoo org> CommitDate: Mon Jun 15 13:17:28 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e1e36e8 dev-python/cython: Improve py39 patch to avoid breaking py27 Signed-off-by: Michał Górny gentoo.org> ...-0.29.20-r1.ebuild => cython-0.29.20-r2.ebuild} | 0 .../files/cython-0.29.20-py39-classmeth.patch | 69 +++++++--------------- 2 files changed, 22 insertions(+), 47 deletions(-) diff --git a/dev-python/cython/cython-0.29.20-r1.ebuild b/dev-python/cython/cython-0.29.20-r2.ebuild similarity index 100% rename from dev-python/cython/cython-0.29.20-r1.ebuild rename to dev-python/cython/cython-0.29.20-r2.ebuild diff --git a/dev-python/cython/files/cython-0.29.20-py39-classmeth.patch b/dev-python/cython/files/cython-0.29.20-py39-classmeth.patch index e82982472e8..914269a5a23 100644 --- a/dev-python/cython/files/cython-0.29.20-py39-classmeth.patch +++ b/dev-python/cython/files/cython-0.29.20-py39-classmeth.patch @@ -1,59 +1,34 @@ -From 1bb26b964060392ecb08c3b6c8ca4626e5c1eec7 Mon Sep 17 00:00:00 2001 -From: Jeroen Demeyer -Date: Wed, 28 Aug 2019 10:56:28 +0200 -Subject: [PATCH] Always bind Cython functions +From c29a7818d3b6806a457af698aec446d3d28d4f80 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Sun, 14 Jun 2020 13:45:21 +0200 +Subject: [PATCH] Always bind Cython functions in py3 +Rebased for cython 0.29.x, and made conditional to Python 3. This +does not solve the original staticmethod problem in Python 2 but it does +resolve classmethod problems in Python 3.9. Therefore, it unbreaks +other packages on Python 3.9, improves overall state for Python 3 +and does not introduce regressions in Python 2. --- - Cython/Utility/CythonFunction.c | 15 --------------- - tests/run/cyfunction.pyx | 12 ++++++++++++ - 2 files changed, 12 insertions(+), 15 deletions(-) + Cython/Utility/CythonFunction.c | 2 ++ + 1 file changed, 2 insertions(+) diff --git a/Cython/Utility/CythonFunction.c b/Cython/Utility/CythonFunction.c -index 01ff1e0dd4..0758548cb3 100644 +index a65c8eee36..33d0a4750a 100644 --- a/Cython/Utility/CythonFunction.c +++ b/Cython/Utility/CythonFunction.c -@@ -552,21 +552,6 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, +@@ -548,6 +548,7 @@ static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) { -- __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; -- -- if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { -- Py_INCREF(func); -- return func; -- } -- -- if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { -- if (type == NULL) -- type = (PyObject *)(Py_TYPE(obj)); -- return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type))); -- } -- -- if (obj == Py_None) -- obj = NULL; - return __Pyx_PyMethod_New(func, obj, type); - } ++#if PY_MAJOR_VERSION < 3 + __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; -diff --git a/tests/run/cyfunction.pyx b/tests/run/cyfunction.pyx -index cbce48bcfc..bbd2cefb83 100644 ---- a/tests/run/cyfunction.pyx -+++ b/tests/run/cyfunction.pyx -@@ -376,6 +376,18 @@ class TestUnboundMethod: - def meth(self): pass + if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { +@@ -563,6 +564,7 @@ static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObj + if (obj == Py_None) + obj = NULL; ++#endif + return __Pyx_PyMethod_New(func, obj, type); + } -+class TestStaticmethod(object): -+ """ -+ >>> x = TestStaticmethod() -+ >>> x.staticmeth(42) -+ 42 -+ >>> x.staticmeth.__get__(42)() -+ 42 -+ """ -+ @staticmethod -+ def staticmeth(arg): return arg -+ -+ - cdef class TestOptimisedBuiltinMethod: - """ - >>> obj = TestOptimisedBuiltinMethod()