dev-python/cython: Sync with Gentoo

It's from Gentoo commit c9654848d46683c21061df5b2e61b6732f21fc12.
This commit is contained in:
Flatcar Buildbot 2025-04-28 07:13:38 +00:00
parent 09eb976684
commit f7222de11a
5 changed files with 55 additions and 87 deletions

View File

@ -1,3 +1,2 @@
DIST cython-3.0.12.gh.tar.gz 2777066 BLAKE2B 3e2730b7b0ef90ba6a7d4a510dbaa24b7c966d68c397196727b6d63b435c6775aa818a7d1b741819a7940ad44cadbc83be4aa48117b2dcf7bd844f4c9bc268bc SHA512 bbf2cc662b846cf5ff9b686046ec210ea9d3893482e2b5a2696d2ad44f12facd15075b168a3eb6d1f4ea799786f676868eab2593451bceb2937aec2cb1aea99e
DIST cython-3.0.12.tar.gz 2757617 BLAKE2B 064549e36e03424065eab081b60e2761d198490cfd4d7836ea236b833ada3962e6ed42ba1710b33418f8a31ac282cdc156ceb544ee21be80ee34b7a3d3f6c7fb SHA512 c4e85596eeea444fae983d32ce8731cc5d0d612d1f96b998db3aa7946e8be151a7ea62c6df163d875111e306c870656b82a8468dd873cacf84c7bd5671a39bc3 DIST cython-3.0.12.tar.gz 2757617 BLAKE2B 064549e36e03424065eab081b60e2761d198490cfd4d7836ea236b833ada3962e6ed42ba1710b33418f8a31ac282cdc156ceb544ee21be80ee34b7a3d3f6c7fb SHA512 c4e85596eeea444fae983d32ce8731cc5d0d612d1f96b998db3aa7946e8be151a7ea62c6df163d875111e306c870656b82a8468dd873cacf84c7bd5671a39bc3
DIST cython-3.1.0b1.tar.gz 3192916 BLAKE2B 13a8fa48319d9c4c8cc634d3cf5af599b867466d5de4cf3a24dd342b7812a392e854d9a6152309c6ef84a2925ebfa2257792d0f4e0c8fa36580d7138a663105a SHA512 ced9d57536d3bacd274b5edc4137d400a6182b4b7a89a28cf358f843dcbb0e0e7171fb0842441a81e1d2ac12acb6fd6a3df7018fe2a8708cb188a96cb184d799 DIST cython-3.1.0b1.tar.gz 3192916 BLAKE2B 13a8fa48319d9c4c8cc634d3cf5af599b867466d5de4cf3a24dd342b7812a392e854d9a6152309c6ef84a2925ebfa2257792d0f4e0c8fa36580d7138a663105a SHA512 ced9d57536d3bacd274b5edc4137d400a6182b4b7a89a28cf358f843dcbb0e0e7171fb0842441a81e1d2ac12acb6fd6a3df7018fe2a8708cb188a96cb184d799

View File

@ -20,7 +20,7 @@ HOMEPAGE="
LICENSE="Apache-2.0" LICENSE="Apache-2.0"
SLOT="0" SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" KEYWORDS="~alpha amd64 arm arm64 hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="test" IUSE="test"
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"
@ -44,6 +44,13 @@ distutils_enable_sphinx docs \
dev-python/sphinx-issues \ dev-python/sphinx-issues \
dev-python/sphinx-tabs dev-python/sphinx-tabs
python_prepare_all() {
# Needs dev-python/pip and doesn't like 'externally-managed' (bug #927995)
rm tests/run/coverage_cmd_src_pkg_layout.srctree || die
distutils-r1_python_prepare_all
}
python_compile() { python_compile() {
# Python gets confused when it is in sys.path before build. # Python gets confused when it is in sys.path before build.
local -x PYTHONPATH= local -x PYTHONPATH=

View File

@ -1,84 +0,0 @@
# Copyright 1999-2025 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..12} )
PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" pypy3 pypy3_11 python3_13 )
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 ~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-2[${PYTHON_USEDEP}]
' "${PYTHON_TESTED[@]}")
)
"
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"
)
distutils_enable_sphinx docs \
dev-python/jinja2 \
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
}

View File

@ -6,7 +6,7 @@ EAPI=8
DISTUTILS_EXT=1 DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=setuptools DISTUTILS_USE_PEP517=setuptools
PYTHON_TESTED=( python3_{10..12} ) PYTHON_TESTED=( python3_{10..12} )
PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" pypy3 pypy3_11 python3_13 ) PYTHON_COMPAT=( "${PYTHON_TESTED[@]}" pypy3 pypy3_11 python3_13{,t} )
PYTHON_REQ_USE="threads(+)" PYTHON_REQ_USE="threads(+)"
inherit distutils-r1 multiprocessing pypi toolchain-funcs inherit distutils-r1 multiprocessing pypi toolchain-funcs
@ -20,6 +20,7 @@ HOMEPAGE="
LICENSE="Apache-2.0" LICENSE="Apache-2.0"
SLOT="0" SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="test" IUSE="test"
RESTRICT="!test? ( test )" RESTRICT="!test? ( test )"
@ -35,6 +36,8 @@ BDEPEND="
PATCHES=( PATCHES=(
"${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch" "${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch"
"${FILESDIR}/${PN}-0.29.23-pythran-parallel-install.patch" "${FILESDIR}/${PN}-0.29.23-pythran-parallel-install.patch"
# https://github.com/cython/cython/pull/6782
"${FILESDIR}/${P}-pypy3.patch"
) )
distutils_enable_sphinx docs \ distutils_enable_sphinx docs \
@ -42,6 +45,13 @@ distutils_enable_sphinx docs \
dev-python/sphinx-issues \ dev-python/sphinx-issues \
dev-python/sphinx-tabs dev-python/sphinx-tabs
python_prepare_all() {
# Needs dev-python/pip and doesn't like 'externally-managed' (bug #927995)
rm tests/run/coverage_cmd_src_pkg_layout.srctree || die
distutils-r1_python_prepare_all
}
python_compile() { python_compile() {
# Python gets confused when it is in sys.path before build. # Python gets confused when it is in sys.path before build.
local -x PYTHONPATH= local -x PYTHONPATH=

View File

@ -0,0 +1,36 @@
From c1e709dd260b7621f36737b585dac1fd45a7704c Mon Sep 17 00:00:00 2001
From: da-woods <dw-git@d-woods.co.uk>
Date: Sun, 6 Apr 2025 08:43:34 +0100
Subject: [PATCH] Fix __Pyx_Owned_Py_None usage as actual function (GH-6782)
In the tracing code, we are using it like a function (i.e. casting to void to mark it unused) so it has to be a function, not just a macro.
Fixes https://github.com/cython/cython/issues/6781
---
Cython/Utility/TypeConversion.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c
index b86125699c7..e085fae8eb3 100644
--- a/Cython/Utility/TypeConversion.c
+++ b/Cython/Utility/TypeConversion.c
@@ -103,7 +103,7 @@ static CYTHON_INLINE PyObject *__Pyx_XNewRef(PyObject *obj) {
#endif
}
-#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b);
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
@@ -420,6 +420,10 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
}
}
+static CYTHON_INLINE PyObject *__Pyx_Owned_Py_None(int b) {
+ CYTHON_UNUSED_VAR(b);
+ return __Pyx_NewRef(Py_None);
+}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);