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.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 64A1D158089 for ; Tue, 12 Sep 2023 07:06:01 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id A2B4E2BC053; Tue, 12 Sep 2023 07:06:00 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 82E9C2BC053 for ; Tue, 12 Sep 2023 07:06:00 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 75AE4335CAF for ; Tue, 12 Sep 2023 07:05:59 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B86E3F35 for ; Tue, 12 Sep 2023 07:05:57 +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: <1694502353.2396c57d44d635032ef1092286baef54c92d10d9.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-3.0.2-r1.ebuild dev-python/cython/files/cython-3.0.2-enummeta.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: 2396c57d44d635032ef1092286baef54c92d10d9 X-VCS-Branch: master Date: Tue, 12 Sep 2023 07:05:57 +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: 9a656f43-b5ce-4b18-825a-22da8923b880 X-Archives-Hash: 79c9108ae6bd372ef8399304431d7244 commit: 2396c57d44d635032ef1092286baef54c92d10d9 Author: Michał Górny gentoo org> AuthorDate: Tue Sep 12 07:05:24 2023 +0000 Commit: Michał Górny gentoo org> CommitDate: Tue Sep 12 07:05:53 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2396c57d dev-python/cython: Backport fix for `metaclass=EnumMeta` Signed-off-by: Michał Górny gentoo.org> dev-python/cython/cython-3.0.2-r1.ebuild | 86 ++++++++++++++++++++++ .../cython/files/cython-3.0.2-enummeta.patch | 69 +++++++++++++++++ 2 files changed, 155 insertions(+) diff --git a/dev-python/cython/cython-3.0.2-r1.ebuild b/dev-python/cython/cython-3.0.2-r1.ebuild new file mode 100644 index 000000000000..444c115bf846 --- /dev/null +++ b/dev-python/cython/cython-3.0.2-r1.ebuild @@ -0,0 +1,86 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_TESTED=( python3_{10..11} ) +PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" python3_12 pypy3 ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 multiprocessing toolchain-funcs + +MY_P=${P/_rc/rc} +DESCRIPTION="A Python to C compiler" +HOMEPAGE=" + https://cython.org/ + https://github.com/cython/cython/ + https://pypi.org/project/Cython/ +" +SRC_URI=" + https://github.com/cython/cython/archive/${PV/_rc/rc}.tar.gz + -> ${MY_P}.gh.tar.gz +" +S=${WORKDIR}/${MY_P} + +LICENSE="Apache-2.0" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" +IUSE="test" +RESTRICT="!test? ( test )" + +BDEPEND=" + ${RDEPEND} + test? ( + $(python_gen_cond_dep ' + dev-python/numpy[${PYTHON_USEDEP}] + ' python3_{10..11}) + ) +" + +PATCHES=( + "${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch" + "${FILESDIR}/${PN}-0.29.23-test_exceptions-py310.patch" + "${FILESDIR}/${PN}-0.29.23-pythran-parallel-install.patch" + # https://github.com/cython/cython/pull/5675 + "${FILESDIR}/${P}-enummeta.patch" +) + +distutils_enable_sphinx docs \ + dev-python/jinja \ + dev-python/sphinx-issues \ + dev-python/sphinx-tabs + +python_compile() { + # Python gets confused when it is in sys.path before build. + local -x PYTHONPATH= + + distutils-r1_python_compile +} + +python_test() { + if ! has "${EPYTHON/./_}" "${PYTHON_TESTED[@]}"; then + einfo "Skipping tests on ${EPYTHON} (xfail)" + return + fi + + # Needed to avoid confusing cache tests + unset CYTHON_FORCE_REGEN + + tc-export CC + # https://github.com/cython/cython/issues/1911 + local -x CFLAGS="${CFLAGS} -fno-strict-overflow" + "${PYTHON}" runtests.py \ + -vv \ + -j "$(makeopts_jobs)" \ + --work-dir "${BUILD_DIR}"/tests \ + --no-examples \ + --no-code-style \ + || die "Tests fail with ${EPYTHON}" +} + +python_install_all() { + local DOCS=( CHANGES.rst README.rst ToDo.txt USAGE.txt ) + distutils-r1_python_install_all +} diff --git a/dev-python/cython/files/cython-3.0.2-enummeta.patch b/dev-python/cython/files/cython-3.0.2-enummeta.patch new file mode 100644 index 000000000000..284af4ac6c16 --- /dev/null +++ b/dev-python/cython/files/cython-3.0.2-enummeta.patch @@ -0,0 +1,69 @@ +From 81cc077ad035947a3429c245f1e28c8b43c6dcc6 Mon Sep 17 00:00:00 2001 +From: da-woods +Date: Sat, 2 Sep 2023 10:32:59 +0100 +Subject: [PATCH] Fix invalid fastcall dict when keywords are passed + +Fixes #5665 + +I'm slightly surprised this hasn't caused more bugs. We're passing +a dict where we should be passing a tuple of names. + +Replacement should hopefully be right, but I don't know how +optimized or otherwise it is. +--- + Cython/Utility/ObjectHandling.c | 36 +++++++++++++++++++-------------- + 1 file changed, 21 insertions(+), 15 deletions(-) + +diff --git a/Cython/Utility/ObjectHandling.c b/Cython/Utility/ObjectHandling.c +index 8ea5be42935..507fb94f605 100644 +--- a/Cython/Utility/ObjectHandling.c ++++ b/Cython/Utility/ObjectHandling.c +@@ -2328,27 +2328,33 @@ static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObj + #endif + #endif + +- #if CYTHON_VECTORCALL +- #if Py_VERSION_HEX < 0x03090000 +- vectorcallfunc f = _PyVectorcall_Function(func); +- #else +- vectorcallfunc f = PyVectorcall_Function(func); +- #endif +- if (f) { +- return f(func, args, (size_t)nargs, kwargs); +- } +- #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL +- // exclude fused functions for now +- if (__Pyx_CyFunction_CheckExact(func)) { +- __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); +- if (f) return f(func, args, (size_t)nargs, kwargs); ++ if (kwargs == NULL) { ++ #if CYTHON_VECTORCALL ++ #if Py_VERSION_HEX < 0x03090000 ++ vectorcallfunc f = _PyVectorcall_Function(func); ++ #else ++ vectorcallfunc f = PyVectorcall_Function(func); ++ #endif ++ if (f) { ++ return f(func, args, (size_t)nargs, NULL); ++ } ++ #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL ++ // exclude fused functions for now ++ if (__Pyx_CyFunction_CheckExact(func)) { ++ __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func); ++ if (f) return f(func, args, (size_t)nargs, NULL); ++ } ++ #endif + } +- #endif + + if (nargs == 0) { + return __Pyx_PyObject_Call(func, $empty_tuple, kwargs); + } ++ #if PY_VERSION_HEX >= 0x03090000 && !CYTHON_COMPILING_IN_LIMITED_API ++ return PyObject_VectorcallDict(func, args, nargs, kwargs); ++ #else + return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs); ++ #endif + } + +