public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/, dev-python/cython/files/
Date: Sun, 14 Jun 2020 09:31:54 +0000 (UTC)	[thread overview]
Message-ID: <1592127110.14b141814617fb383f7caa03399ffef34dc0945d.mgorny@gentoo> (raw)

commit:     14b141814617fb383f7caa03399ffef34dc0945d
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jun 14 09:17:19 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jun 14 09:31:50 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14b14181

dev-python/cython: Backport py3.9 classmethod fix

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ...hon-0.29.20.ebuild => cython-0.29.20-r1.ebuild} |  1 +
 .../files/cython-0.29.20-py39-classmeth.patch      | 59 ++++++++++++++++++++++
 2 files changed, 60 insertions(+)

diff --git a/dev-python/cython/cython-0.29.20.ebuild b/dev-python/cython/cython-0.29.20-r1.ebuild
similarity index 98%
rename from dev-python/cython/cython-0.29.20.ebuild
rename to dev-python/cython/cython-0.29.20-r1.ebuild
index 8b4b6e7acc6..c1f45f653d2 100644
--- a/dev-python/cython/cython-0.29.20.ebuild
+++ b/dev-python/cython/cython-0.29.20-r1.ebuild
@@ -31,6 +31,7 @@ BDEPEND="${RDEPEND}
 
 PATCHES=(
 	"${FILESDIR}/cython-0.29.14-sphinx-update.patch"
+	"${FILESDIR}"/${P}-py39-classmeth.patch
 )
 
 SITEFILE=50cython-gentoo.el

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
new file mode 100644
index 00000000000..e82982472e8
--- /dev/null
+++ b/dev-python/cython/files/cython-0.29.20-py39-classmeth.patch
@@ -0,0 +1,59 @@
+From 1bb26b964060392ecb08c3b6c8ca4626e5c1eec7 Mon Sep 17 00:00:00 2001
+From: Jeroen Demeyer <jeroen.k.demeyer@gmail.com>
+Date: Wed, 28 Aug 2019 10:56:28 +0200
+Subject: [PATCH] Always bind Cython functions
+
+---
+ Cython/Utility/CythonFunction.c | 15 ---------------
+ tests/run/cyfunction.pyx        | 12 ++++++++++++
+ 2 files changed, 12 insertions(+), 15 deletions(-)
+
+diff --git a/Cython/Utility/CythonFunction.c b/Cython/Utility/CythonFunction.c
+index 01ff1e0dd4..0758548cb3 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,
+ 
+ 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);
+ }
+ 
+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
+ 
+ 
++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()


             reply	other threads:[~2020-06-14  9:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-14  9:31 Michał Górny [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-03-10 17:10 [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/, dev-python/cython/files/ Michał Górny
2024-02-27 19:29 Michał Górny
2023-06-04 14:03 Michał Górny
2022-01-08 16:56 Michał Górny
2021-10-02 23:20 Sam James
2021-05-15  0:36 Marek Szuba
2017-05-12 18:49 Mike Gilbert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1592127110.14b141814617fb383f7caa03399ffef34dc0945d.mgorny@gentoo \
    --to=mgorny@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox