public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2016-03-24 11:16 Ian Delaney
  0 siblings, 0 replies; 14+ messages in thread
From: Ian Delaney @ 2016-03-24 11:16 UTC (permalink / raw
  To: gentoo-commits

commit:     4e9cb7c9731b742e28e4c4dd788b099544df4f60
Author:     Pallav Agarwal <pallavagarwal07 <AT> gmail <DOT> com>
AuthorDate: Thu Mar 24 04:33:32 2016 +0000
Commit:     Ian Delaney <idella4 <AT> gentoo <DOT> org>
CommitDate: Thu Mar 24 11:16:00 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4e9cb7c9

dev-python/cython: revbump -> vn. 0.23.4-r1

add emacs USE flag for installing cython-mode
Ackd-by: idella4 <AT> gentoo.org
Closes: https://github.com/gentoo/gentoo/pull/1119

 dev-python/cython/cython-0.23.4-r1.ebuild  | 82 ++++++++++++++++++++++++++++++
 dev-python/cython/files/50cython-gentoo.el | 11 ++++
 2 files changed, 93 insertions(+)

diff --git a/dev-python/cython/cython-0.23.4-r1.ebuild b/dev-python/cython/cython-0.23.4-r1.ebuild
new file mode 100644
index 0000000..7bf82a9
--- /dev/null
+++ b/dev-python/cython/cython-0.23.4-r1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=5
+
+PYTHON_COMPAT=( python2_7 python3_{3,4,5} )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 flag-o-matic toolchain-funcs elisp-common
+
+MY_PN="Cython"
+MY_P="${MY_PN}-${PV/_/}"
+
+DESCRIPTION="A Python to C compiler"
+HOMEPAGE="http://www.cython.org/ https://pypi.python.org/pypi/Cython"
+SRC_URI="http://www.cython.org/release/${MY_P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+
+IUSE="doc examples emacs test"
+
+RDEPEND="
+	emacs? ( virtual/emacs )
+"
+# On testing, setuptools invokes an error in running the testsuite cited in a number of recent bugs
+# spanning several packages. This bug has been fixed in the recent release of version 9.1
+DEPEND="${RDEPEND}
+	>=dev-python/setuptools-9.1[${PYTHON_USEDEP}]
+	doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
+	test? ( dev-python/numpy[${PYTHON_USEDEP}] )"
+
+SITEFILE=50cython-gentoo.el
+S="${WORKDIR}/${MY_PN}-${PV%_*}"
+
+python_compile() {
+	if ! python_is_python3; then
+		local CFLAGS="${CFLAGS}"
+		local CXXFLAGS="${CXXFLAGS}"
+		append-flags -fno-strict-aliasing
+	fi
+
+	# Python gets confused when it is in sys.path before build.
+	local PYTHONPATH=
+	export PYTHONPATH
+
+	distutils-r1_python_compile
+}
+
+python_compile_all() {
+	use emacs && elisp-compile Tools/cython-mode.el
+
+	use doc && unset XDG_CONFIG_HOME && emake -C docs html
+}
+
+python_test() {
+	tc-export CC
+	"${PYTHON}" runtests.py -vv --work-dir "${BUILD_DIR}"/tests \
+		|| die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+	local DOCS=( CHANGES.rst README.txt ToDo.txt USAGE.txt )
+	use doc && local HTML_DOCS=( docs/build/html/. )
+	use examples && local EXAMPLES=( Demos/. )
+	distutils-r1_python_install_all
+
+	if use emacs; then
+		elisp-install ${PN} Tools/cython-mode.*
+		elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+	fi
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}

diff --git a/dev-python/cython/files/50cython-gentoo.el b/dev-python/cython/files/50cython-gentoo.el
new file mode 100644
index 0000000..e6dcc6a
--- /dev/null
+++ b/dev-python/cython/files/50cython-gentoo.el
@@ -0,0 +1,11 @@
+;;; site-lisp configuration for cython-mode
+
+(add-to-list 'load-path "@SITELISP@")
+
+(autoload  'cython-mode "cython-mode" "Major mode for editing Cython files" t)
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.pyx\\'" . cython-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.pxd\\'" . cython-mode))
+;;;###autoload
+(add-to-list 'auto-mode-alist '("\\.pxi\\'" . cython-mode))


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2019-07-04  3:27 Tim Harder
  0 siblings, 0 replies; 14+ messages in thread
From: Tim Harder @ 2019-07-04  3:27 UTC (permalink / raw
  To: gentoo-commits

commit:     14360383a32aea9855973cbb509bb7a31eedfaf8
Author:     Tim Harder <radhermit <AT> gentoo <DOT> org>
AuthorDate: Thu Jul  4 03:18:50 2019 +0000
Commit:     Tim Harder <radhermit <AT> gentoo <DOT> org>
CommitDate: Thu Jul  4 03:26:46 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14360383

dev-python/cython: remove old

Signed-off-by: Tim Harder <radhermit <AT> gentoo.org>

 dev-python/cython/Manifest                         |  3 -
 dev-python/cython/cython-0.25.2.ebuild             | 84 ---------------------
 dev-python/cython/cython-0.26.1.ebuild             | 80 --------------------
 dev-python/cython/cython-0.28.4.ebuild             | 86 ----------------------
 .../files/0.25.2-test-cpdef_enums-L-suffix.patch   | 19 -----
 5 files changed, 272 deletions(-)

diff --git a/dev-python/cython/Manifest b/dev-python/cython/Manifest
index 8b535526560..c2db85b6dcf 100644
--- a/dev-python/cython/Manifest
+++ b/dev-python/cython/Manifest
@@ -1,6 +1,3 @@
-DIST Cython-0.25.2.tar.gz 1703315 BLAKE2B e458604d0843afa128c6019244220bd6b3dd6653013698aa67ee2f71555f09813a8136ef92d6dc51ca38fe085e7bedc5e01d1a32bbd0885e62bd91c2e482bebd SHA512 1974b9374aeedb030307dc95aa6560ce9d5e1652783cd4552e96ef11663c73dd263e3521b68e7712abbb31628011e2e66320c5ee2577968684e2679eb80726e1
-DIST Cython-0.26.1.tar.gz 1725133 BLAKE2B b2c0433e8154ad76d921677608cae42a793326015ff320d8cd61818e5eb5fb4daf73ad4e72760d84f4cdaa2386b87d719cf9cd41584b781d4e2021e377a58422 SHA512 cdf31afaba78209c37a224345471c5c822b78c6d26c51583c46669b6b2b57b4952b33a839a51d06c3330fdff889345ac611fbaa2b2f17498cb02f3b5675f7948
-DIST Cython-0.28.4.tar.gz 1880943 BLAKE2B a97314147294c95fa0bd6d3fa1a1315d81f8abb46a1f2196009c1ef6f0dd7f47f81a7b31ab81d1fd00e8de37878a18a22d225055181ee74ffe4cc8105d84cd75 SHA512 67d2da2d776fc02193cfe98c8942e93905ec5e30bf4e0f9d5c965d930a034936d4c29c8248fccefff5db6d4dee054ec854994bea63fa3f64ff65df7550997c29
 DIST Cython-0.29.10.tar.gz 2049468 BLAKE2B 1cfae1c5e2d7277d3ac25ab0ff5a7b4346242e6c01d0b7945491f4fb64e0c9b98c593efa41b790aa0437ae72275a0ba3b6fe8614c7efaadc6139823f0e453d71 SHA512 df8430bb89816df84abfc6d59bee8e50f4117e8e82b9c82a889afca390a42a1569a9b5dcde76f40e7c29d728489af34c6fe0cf359912f7b74ac0d014af2171c3
 DIST Cython-0.29.11.tar.gz 2050170 BLAKE2B 47ce8b73371b8f4537e4ad7645dfaccdca207573eba68fa7e5da079db5b739b8cede57a55a19b2bfb28aaf30f8d5b5c9eb8492fdfcc07f533f4e9af036a315ad SHA512 d683cd006afb9778c9c2d755646623977d29d05675be8bc85f711d4a0cadcd5bd7ed623a2a2bc2067898b0d5b99819f2047b91345ecd5e4f0828eea6f62ec83c
 DIST Cython-0.29.4.tar.gz 2044382 BLAKE2B b36d27706a3270805f66190a4cf2735eaf20b1b932365b324a433c0e58e63e860ce1500333233c3539ae697886ac0adc361a2c158d5d064a3ea05843debc3f26 SHA512 8f115e36975aaf64eda4df8b0a85378d0c80b3292dbd162be826b939def03bdc9f3eb937676e2367003c2944b570d97f50d7880becfdb2fdc5144077b4a722dc

diff --git a/dev-python/cython/cython-0.25.2.ebuild b/dev-python/cython/cython-0.25.2.ebuild
deleted file mode 100644
index c94da77b78b..00000000000
--- a/dev-python/cython/cython-0.25.2.ebuild
+++ /dev/null
@@ -1,84 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 python3_{5,6} )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 flag-o-matic toolchain-funcs elisp-common
-
-MY_PN="Cython"
-MY_P="${MY_PN}-${PV/_/}"
-
-DESCRIPTION="A Python to C compiler"
-HOMEPAGE="https://cython.org https://pypi.org/project/Cython/"
-SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~mips ppc ppc64 s390 ~sh sparc x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
-
-IUSE="doc emacs test"
-
-RDEPEND="
-	emacs? ( virtual/emacs )
-"
-# On testing, setuptools invokes an error in running the testsuite cited in a number of recent bugs
-# spanning several packages. This bug has been fixed in the recent release of version 9.1
-DEPEND="${RDEPEND}
-	>=dev-python/setuptools-9.1[${PYTHON_USEDEP}]
-	doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
-	test? ( dev-python/numpy[${PYTHON_USEDEP}] )"
-
-SITEFILE=50cython-gentoo.el
-S="${WORKDIR}/${MY_PN}-${PV%_*}"
-
-PATCHES=(
-	"${FILESDIR}"/0.25.2-test-cpdef_enums-L-suffix.patch
-)
-
-python_compile() {
-	if ! python_is_python3; then
-		local CFLAGS="${CFLAGS}"
-		local CXXFLAGS="${CXXFLAGS}"
-		append-flags -fno-strict-aliasing
-	fi
-
-	# Python gets confused when it is in sys.path before build.
-	local PYTHONPATH=
-	export PYTHONPATH
-
-	distutils-r1_python_compile
-}
-
-python_compile_all() {
-	use emacs && elisp-compile Tools/cython-mode.el
-
-	use doc && unset XDG_CONFIG_HOME && emake -C docs html
-}
-
-python_test() {
-	tc-export CC
-	"${PYTHON}" runtests.py -vv --work-dir "${BUILD_DIR}"/tests \
-		|| die "Tests fail with ${EPYTHON}"
-}
-
-python_install_all() {
-	local DOCS=( CHANGES.rst README.txt ToDo.txt USAGE.txt )
-	use doc && local HTML_DOCS=( docs/build/html/. )
-	distutils-r1_python_install_all
-
-	if use emacs; then
-		elisp-install ${PN} Tools/cython-mode.*
-		elisp-site-file-install "${FILESDIR}/${SITEFILE}"
-	fi
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/dev-python/cython/cython-0.26.1.ebuild b/dev-python/cython/cython-0.26.1.ebuild
deleted file mode 100644
index ea74ee77736..00000000000
--- a/dev-python/cython/cython-0.26.1.ebuild
+++ /dev/null
@@ -1,80 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 python3_{5,6} )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 flag-o-matic toolchain-funcs elisp-common
-
-MY_PN="Cython"
-MY_P="${MY_PN}-${PV/_/}"
-
-DESCRIPTION="A Python to C compiler"
-HOMEPAGE="https://cython.org https://pypi.org/project/Cython/"
-SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
-
-IUSE="doc emacs test"
-
-RDEPEND="
-	emacs? ( virtual/emacs )
-"
-# On testing, setuptools invokes an error in running the testsuite cited in a number of recent bugs
-# spanning several packages. This bug has been fixed in the recent release of version 9.1
-DEPEND="${RDEPEND}
-	>=dev-python/setuptools-9.1[${PYTHON_USEDEP}]
-	doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
-	test? ( dev-python/numpy[${PYTHON_USEDEP}] )"
-
-SITEFILE=50cython-gentoo.el
-S="${WORKDIR}/${MY_PN}-${PV%_*}"
-
-python_compile() {
-	if ! python_is_python3; then
-		local CFLAGS="${CFLAGS}"
-		local CXXFLAGS="${CXXFLAGS}"
-		append-flags -fno-strict-aliasing
-	fi
-
-	# Python gets confused when it is in sys.path before build.
-	local PYTHONPATH=
-	export PYTHONPATH
-
-	distutils-r1_python_compile
-}
-
-python_compile_all() {
-	use emacs && elisp-compile Tools/cython-mode.el
-
-	use doc && unset XDG_CONFIG_HOME && emake -C docs html
-}
-
-python_test() {
-	tc-export CC
-	"${PYTHON}" runtests.py -vv --work-dir "${BUILD_DIR}"/tests \
-		|| die "Tests fail with ${EPYTHON}"
-}
-
-python_install_all() {
-	local DOCS=( CHANGES.rst README.txt ToDo.txt USAGE.txt )
-	use doc && local HTML_DOCS=( docs/build/html/. )
-	distutils-r1_python_install_all
-
-	if use emacs; then
-		elisp-install ${PN} Tools/cython-mode.*
-		elisp-site-file-install "${FILESDIR}/${SITEFILE}"
-	fi
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/dev-python/cython/cython-0.28.4.ebuild b/dev-python/cython/cython-0.28.4.ebuild
deleted file mode 100644
index 9deca0e2318..00000000000
--- a/dev-python/cython/cython-0.28.4.ebuild
+++ /dev/null
@@ -1,86 +0,0 @@
-# Copyright 1999-2019 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python2_7 python3_{5,6,7} )
-PYTHON_REQ_USE="threads(+)"
-
-inherit distutils-r1 toolchain-funcs elisp-common
-
-MY_PN="Cython"
-MY_P="${MY_PN}-${PV/_/}"
-
-DESCRIPTION="A Python to C compiler"
-HOMEPAGE="https://cython.org https://pypi.org/project/Cython/"
-SRC_URI="mirror://pypi/${MY_PN:0:1}/${MY_PN}/${MY_P}.tar.gz"
-
-LICENSE="Apache-2.0"
-SLOT="0"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
-
-IUSE="doc emacs test"
-
-RDEPEND="
-	emacs? ( virtual/emacs )
-"
-DEPEND="${RDEPEND}
-	dev-python/setuptools[${PYTHON_USEDEP}]
-	doc? ( dev-python/sphinx[${PYTHON_USEDEP}] )
-	test? ( dev-python/numpy[${PYTHON_USEDEP}] )"
-
-SITEFILE=50cython-gentoo.el
-S="${WORKDIR}/${MY_PN}-${PV%_*}"
-
-python_prepare_all() {
-	# tests behavior that is illegal in Python 3.7+
-	# https://github.com/cython/cython/issues/2454
-	sed -i -e '/with_outer_raising/,/return/d' tests/run/generators_py.py || die
-
-	distutils-r1_python_prepare_all
-}
-
-python_compile() {
-	if ! python_is_python3; then
-		local CFLAGS="${CFLAGS} -fno-strict-aliasing"
-		local CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
-	fi
-
-	# Python gets confused when it is in sys.path before build.
-	local -x PYTHONPATH=
-
-	distutils-r1_python_compile
-}
-
-python_compile_all() {
-	use emacs && elisp-compile Tools/cython-mode.el
-
-	use doc && unset XDG_CONFIG_HOME && emake -C docs html
-}
-
-python_test() {
-	tc-export CC
-	# https://github.com/cython/cython/issues/1911
-	local -x CFLAGS="${CFLAGS} -fno-strict-overflow"
-	"${PYTHON}" runtests.py -vv --work-dir "${BUILD_DIR}"/tests \
-		|| die "Tests fail with ${EPYTHON}"
-}
-
-python_install_all() {
-	local DOCS=( CHANGES.rst README.rst ToDo.txt USAGE.txt )
-	use doc && local HTML_DOCS=( docs/build/html/. )
-	distutils-r1_python_install_all
-
-	if use emacs; then
-		elisp-install ${PN} Tools/cython-mode.*
-		elisp-site-file-install "${FILESDIR}/${SITEFILE}"
-	fi
-}
-
-pkg_postinst() {
-	use emacs && elisp-site-regen
-}
-
-pkg_postrm() {
-	use emacs && elisp-site-regen
-}

diff --git a/dev-python/cython/files/0.25.2-test-cpdef_enums-L-suffix.patch b/dev-python/cython/files/0.25.2-test-cpdef_enums-L-suffix.patch
deleted file mode 100644
index 3a8b9d9d1e7..00000000000
--- a/dev-python/cython/files/0.25.2-test-cpdef_enums-L-suffix.patch
+++ /dev/null
@@ -1,19 +0,0 @@
-From d92a718a26c9354fbf35f31a17de5c069865a447 Mon Sep 17 00:00:00 2001
-From: Robert Bradshaw <robertwb@gmail.com>
-Date: Tue, 24 Jan 2017 16:57:00 -0800
-Subject: [PATCH] Normalize possible L suffix.
-
----
- tests/run/cpdef_enums.pyx | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/tests/run/cpdef_enums.pyx b/tests/run/cpdef_enums.pyx
-index 167c762..c264ec5 100644
---- a/tests/run/cpdef_enums.pyx
-+++ b/tests/run/cpdef_enums.pyx
-@@ -93,4 +93,4 @@ def verify_resolution_GH1533():
-     3
-     """
-     THREE = 100
--    return PyxEnum.THREE
-+    return int(PyxEnum.THREE)


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2019-11-20  4:56 Patrick McLean
  0 siblings, 0 replies; 14+ messages in thread
From: Patrick McLean @ 2019-11-20  4:56 UTC (permalink / raw
  To: gentoo-commits

commit:     35abceb3417d25cafe5551627e35ceff9d1ce2bb
Author:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Wed Nov 20 04:55:41 2019 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed Nov 20 04:55:41 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35abceb3

dev-python/cython: Revbump, add python3_8, fix USE=doc

Package-Manager: Portage-2.3.79, Repoman-2.3.18
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 dev-python/cython/cython-0.29.14-r1.ebuild         | 82 ++++++++++++++++++++++
 .../files/cython-0.29.14-sphinx-update.patch       | 13 ++++
 2 files changed, 95 insertions(+)

diff --git a/dev-python/cython/cython-0.29.14-r1.ebuild b/dev-python/cython/cython-0.29.14-r1.ebuild
new file mode 100644
index 00000000000..e26e48b0f2d
--- /dev/null
+++ b/dev-python/cython/cython-0.29.14-r1.ebuild
@@ -0,0 +1,82 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} pypy{,3} )
+PYTHON_REQ_USE="threads(+)"
+
+inherit distutils-r1 toolchain-funcs elisp-common
+
+DESCRIPTION="A Python to C compiler"
+HOMEPAGE="https://cython.org https://pypi.org/project/Cython/
+	https://github.com/cython/cython"
+SRC_URI="https://github.com/cython/cython/archive/${PV}.tar.gz -> ${P}.gh.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~x64-solaris ~x86-solaris"
+IUSE="doc emacs test"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+	emacs? ( virtual/emacs )
+"
+BDEPEND="${RDEPEND}
+	dev-python/setuptools[${PYTHON_USEDEP}]
+	doc? ( $(python_gen_any_dep 'dev-python/sphinx[${PYTHON_USEDEP}]') )
+	test? (
+		$(python_gen_cond_dep 'dev-python/numpy[${PYTHON_USEDEP}]' \
+			'python3*')
+	)"
+
+PATCHES=(
+	"${FILESDIR}/cython-0.29.14-sphinx-update.patch"
+)
+
+SITEFILE=50cython-gentoo.el
+
+python_compile() {
+	if ! python_is_python3; then
+		local CFLAGS="${CFLAGS} -fno-strict-aliasing"
+		local CXXFLAGS="${CXXFLAGS} -fno-strict-aliasing"
+	fi
+
+	# Python gets confused when it is in sys.path before build.
+	local -x PYTHONPATH=
+
+	distutils-r1_python_compile
+}
+
+python_compile_all() {
+	use emacs && elisp-compile Tools/cython-mode.el
+
+	use doc && emake -C docs html
+}
+
+python_test() {
+	tc-export CC
+	# https://github.com/cython/cython/issues/1911
+	local -x CFLAGS="${CFLAGS} -fno-strict-overflow"
+	"${PYTHON}" runtests.py -vv --work-dir "${BUILD_DIR}"/tests \
+		|| die "Tests fail with ${EPYTHON}"
+}
+
+python_install_all() {
+	local DOCS=( CHANGES.rst README.rst ToDo.txt USAGE.txt )
+	use doc && local HTML_DOCS=( docs/build/html/. )
+	distutils-r1_python_install_all
+
+	if use emacs; then
+		elisp-install ${PN} Tools/cython-mode.*
+		elisp-site-file-install "${FILESDIR}/${SITEFILE}"
+	fi
+}
+
+pkg_postinst() {
+	use emacs && elisp-site-regen
+}
+
+pkg_postrm() {
+	use emacs && elisp-site-regen
+}

diff --git a/dev-python/cython/files/cython-0.29.14-sphinx-update.patch b/dev-python/cython/files/cython-0.29.14-sphinx-update.patch
new file mode 100644
index 00000000000..3f426754f6f
--- /dev/null
+++ b/dev-python/cython/files/cython-0.29.14-sphinx-update.patch
@@ -0,0 +1,13 @@
+diff --git a/docs/conf.py b/docs/conf.py
+index 10662e28c..a84e0b928 100644
+--- a/docs/conf.py
++++ b/docs/conf.py
+@@ -41,7 +41,7 @@ highlight_language = 'cython'
+ extensions = [
+     'ipython_console_highlighting',
+     'cython_highlighting',
+-    'sphinx.ext.pngmath',
++    'sphinx.ext.imgmath',
+     'sphinx.ext.todo',
+     'sphinx.ext.intersphinx',
+     'sphinx.ext.autodoc'


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2020-06-15 13:20 Michał Górny
  0 siblings, 0 replies; 14+ messages in thread
From: Michał Górny @ 2020-06-15 13:20 UTC (permalink / raw
  To: gentoo-commits

commit:     3e1e36e8d5a944cfc98584c8353da76f80a69bbd
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 15 11:03:57 2020 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> 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 <mgorny <AT> 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 <jeroen.k.demeyer@gmail.com>
-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?= <mgorny@gentoo.org>
+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()


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2020-12-10 19:41 Sam James
  0 siblings, 0 replies; 14+ messages in thread
From: Sam James @ 2020-12-10 19:41 UTC (permalink / raw
  To: gentoo-commits

commit:     706b09d472b952afaf73e32d29956af68567b272
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec 10 19:38:36 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec 10 19:41:04 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=706b09d4

dev-python/cython: fix usage on Darwin

macOS now defaults to the 'spawn' multiprocessing
method which Cython isn't written for.

Let's use a single thread if we're in the spawn case.

Package-Manager: Portage-3.0.12-prefix, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/cython/cython-0.29.21.ebuild            |  1 +
 .../cython-0.29.21-spawn-multiprocessing.patch     | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+)

diff --git a/dev-python/cython/cython-0.29.21.ebuild b/dev-python/cython/cython-0.29.21.ebuild
index e3ada54d8df..2a1a1e79155 100644
--- a/dev-python/cython/cython-0.29.21.ebuild
+++ b/dev-python/cython/cython-0.29.21.ebuild
@@ -31,6 +31,7 @@ BDEPEND="${RDEPEND}
 
 PATCHES=(
 	"${FILESDIR}/cython-0.29.14-sphinx-update.patch"
+	"${FILESDIR}/cython-0.29.21-spawn-multiprocessing.patch"
 )
 
 SITEFILE=50cython-gentoo.el

diff --git a/dev-python/cython/files/cython-0.29.21-spawn-multiprocessing.patch b/dev-python/cython/files/cython-0.29.21-spawn-multiprocessing.patch
new file mode 100644
index 00000000000..0aa7212b9a3
--- /dev/null
+++ b/dev-python/cython/files/cython-0.29.21-spawn-multiprocessing.patch
@@ -0,0 +1,29 @@
+Needed to prevent a loop while calling cythonize on macOS - or any platform
+defaulting to the 'spawn' method, as Python 3.8 does on Darwin.
+
+https://github.com/cython/cython/pull/3263
+From 15ae78bb74a856836dd64828326f4f0812d36520 Mon Sep 17 00:00:00 2001
+From: Marcel Bargull <marcel.bargull@udo.edu>
+Date: Fri, 6 Dec 2019 18:21:19 +0100
+Subject: [PATCH] Disable parallel cythonization for "spawn" start method.
+
+---
+ Cython/Build/Dependencies.py | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/Cython/Build/Dependencies.py b/Cython/Build/Dependencies.py
+index 593e00a6ef..f9b9c15bc5 100644
+--- a/Cython/Build/Dependencies.py
++++ b/Cython/Build/Dependencies.py
+@@ -1073,6 +1073,11 @@ def copy_to_build_dir(filepath, root=os.getcwd()):
+ 
+     if N <= 1:
+         nthreads = 0
++    if nthreads:
++        import multiprocessing
++        if multiprocessing.get_start_method() == 'spawn':
++            print('Disabling parallel cythonization for "spawn" process start method.')
++            nthreads = 0
+     if nthreads:
+         import multiprocessing
+         pool = multiprocessing.Pool(


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2021-03-06  3:24 Sam James
  0 siblings, 0 replies; 14+ messages in thread
From: Sam James @ 2021-03-06  3:24 UTC (permalink / raw
  To: gentoo-commits

commit:     aab61be85302ce6e1ce7233a1fda3843d8ff1be8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sat Mar  6 03:22:42 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sat Mar  6 03:22:59 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aab61be8

dev-python/cython: rebase multiprocessing Darwin patch for 0.29.22

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/cython/cython-0.29.22.ebuild            |  2 +-
 .../cython-0.29.22-spawn-multiprocessing.patch     | 27 ++++++++++++++++++++++
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/dev-python/cython/cython-0.29.22.ebuild b/dev-python/cython/cython-0.29.22.ebuild
index 2fdee5a7f17..d2fe1b9af4e 100644
--- a/dev-python/cython/cython-0.29.22.ebuild
+++ b/dev-python/cython/cython-0.29.22.ebuild
@@ -31,7 +31,7 @@ BDEPEND="${RDEPEND}
 
 PATCHES=(
 	"${FILESDIR}/${PN}-0.29.14-sphinx-update.patch"
-	"${FILESDIR}/${PN}-0.29.21-spawn-multiprocessing.patch"
+	"${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch"
 )
 
 SITEFILE=50cython-gentoo.el

diff --git a/dev-python/cython/files/cython-0.29.22-spawn-multiprocessing.patch b/dev-python/cython/files/cython-0.29.22-spawn-multiprocessing.patch
new file mode 100644
index 00000000000..15b6f968e4b
--- /dev/null
+++ b/dev-python/cython/files/cython-0.29.22-spawn-multiprocessing.patch
@@ -0,0 +1,27 @@
+Needed to prevent a loop while calling cythonize on macOS - or any platform
+defaulting to the 'spawn' method, as Python 3.8 does on Darwin.
+
+https://github.com/cython/cython/pull/3263
+
+[Rebased on 0.29.22]
+
+From 15ae78bb74a856836dd64828326f4f0812d36520 Mon Sep 17 00:00:00 2001
+From: Marcel Bargull <marcel.bargull@udo.edu>
+Date: Fri, 6 Dec 2019 18:21:19 +0100
+Subject: [PATCH] Disable parallel cythonization for "spawn" start method.
+
+---
+--- a/Cython/Build/Dependencies.py
++++ b/Cython/Build/Dependencies.py
+@@ -1071,6 +1071,11 @@ def cythonize(module_list, exclude=None, nthreads=0, aliases=None, quiet=False,
+
+     if N <= 1:
+         nthreads = 0
++    if nthreads:
++        import multiprocessing
++        if multiprocessing.get_start_method() == 'spawn':
++            print('Disabling parallel cythonization for "spawn" process start method.')
++            nthreads = 0
+     if nthreads:
+         # Requires multiprocessing (or Python >= 2.6)
+         try:


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2021-05-15  0:36 Marek Szuba
  0 siblings, 0 replies; 14+ messages in thread
From: Marek Szuba @ 2021-05-15  0:36 UTC (permalink / raw
  To: gentoo-commits

commit:     56e03cffa7bcb4b7b3043360e28e89cf308714e5
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Fri May 14 23:11:37 2021 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Sat May 15 00:36:31 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=56e03cff

dev-python/cython: backport tracing fix for python3_10 compatibility

Spotted it now that I am able to run the cython test suite.
There is another error, in test_exceptions.pyx, stemming from the fact
IndentationError messages in 3.10 are more verbose (e.g.

expected an indented block after 'if' statement on line 1

instead of simply

expected an indented block) - that one however seems to be a test-only
issue.

Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 dev-python/cython/cython-0.29.23.ebuild            |   1 +
 .../files/cython-0.29.23-tracing-py310.patch       | 213 +++++++++++++++++++++
 2 files changed, 214 insertions(+)

diff --git a/dev-python/cython/cython-0.29.23.ebuild b/dev-python/cython/cython-0.29.23.ebuild
index eb35100a371..d091b7190eb 100644
--- a/dev-python/cython/cython-0.29.23.ebuild
+++ b/dev-python/cython/cython-0.29.23.ebuild
@@ -32,6 +32,7 @@ BDEPEND="${RDEPEND}
 PATCHES=(
 	"${FILESDIR}/${PN}-0.29.14-sphinx-update.patch"
 	"${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch"
+	"${FILESDIR}/${PN}-0.29.23-tracing-py310.patch"
 )
 
 SITEFILE=50cython-gentoo.el

diff --git a/dev-python/cython/files/cython-0.29.23-tracing-py310.patch b/dev-python/cython/files/cython-0.29.23-tracing-py310.patch
new file mode 100644
index 00000000000..ff0e45a646d
--- /dev/null
+++ b/dev-python/cython/files/cython-0.29.23-tracing-py310.patch
@@ -0,0 +1,213 @@
+From c9cccfeaf3f0e20c2bb14fc234e86f4fc8e4fe81 Mon Sep 17 00:00:00 2001
+From: Stefan Behnel <stefan_ml@behnel.de>
+Date: Fri, 14 May 2021 19:39:58 +0200
+Subject: [PATCH] Adapt tracing code to Py3.10 beta 1.
+
+---
+ Cython/Utility/Profile.c | 79 +++++++++++++++++++++++++---------------
+ 1 file changed, 49 insertions(+), 30 deletions(-)
+
+diff --git a/Cython/Utility/Profile.c b/Cython/Utility/Profile.c
+index 15ceb41cc2..2cd9af9da7 100644
+--- a/Cython/Utility/Profile.c
++++ b/Cython/Utility/Profile.c
+@@ -47,13 +47,32 @@
+     #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
+   #endif
+ 
+-  #define __Pyx_TraceDeclarations                                     \
+-  static PyCodeObject *$frame_code_cname = NULL;                      \
+-  CYTHON_FRAME_MODIFIER PyFrameObject *$frame_cname = NULL;           \
+-  int __Pyx_use_tracing = 0;
++  #define __Pyx_TraceDeclarations                                         \
++      static PyCodeObject *$frame_code_cname = NULL;                      \
++      CYTHON_FRAME_MODIFIER PyFrameObject *$frame_cname = NULL;           \
++      int __Pyx_use_tracing = 0;
+ 
+-  #define __Pyx_TraceFrameInit(codeobj)                               \
+-  if (codeobj) $frame_code_cname = (PyCodeObject*) codeobj;
++  #define __Pyx_TraceFrameInit(codeobj)                                   \
++      if (codeobj) $frame_code_cname = (PyCodeObject*) codeobj;
++
++#if PY_VERSION_HEX >= 0x030a00b1
++  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs) \
++     (unlikely(tstate->cframe->use_tracing) && \
++         (!(check_tracing) || !tstate->tracing) && \
++         (!(check_funcs) || tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)))
++
++  #define __Pyx_SetTracing(tstate, enable) \
++      (tstate)->cframe->use_tracing = (enable)
++
++#else
++  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs) \
++     (unlikely(tstate->use_tracing) && \
++         (!(check_tracing) || !tstate->tracing) && \
++         (!(check_funcs) || tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)))
++
++  #define __Pyx_SetTracing(tstate, enable) \
++      (tstate)->use_tracing = (enable)
++#endif
+ 
+   #ifdef WITH_THREAD
+   #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)             \
+@@ -62,8 +81,7 @@
+           PyThreadState *tstate;                                                         \
+           PyGILState_STATE state = PyGILState_Ensure();                                  \
+           tstate = __Pyx_PyThreadState_Current;                                          \
+-          if (unlikely(tstate->use_tracing) && !tstate->tracing &&                       \
+-                  (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {    \
++          if (__Pyx_IsTracing(tstate, 1, 1)) {                                           \
+               __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&$frame_code_cname, &$frame_cname, tstate, funcname, srcfile, firstlineno);  \
+           }                                                                              \
+           PyGILState_Release(state);                                                     \
+@@ -71,8 +89,7 @@
+       }                                                                                  \
+   } else {                                                                               \
+       PyThreadState* tstate = PyThreadState_GET();                                       \
+-      if (unlikely(tstate->use_tracing) && !tstate->tracing &&                           \
+-              (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {        \
++      if (__Pyx_IsTracing(tstate, 1, 1)) {                                               \
+           __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&$frame_code_cname, &$frame_cname, tstate, funcname, srcfile, firstlineno);  \
+           if (unlikely(__Pyx_use_tracing < 0)) goto_error;                               \
+       }                                                                                  \
+@@ -80,8 +97,7 @@
+   #else
+   #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)             \
+   {   PyThreadState* tstate = PyThreadState_GET();                                       \
+-      if (unlikely(tstate->use_tracing) && !tstate->tracing &&                           \
+-              (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {        \
++      if (__Pyx_IsTracing(tstate, 1, 1)) {                                               \
+           __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&$frame_code_cname, &$frame_cname, tstate, funcname, srcfile, firstlineno);  \
+           if (unlikely(__Pyx_use_tracing < 0)) goto_error;                               \
+       }                                                                                  \
+@@ -91,10 +107,9 @@
+   #define __Pyx_TraceException()                                                           \
+   if (likely(!__Pyx_use_tracing)); else {                                                  \
+       PyThreadState* tstate = __Pyx_PyThreadState_Current;                                 \
+-      if (tstate->use_tracing &&                                                           \
+-              (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc))) {          \
++      if (__Pyx_IsTracing(tstate, 0, 1)) {                                                 \
+           tstate->tracing++;                                                               \
+-          tstate->use_tracing = 0;                                                         \
++          __Pyx_SetTracing(tstate, 0);                                                     \
+           PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);                            \
+           if (exc_info) {                                                                  \
+               if (CYTHON_TRACE && tstate->c_tracefunc)                                     \
+@@ -104,7 +119,7 @@
+                   tstate->c_profileobj, $frame_cname, PyTrace_EXCEPTION, exc_info);        \
+               Py_DECREF(exc_info);                                                         \
+           }                                                                                \
+-          tstate->use_tracing = 1;                                                         \
++          __Pyx_SetTracing(tstate, 1);                                                     \
+           tstate->tracing--;                                                               \
+       }                                                                                    \
+   }
+@@ -113,13 +128,13 @@
+       PyObject *type, *value, *traceback;
+       __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
+       tstate->tracing++;
+-      tstate->use_tracing = 0;
++      __Pyx_SetTracing(tstate, 0);
+       if (CYTHON_TRACE && tstate->c_tracefunc)
+           tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
+       if (tstate->c_profilefunc)
+           tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
+       CYTHON_FRAME_DEL(frame);
+-      tstate->use_tracing = 1;
++      __Pyx_SetTracing(tstate, 1);
+       tstate->tracing--;
+       __Pyx_ErrRestoreInState(tstate, type, value, traceback);
+   }
+@@ -132,14 +147,14 @@
+               PyThreadState *tstate;                                                      \
+               PyGILState_STATE state = PyGILState_Ensure();                               \
+               tstate = __Pyx_PyThreadState_Current;                                       \
+-              if (tstate->use_tracing) {                                                  \
++              if (__Pyx_IsTracing(tstate, 0, 0)) {                                        \
+                   __Pyx_call_return_trace_func(tstate, $frame_cname, (PyObject*)result);  \
+               }                                                                           \
+               PyGILState_Release(state);                                                  \
+           }                                                                               \
+       } else {                                                                            \
+           PyThreadState* tstate = __Pyx_PyThreadState_Current;                            \
+-          if (tstate->use_tracing) {                                                      \
++          if (__Pyx_IsTracing(tstate, 0, 0)) {                                            \
+               __Pyx_call_return_trace_func(tstate, $frame_cname, (PyObject*)result);      \
+           }                                                                               \
+       }                                                                                   \
+@@ -148,7 +163,7 @@
+   #define __Pyx_TraceReturn(result, nogil)                                                \
+   if (likely(!__Pyx_use_tracing)); else {                                                 \
+       PyThreadState* tstate = __Pyx_PyThreadState_Current;                                \
+-      if (tstate->use_tracing) {                                                          \
++      if (__Pyx_IsTracing(tstate, 0, 0)) {                                                \
+           __Pyx_call_return_trace_func(tstate, $frame_cname, (PyObject*)result);          \
+       }                                                                                   \
+   }
+@@ -176,9 +191,11 @@
+       __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
+       __Pyx_PyFrame_SetLineNumber(frame, lineno);
+       tstate->tracing++;
+-      tstate->use_tracing = 0;
++      __Pyx_SetTracing(tstate, 0);
++
+       ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
+-      tstate->use_tracing = 1;
++
++      __Pyx_SetTracing(tstate, 1);
+       tstate->tracing--;
+       if (likely(!ret)) {
+           __Pyx_ErrRestoreInState(tstate, type, value, traceback);
+@@ -199,7 +216,7 @@
+               PyThreadState *tstate;                                                       \
+               PyGILState_STATE state = __Pyx_PyGILState_Ensure();                          \
+               tstate = __Pyx_PyThreadState_Current;                                        \
+-              if (unlikely(tstate->use_tracing && tstate->c_tracefunc && $frame_cname->f_trace)) { \
++              if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && $frame_cname->f_trace) { \
+                   ret = __Pyx_call_line_trace_func(tstate, $frame_cname, lineno);          \
+               }                                                                            \
+               __Pyx_PyGILState_Release(state);                                             \
+@@ -207,7 +224,7 @@
+           }                                                                                \
+       } else {                                                                             \
+           PyThreadState* tstate = __Pyx_PyThreadState_Current;                             \
+-          if (unlikely(tstate->use_tracing && tstate->c_tracefunc && $frame_cname->f_trace)) { \
++          if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && $frame_cname->f_trace) { \
+               int ret = __Pyx_call_line_trace_func(tstate, $frame_cname, lineno);          \
+               if (unlikely(ret)) goto_error;                                               \
+           }                                                                                \
+@@ -217,7 +234,7 @@
+   #define __Pyx_TraceLine(lineno, nogil, goto_error)                                       \
+   if (likely(!__Pyx_use_tracing)); else {                                                  \
+       PyThreadState* tstate = __Pyx_PyThreadState_Current;                                 \
+-      if (unlikely(tstate->use_tracing && tstate->c_tracefunc && $frame_cname->f_trace)) { \
++      if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && $frame_cname->f_trace) { \
+           int ret = __Pyx_call_line_trace_func(tstate, $frame_cname, lineno);              \
+           if (unlikely(ret)) goto_error;                                                   \
+       }                                                                                    \
+@@ -263,19 +280,21 @@ static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
+         (*frame)->f_tstate = tstate;
+ #endif
+     }
+-      __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
++    __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
++
+     retval = 1;
+     tstate->tracing++;
+-    tstate->use_tracing = 0;
++    __Pyx_SetTracing(tstate, 0);
+     __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
++
+     #if CYTHON_TRACE
+     if (tstate->c_tracefunc)
+         retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
+     if (retval && tstate->c_profilefunc)
+     #endif
+         retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
+-    tstate->use_tracing = (tstate->c_profilefunc ||
+-                           (CYTHON_TRACE && tstate->c_tracefunc));
++
++    __Pyx_SetTracing(tstate, (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)));
+     tstate->tracing--;
+     if (retval) {
+         __Pyx_ErrRestoreInState(tstate, type, value, traceback);


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2021-09-03 18:18 Michał Górny
  0 siblings, 0 replies; 14+ messages in thread
From: Michał Górny @ 2021-09-03 18:18 UTC (permalink / raw
  To: gentoo-commits

commit:     7336b4f587b29d26018d925ed58f5aef503af218
Author:     Rolf Eike Beer <eike <AT> sf-mail <DOT> de>
AuthorDate: Fri Sep  3 13:15:19 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Sep  3 18:18:16 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7336b4f5

dev-python/cython: fix unaligned accesses in type conversions

Signed-off-by: Rolf Eike Beer <eike <AT> sf-mail.de>
Closes: https://github.com/gentoo/gentoo/pull/22204
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 ...hon-0.29.24.ebuild => cython-0.29.24-r1.ebuild} |  1 +
 .../files/cython-0.29.24-unaligned-format.patch    | 33 ++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/dev-python/cython/cython-0.29.24.ebuild b/dev-python/cython/cython-0.29.24-r1.ebuild
similarity index 97%
rename from dev-python/cython/cython-0.29.24.ebuild
rename to dev-python/cython/cython-0.29.24-r1.ebuild
index 0c107a31d2b..dced6974732 100644
--- a/dev-python/cython/cython-0.29.24.ebuild
+++ b/dev-python/cython/cython-0.29.24-r1.ebuild
@@ -31,6 +31,7 @@ BDEPEND="${RDEPEND}
 PATCHES=(
 	"${FILESDIR}/${PN}-0.29.22-spawn-multiprocessing.patch"
 	"${FILESDIR}/${PN}-0.29.23-test_exceptions-py310.patch"
+	"${FILESDIR}/${PN}-0.29.24-unaligned-format.patch"
 )
 
 SITEFILE=50cython-gentoo.el

diff --git a/dev-python/cython/files/cython-0.29.24-unaligned-format.patch b/dev-python/cython/files/cython-0.29.24-unaligned-format.patch
new file mode 100644
index 00000000000..955c32debb4
--- /dev/null
+++ b/dev-python/cython/files/cython-0.29.24-unaligned-format.patch
@@ -0,0 +1,33 @@
+From 2c08fd50d62e4255602ee3c0d41157df7608e773 Mon Sep 17 00:00:00 2001
+From: Stefan Behnel <stefan_ml@behnel.de>
+Date: Wed, 1 Sep 2021 00:09:02 +0200
+Subject: [PATCH] Avoid copying unaligned 16-bit values since some platforms
+ require them to be aligned. Use memcpy() instead to let the C compiler decide
+ how to do it.
+
+Closes https://github.com/cython/cython/issues/4343
+---
+ Cython/Utility/TypeConversion.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c
+index 751d12b62a..3669bc9ec1 100644
+--- a/Cython/Utility/TypeConversion.c
++++ b/Cython/Utility/TypeConversion.c
+@@ -829,14 +829,14 @@ static CYTHON_INLINE PyObject* {{TO_PY_FUNCTION}}({{TYPE}} value, Py_ssize_t wid
+             digit_pos = abs((int)(remaining % (8*8)));
+             remaining = ({{TYPE}}) (remaining / (8*8));
+             dpos -= 2;
+-            *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_8)[digit_pos]; /* copy 2 digits at a time */
++            memcpy(dpos, DIGIT_PAIRS_8 + digit_pos * 2, 2); /* copy 2 digits at a time, unaligned */
+             last_one_off = (digit_pos < 8);
+             break;
+         case 'd':
+             digit_pos = abs((int)(remaining % (10*10)));
+             remaining = ({{TYPE}}) (remaining / (10*10));
+             dpos -= 2;
+-            *(uint16_t*)dpos = ((const uint16_t*)DIGIT_PAIRS_10)[digit_pos]; /* copy 2 digits at a time */
++            memcpy(dpos, DIGIT_PAIRS_10 + digit_pos * 2, 2); /* copy 2 digits at a time, unaligned */
+             last_one_off = (digit_pos < 10);
+             break;
+         case 'x':


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2023-03-24  5:12 Sam James
  0 siblings, 0 replies; 14+ messages in thread
From: Sam James @ 2023-03-24  5:12 UTC (permalink / raw
  To: gentoo-commits

commit:     9e9a93ca1c92f22f4ad15ae2e814c81deb1145f8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 24 05:03:59 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Mar 24 05:09:07 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9e9a93ca

dev-python/cython: workaround parallel install race for importing pythran

An empty directory in site-packages is a valid Python module, unfortunately, because
of namespaces. If installing packages in parallel, the pythran module might "exist"
but be empty (hence no __version__ attribute). Catch AttributeError to avoid a narrow
race.

This might still be a Portage issue if there's a substantial delay between creating
the directory and installing the remaining files though.

Thanks to Eli Schwartz for helping out.

Bug: https://bugs.gentoo.org/902713
Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...n-3.0.0_beta1.ebuild => cython-0.29.33-r1.ebuild} | 12 ++++--------
 ...0.0_beta1.ebuild => cython-3.0.0_beta1-r1.ebuild} |  0
 .../cython-0.29.23-pythran-parallel-install.patch    | 20 ++++++++++++++++++++
 3 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/dev-python/cython/cython-3.0.0_beta1.ebuild b/dev-python/cython/cython-0.29.33-r1.ebuild
similarity index 89%
copy from dev-python/cython/cython-3.0.0_beta1.ebuild
copy to dev-python/cython/cython-0.29.33-r1.ebuild
index 54bc5b850f4d..75535976ff9b 100644
--- a/dev-python/cython/cython-3.0.0_beta1.ebuild
+++ b/dev-python/cython/cython-0.29.33-r1.ebuild
@@ -9,7 +9,6 @@ PYTHON_REQ_USE="threads(+)"
 
 inherit distutils-r1 toolchain-funcs elisp-common
 
-MY_P=${P/_beta/b}
 DESCRIPTION="A Python to C compiler"
 HOMEPAGE="
 	https://cython.org/
@@ -17,10 +16,9 @@ HOMEPAGE="
 	https://pypi.org/project/Cython/
 "
 SRC_URI="
-	https://github.com/cython/cython/archive/${PV/_beta/b}.tar.gz
-		-> ${MY_P}.gh.tar.gz
+	https://github.com/cython/cython/archive/${PV}.tar.gz
+		-> ${P}.gh.tar.gz
 "
-S=${WORKDIR}/${MY_P}
 
 LICENSE="Apache-2.0"
 SLOT="0"
@@ -43,14 +41,12 @@ BDEPEND="
 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"
 )
 
 SITEFILE=50cython-gentoo.el
 
-distutils_enable_sphinx docs \
-	dev-python/jinja \
-	dev-python/sphinx-issues \
-	dev-python/sphinx-tabs
+distutils_enable_sphinx docs
 
 python_compile() {
 	# Python gets confused when it is in sys.path before build.

diff --git a/dev-python/cython/cython-3.0.0_beta1.ebuild b/dev-python/cython/cython-3.0.0_beta1-r1.ebuild
similarity index 100%
rename from dev-python/cython/cython-3.0.0_beta1.ebuild
rename to dev-python/cython/cython-3.0.0_beta1-r1.ebuild

diff --git a/dev-python/cython/files/cython-0.29.23-pythran-parallel-install.patch b/dev-python/cython/files/cython-0.29.23-pythran-parallel-install.patch
new file mode 100644
index 000000000000..450007b5663f
--- /dev/null
+++ b/dev-python/cython/files/cython-0.29.23-pythran-parallel-install.patch
@@ -0,0 +1,20 @@
+An empty directory in site-packages is a valid Python module, unfortunately, because
+of namespaces. If installing packages in parallel, the pythran module might "exist"
+but be empty (hence no __version__ attribute). Catch AttributeError to avoid a narrow
+race.
+
+See https://bugs.gentoo.org/902713.
+
+This might still be a Portage issue if there's a substantial delay between creating
+the directory and installing the remaining files though.
+--- a/Cython/Compiler/Pythran.py
++++ b/Cython/Compiler/Pythran.py
+@@ -10,7 +10,7 @@ try:
+     import pythran
+     pythran_is_pre_0_9 = tuple(map(int, pythran.__version__.split('.')[0:2])) < (0, 9)
+     pythran_is_pre_0_9_6 = tuple(map(int, pythran.__version__.split('.')[0:3])) < (0, 9, 6)
+-except ImportError:
++except (AttributeError, ImportError):
+     pythran = None
+     pythran_is_pre_0_9 = True
+     pythran_is_pre_0_9_6 = True


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2023-06-15 18:26 Michał Górny
  0 siblings, 0 replies; 14+ messages in thread
From: Michał Górny @ 2023-06-15 18:26 UTC (permalink / raw
  To: gentoo-commits

commit:     d5b11f8c5e183927f2046e86c986ae1382dbe914
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Thu Jun 15 18:25:46 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Thu Jun 15 18:26:11 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d5b11f8c

dev-python/cython: Backport reverse iterator fix to 3.0.0_beta3-r2

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

 ...eta3-r1.ebuild => cython-3.0.0_beta3-r2.ebuild} |   3 +
 .../files/cython-3.0.0_beta3-const-iter.patch      | 207 +++++++++++++++++++++
 2 files changed, 210 insertions(+)

diff --git a/dev-python/cython/cython-3.0.0_beta3-r1.ebuild b/dev-python/cython/cython-3.0.0_beta3-r2.ebuild
similarity index 94%
rename from dev-python/cython/cython-3.0.0_beta3-r1.ebuild
rename to dev-python/cython/cython-3.0.0_beta3-r2.ebuild
index ca84314058cc..bbe34ee3f715 100644
--- a/dev-python/cython/cython-3.0.0_beta3-r1.ebuild
+++ b/dev-python/cython/cython-3.0.0_beta3-r2.ebuild
@@ -45,6 +45,9 @@ PATCHES=(
 	"${FILESDIR}/${PN}-0.29.23-pythran-parallel-install.patch"
 	# backport upstream fix e.g. for dev-python/pysimdjson on py3.12
 	"${FILESDIR}/${P}-py312-long.patch"
+	# should fix dev-python/symengine
+	# https://github.com/cython/cython/pull/5483
+	"${FILESDIR}/${P}-const-iter.patch"
 )
 
 distutils_enable_sphinx docs \

diff --git a/dev-python/cython/files/cython-3.0.0_beta3-const-iter.patch b/dev-python/cython/files/cython-3.0.0_beta3-const-iter.patch
new file mode 100644
index 000000000000..18822f12904a
--- /dev/null
+++ b/dev-python/cython/files/cython-3.0.0_beta3-const-iter.patch
@@ -0,0 +1,207 @@
+From 913b8fadc5fc45306764c0ede472e1bc3b606d10 Mon Sep 17 00:00:00 2001
+From: Isuru Fernando <isuruf@gmail.com>
+Date: Mon, 12 Jun 2023 13:42:09 -0500
+Subject: [PATCH 1/4] Don't remove const for reverse iteration
+
+---
+ Cython/Compiler/ExprNodes.py   | 27 ---------------------------
+ Cython/Includes/libcpp/map.pxd |  8 ++++++--
+ 2 files changed, 6 insertions(+), 29 deletions(-)
+
+diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
+index ad4701b7bb6..275a6233da5 100644
+--- a/Cython/Compiler/ExprNodes.py
++++ b/Cython/Compiler/ExprNodes.py
+@@ -3268,32 +3268,6 @@ def free_temps(self, code):
+         ExprNode.free_temps(self, code)
+ 
+ 
+-def remove_const(item_type):
+-    """
+-    Removes the constness of a given type and its underlying templates
+-    if any.
+-
+-    This is to solve the compilation error when the temporary variable used to
+-    store the result of an iterator cannot be changed due to its constness.
+-    For example, the value_type of std::map, which will also be the type of
+-    the temporarry variable, is std::pair<const Key, T>. This means the first
+-    component of the variable cannot be reused to store the result of each
+-    iteration, which leads to a compilation error.
+-    """
+-    if item_type.is_const:
+-        item_type = item_type.cv_base_type
+-    if item_type.is_typedef:
+-        item_type = remove_const(item_type.typedef_base_type)
+-    if item_type.is_cpp_class and item_type.templates:
+-        templates = [remove_const(t) if t.is_const else t for t in item_type.templates]
+-        template_type = item_type.template_type
+-        item_type = PyrexTypes.CppClassType(
+-            template_type.name, template_type.scope,
+-            template_type.cname, template_type.base_classes,
+-            templates, template_type)
+-    return item_type
+-
+-
+ class NextNode(AtomicExprNode):
+     #  Used as part of for statement implementation.
+     #  Implements result = next(iterator)
+@@ -3336,7 +3310,6 @@ def infer_type(self, env, iterator_type=None):
+ 
+     def analyse_types(self, env):
+         self.type = self.infer_type(env, self.iterator.type)
+-        self.type = remove_const(self.type)
+         self.is_temp = 1
+         return self
+ 
+diff --git a/Cython/Includes/libcpp/map.pxd b/Cython/Includes/libcpp/map.pxd
+index d81af66e09a..2c2c5c82adf 100644
+--- a/Cython/Includes/libcpp/map.pxd
++++ b/Cython/Includes/libcpp/map.pxd
+@@ -50,7 +50,9 @@ cdef extern from "<map>" namespace "std" nogil:
+         cppclass reverse_iterator:
+             reverse_iterator() except +
+             reverse_iterator(reverse_iterator&) except +
+-            value_type& operator*()
++            # correct would be value_type& but this does not work
++            # well with cython's code gen
++            pair[T, U]& operator*()
+             reverse_iterator operator++()
+             reverse_iterator operator--()
+             reverse_iterator operator++(int)
+@@ -63,7 +65,9 @@ cdef extern from "<map>" namespace "std" nogil:
+             const_reverse_iterator() except +
+             const_reverse_iterator(reverse_iterator&) except +
+             operator=(reverse_iterator&) except +
+-            const value_type& operator*()
++            # correct would be const value_type& but this does not work
++            # well with cython's code gen
++            const pair[T, U]& operator*()
+             const_reverse_iterator operator++()
+             const_reverse_iterator operator--()
+             const_reverse_iterator operator++(int)
+
+From cb804f989eaa9938e72d0336d82bb7aa0003455f Mon Sep 17 00:00:00 2001
+From: Isuru Fernando <isuruf@gmail.com>
+Date: Mon, 12 Jun 2023 13:57:58 -0500
+Subject: [PATCH 2/4] Add test from gh5478
+
+---
+ tests/run/cpp_iterators.pyx | 22 ++++++++++++++++++++++
+ 1 file changed, 22 insertions(+)
+
+diff --git a/tests/run/cpp_iterators.pyx b/tests/run/cpp_iterators.pyx
+index 81048d0b36b..424168fa825 100644
+--- a/tests/run/cpp_iterators.pyx
++++ b/tests/run/cpp_iterators.pyx
+@@ -7,6 +7,7 @@ from libcpp.map cimport map as stdmap
+ from libcpp.set cimport set as stdset
+ from libcpp.string cimport string
+ from libcpp.vector cimport vector
++from libcpp.memory cimport shared_ptr, make_shared
+ from cython.operator cimport dereference as deref
+ 
+ cdef extern from "cpp_iterators_simple.h":
+@@ -272,6 +273,27 @@ def test_iteration_over_attribute_of_call():
+     for i in get_object_with_iterable_attribute().vec:
+         print(i)
+ 
++cdef extern from *:
++    # TODO: support make_shared[const int]
++    shared_ptr[const int] make_shared_const_int "std::make_shared<const int>"(int)
++
++def test_iteration_over_shared_const_ptr_set(py_v):
++    """
++    >>> test_iteration_over_shared_const_ptr_set[2, 4, 6])
++    6
++    4
++    2
++    """
++    cdef stdset[shared_ptr[const int]] s
++    cdef int i
++    for e in py_v:
++        i = e
++        s.insert(make_shared_const_int(i))
++
++    cdef shared_ptr[const int] a
++    for a in s:
++        print(deref(a))
++
+ def test_iteration_over_reversed_list(py_v):
+     """
+     >>> test_iteration_over_reversed_list([2, 4, 6])
+
+From a9bfacdcf5358e9d5a1d3c8ab0dd2eff6f18018a Mon Sep 17 00:00:00 2001
+From: Isuru Fernando <isuruf@gmail.com>
+Date: Mon, 12 Jun 2023 14:07:37 -0500
+Subject: [PATCH 3/4] Fix multimap too
+
+---
+ Cython/Includes/libcpp/map.pxd | 8 ++++++--
+ 1 file changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/Cython/Includes/libcpp/map.pxd b/Cython/Includes/libcpp/map.pxd
+index 2c2c5c82adf..eb739509ac1 100644
+--- a/Cython/Includes/libcpp/map.pxd
++++ b/Cython/Includes/libcpp/map.pxd
+@@ -177,7 +177,9 @@ cdef extern from "<map>" namespace "std" nogil:
+         cppclass reverse_iterator:
+             reverse_iterator() except +
+             reverse_iterator(reverse_iterator&) except +
+-            value_type& operator*()
++            # correct would be value_type& but this does not work
++            # well with cython's code gen
++            pair[T, U]& operator*()
+             reverse_iterator operator++()
+             reverse_iterator operator--()
+             reverse_iterator operator++(int)
+@@ -190,7 +192,9 @@ cdef extern from "<map>" namespace "std" nogil:
+             const_reverse_iterator() except +
+             const_reverse_iterator(reverse_iterator&) except +
+             operator=(reverse_iterator&) except +
+-            const value_type& operator*()
++            # correct would be const value_type& but this does not work
++            # well with cython's code gen
++            const pair[T, U]& operator*()
+             const_reverse_iterator operator++()
+             const_reverse_iterator operator--()
+             const_reverse_iterator operator++(int)
+
+From 0528cd937e6d4606eb0902ee8d8db672ee7f88fe Mon Sep 17 00:00:00 2001
+From: Isuru Fernando <isuruf@gmail.com>
+Date: Mon, 12 Jun 2023 17:50:41 -0500
+Subject: [PATCH 4/4] Fix test
+
+---
+ tests/run/cpp_iterators.pyx | 15 +++++++--------
+ 1 file changed, 7 insertions(+), 8 deletions(-)
+
+diff --git a/tests/run/cpp_iterators.pyx b/tests/run/cpp_iterators.pyx
+index 424168fa825..57d2716bea5 100644
+--- a/tests/run/cpp_iterators.pyx
++++ b/tests/run/cpp_iterators.pyx
+@@ -277,18 +277,17 @@ cdef extern from *:
+     # TODO: support make_shared[const int]
+     shared_ptr[const int] make_shared_const_int "std::make_shared<const int>"(int)
+ 
+-def test_iteration_over_shared_const_ptr_set(py_v):
++def test_iteration_over_shared_const_ptr_vector(py_v):
+     """
+-    >>> test_iteration_over_shared_const_ptr_set[2, 4, 6])
+-    6
+-    4
++    >>> test_iteration_over_shared_const_ptr_vector([2, 4, 6])
+     2
++    4
++    6
+     """
+-    cdef stdset[shared_ptr[const int]] s
++    cdef vector[shared_ptr[const int]] s
+     cdef int i
+-    for e in py_v:
+-        i = e
+-        s.insert(make_shared_const_int(i))
++    for i in py_v:
++        s.push_back(make_shared_const_int(i))
+ 
+     cdef shared_ptr[const int] a
+     for a in s:


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2023-07-17 17:53 Sam James
  0 siblings, 0 replies; 14+ messages in thread
From: Sam James @ 2023-07-17 17:53 UTC (permalink / raw
  To: gentoo-commits

commit:     8494beecabfa4083ef0a72ca17c9f03b20581fec
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Mon Jul 17 17:52:13 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Mon Jul 17 17:52:59 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8494beec

dev-python/cython: drop 3.0.0_beta3-r2, 3.0.0_rc2

Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/cython/Manifest                         |   2 -
 dev-python/cython/cython-3.0.0_beta3-r2.ebuild     |  81 --------
 dev-python/cython/cython-3.0.0_rc2.ebuild          |  84 ---------
 .../files/cython-3.0.0_beta3-const-iter.patch      | 207 ---------------------
 .../files/cython-3.0.0_beta3-py312-long.patch      |  28 ---
 5 files changed, 402 deletions(-)

diff --git a/dev-python/cython/Manifest b/dev-python/cython/Manifest
index 3fe9b357709d..17c57826362d 100644
--- a/dev-python/cython/Manifest
+++ b/dev-python/cython/Manifest
@@ -2,5 +2,3 @@ DIST cython-0.29.34.gh.tar.gz 2114639 BLAKE2B c5f70fd3e6074d9030a1035bc98d71b703
 DIST cython-0.29.35.gh.tar.gz 2115190 BLAKE2B ac23abbd2b560ee52a79840d995a4cf36ddb3a8705b9327010f1ad6add8028185c15703efcc1d59b581d65b5de38e123c0f07c36fe6ffe54a6efee7512161344 SHA512 35d679d94e1f731e004b83fb4ae0d569703b0800c913012308146b1c54463ce12cb1cf3733e24162fb357f179444c5ca31108a37850e6c749ddebac5175119f5
 DIST cython-0.29.36.gh.tar.gz 2115333 BLAKE2B 6d43779c7222ff65d7de3a35ec18ef636480807d53480a8f94cc8c92d462fcc2f4d201a3bbf6e840a11fd33025e32c53f85626b05c131d10eed2859cdca7eb2d SHA512 a086fe1a11290cd3c870b891e61a0a0e2595bab9c26888024a758b6950c07059346d682fa9349e46c0af89805abbdd750059b3189960b8ce18007dfb5eb4391a
 DIST cython-3.0.0.gh.tar.gz 2713478 BLAKE2B 16be50b463cf155417fee02b4529bbde8c4402bac0098ddf2cb05e33ac4c5b455bf7595b046b2bc6edcc8121f2c6be3b7af60c3c721a37bebcf4c654cd41a43f SHA512 a9bf6f0a78accd0624bc2a61329541d97d60257ae3a6b6601f73bd9122427a3d460129b317f000d3061a4dfe3e6a6de59342354862ded13e85c7eb622ee39f9a
-DIST cython-3.0.0b3.gh.tar.gz 2688784 BLAKE2B 933bb48b2bf5169c973a36c877a36eae28b80409a7ff395b82a14ac0740247496df3c9f2d69884c823b7475069f0c75d6cbbb964b88de60b38082e6e36659bff SHA512 f1d0fdcec4bc6b0f6cb66078592424fdcb7a028b79c5b9d41280ae112235736d11c9f4f793e810007e880ae0def195ac25999db59065c7f7bdcfab84b06bf7d3
-DIST cython-3.0.0rc2.gh.tar.gz 2713358 BLAKE2B 5d1e1043e0785c4e79441e47ab6d03b7dbdff8728946707acd39452c1a20e3527e3142bbf09d140d28e233ef0ae0e870650f5f77a8d2a1d084199b5b39937463 SHA512 42ff1b3f2509c90be6007b9156454ae89c1be26a9dde6ca9c109b0cfa3de30797eeeffef38ea1bfe37a9c8e062c776c8cb755826f8c25aa7c9703fbb031bf643

diff --git a/dev-python/cython/cython-3.0.0_beta3-r2.ebuild b/dev-python/cython/cython-3.0.0_beta3-r2.ebuild
deleted file mode 100644
index bbe34ee3f715..000000000000
--- a/dev-python/cython/cython-3.0.0_beta3-r2.ebuild
+++ /dev/null
@@ -1,81 +0,0 @@
-# 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/_beta/b}
-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/_beta/b}.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"
-	# backport upstream fix e.g. for dev-python/pysimdjson on py3.12
-	"${FILESDIR}/${P}-py312-long.patch"
-	# should fix dev-python/symengine
-	# https://github.com/cython/cython/pull/5483
-	"${FILESDIR}/${P}-const-iter.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
-
-	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 ||
-		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/cython-3.0.0_rc2.ebuild b/dev-python/cython/cython-3.0.0_rc2.ebuild
deleted file mode 100644
index 3e911be4bd62..000000000000
--- a/dev-python/cython/cython-3.0.0_rc2.ebuild
+++ /dev/null
@@ -1,84 +0,0 @@
-# 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"
-)
-
-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.0_beta3-const-iter.patch b/dev-python/cython/files/cython-3.0.0_beta3-const-iter.patch
deleted file mode 100644
index 18822f12904a..000000000000
--- a/dev-python/cython/files/cython-3.0.0_beta3-const-iter.patch
+++ /dev/null
@@ -1,207 +0,0 @@
-From 913b8fadc5fc45306764c0ede472e1bc3b606d10 Mon Sep 17 00:00:00 2001
-From: Isuru Fernando <isuruf@gmail.com>
-Date: Mon, 12 Jun 2023 13:42:09 -0500
-Subject: [PATCH 1/4] Don't remove const for reverse iteration
-
----
- Cython/Compiler/ExprNodes.py   | 27 ---------------------------
- Cython/Includes/libcpp/map.pxd |  8 ++++++--
- 2 files changed, 6 insertions(+), 29 deletions(-)
-
-diff --git a/Cython/Compiler/ExprNodes.py b/Cython/Compiler/ExprNodes.py
-index ad4701b7bb6..275a6233da5 100644
---- a/Cython/Compiler/ExprNodes.py
-+++ b/Cython/Compiler/ExprNodes.py
-@@ -3268,32 +3268,6 @@ def free_temps(self, code):
-         ExprNode.free_temps(self, code)
- 
- 
--def remove_const(item_type):
--    """
--    Removes the constness of a given type and its underlying templates
--    if any.
--
--    This is to solve the compilation error when the temporary variable used to
--    store the result of an iterator cannot be changed due to its constness.
--    For example, the value_type of std::map, which will also be the type of
--    the temporarry variable, is std::pair<const Key, T>. This means the first
--    component of the variable cannot be reused to store the result of each
--    iteration, which leads to a compilation error.
--    """
--    if item_type.is_const:
--        item_type = item_type.cv_base_type
--    if item_type.is_typedef:
--        item_type = remove_const(item_type.typedef_base_type)
--    if item_type.is_cpp_class and item_type.templates:
--        templates = [remove_const(t) if t.is_const else t for t in item_type.templates]
--        template_type = item_type.template_type
--        item_type = PyrexTypes.CppClassType(
--            template_type.name, template_type.scope,
--            template_type.cname, template_type.base_classes,
--            templates, template_type)
--    return item_type
--
--
- class NextNode(AtomicExprNode):
-     #  Used as part of for statement implementation.
-     #  Implements result = next(iterator)
-@@ -3336,7 +3310,6 @@ def infer_type(self, env, iterator_type=None):
- 
-     def analyse_types(self, env):
-         self.type = self.infer_type(env, self.iterator.type)
--        self.type = remove_const(self.type)
-         self.is_temp = 1
-         return self
- 
-diff --git a/Cython/Includes/libcpp/map.pxd b/Cython/Includes/libcpp/map.pxd
-index d81af66e09a..2c2c5c82adf 100644
---- a/Cython/Includes/libcpp/map.pxd
-+++ b/Cython/Includes/libcpp/map.pxd
-@@ -50,7 +50,9 @@ cdef extern from "<map>" namespace "std" nogil:
-         cppclass reverse_iterator:
-             reverse_iterator() except +
-             reverse_iterator(reverse_iterator&) except +
--            value_type& operator*()
-+            # correct would be value_type& but this does not work
-+            # well with cython's code gen
-+            pair[T, U]& operator*()
-             reverse_iterator operator++()
-             reverse_iterator operator--()
-             reverse_iterator operator++(int)
-@@ -63,7 +65,9 @@ cdef extern from "<map>" namespace "std" nogil:
-             const_reverse_iterator() except +
-             const_reverse_iterator(reverse_iterator&) except +
-             operator=(reverse_iterator&) except +
--            const value_type& operator*()
-+            # correct would be const value_type& but this does not work
-+            # well with cython's code gen
-+            const pair[T, U]& operator*()
-             const_reverse_iterator operator++()
-             const_reverse_iterator operator--()
-             const_reverse_iterator operator++(int)
-
-From cb804f989eaa9938e72d0336d82bb7aa0003455f Mon Sep 17 00:00:00 2001
-From: Isuru Fernando <isuruf@gmail.com>
-Date: Mon, 12 Jun 2023 13:57:58 -0500
-Subject: [PATCH 2/4] Add test from gh5478
-
----
- tests/run/cpp_iterators.pyx | 22 ++++++++++++++++++++++
- 1 file changed, 22 insertions(+)
-
-diff --git a/tests/run/cpp_iterators.pyx b/tests/run/cpp_iterators.pyx
-index 81048d0b36b..424168fa825 100644
---- a/tests/run/cpp_iterators.pyx
-+++ b/tests/run/cpp_iterators.pyx
-@@ -7,6 +7,7 @@ from libcpp.map cimport map as stdmap
- from libcpp.set cimport set as stdset
- from libcpp.string cimport string
- from libcpp.vector cimport vector
-+from libcpp.memory cimport shared_ptr, make_shared
- from cython.operator cimport dereference as deref
- 
- cdef extern from "cpp_iterators_simple.h":
-@@ -272,6 +273,27 @@ def test_iteration_over_attribute_of_call():
-     for i in get_object_with_iterable_attribute().vec:
-         print(i)
- 
-+cdef extern from *:
-+    # TODO: support make_shared[const int]
-+    shared_ptr[const int] make_shared_const_int "std::make_shared<const int>"(int)
-+
-+def test_iteration_over_shared_const_ptr_set(py_v):
-+    """
-+    >>> test_iteration_over_shared_const_ptr_set[2, 4, 6])
-+    6
-+    4
-+    2
-+    """
-+    cdef stdset[shared_ptr[const int]] s
-+    cdef int i
-+    for e in py_v:
-+        i = e
-+        s.insert(make_shared_const_int(i))
-+
-+    cdef shared_ptr[const int] a
-+    for a in s:
-+        print(deref(a))
-+
- def test_iteration_over_reversed_list(py_v):
-     """
-     >>> test_iteration_over_reversed_list([2, 4, 6])
-
-From a9bfacdcf5358e9d5a1d3c8ab0dd2eff6f18018a Mon Sep 17 00:00:00 2001
-From: Isuru Fernando <isuruf@gmail.com>
-Date: Mon, 12 Jun 2023 14:07:37 -0500
-Subject: [PATCH 3/4] Fix multimap too
-
----
- Cython/Includes/libcpp/map.pxd | 8 ++++++--
- 1 file changed, 6 insertions(+), 2 deletions(-)
-
-diff --git a/Cython/Includes/libcpp/map.pxd b/Cython/Includes/libcpp/map.pxd
-index 2c2c5c82adf..eb739509ac1 100644
---- a/Cython/Includes/libcpp/map.pxd
-+++ b/Cython/Includes/libcpp/map.pxd
-@@ -177,7 +177,9 @@ cdef extern from "<map>" namespace "std" nogil:
-         cppclass reverse_iterator:
-             reverse_iterator() except +
-             reverse_iterator(reverse_iterator&) except +
--            value_type& operator*()
-+            # correct would be value_type& but this does not work
-+            # well with cython's code gen
-+            pair[T, U]& operator*()
-             reverse_iterator operator++()
-             reverse_iterator operator--()
-             reverse_iterator operator++(int)
-@@ -190,7 +192,9 @@ cdef extern from "<map>" namespace "std" nogil:
-             const_reverse_iterator() except +
-             const_reverse_iterator(reverse_iterator&) except +
-             operator=(reverse_iterator&) except +
--            const value_type& operator*()
-+            # correct would be const value_type& but this does not work
-+            # well with cython's code gen
-+            const pair[T, U]& operator*()
-             const_reverse_iterator operator++()
-             const_reverse_iterator operator--()
-             const_reverse_iterator operator++(int)
-
-From 0528cd937e6d4606eb0902ee8d8db672ee7f88fe Mon Sep 17 00:00:00 2001
-From: Isuru Fernando <isuruf@gmail.com>
-Date: Mon, 12 Jun 2023 17:50:41 -0500
-Subject: [PATCH 4/4] Fix test
-
----
- tests/run/cpp_iterators.pyx | 15 +++++++--------
- 1 file changed, 7 insertions(+), 8 deletions(-)
-
-diff --git a/tests/run/cpp_iterators.pyx b/tests/run/cpp_iterators.pyx
-index 424168fa825..57d2716bea5 100644
---- a/tests/run/cpp_iterators.pyx
-+++ b/tests/run/cpp_iterators.pyx
-@@ -277,18 +277,17 @@ cdef extern from *:
-     # TODO: support make_shared[const int]
-     shared_ptr[const int] make_shared_const_int "std::make_shared<const int>"(int)
- 
--def test_iteration_over_shared_const_ptr_set(py_v):
-+def test_iteration_over_shared_const_ptr_vector(py_v):
-     """
--    >>> test_iteration_over_shared_const_ptr_set[2, 4, 6])
--    6
--    4
-+    >>> test_iteration_over_shared_const_ptr_vector([2, 4, 6])
-     2
-+    4
-+    6
-     """
--    cdef stdset[shared_ptr[const int]] s
-+    cdef vector[shared_ptr[const int]] s
-     cdef int i
--    for e in py_v:
--        i = e
--        s.insert(make_shared_const_int(i))
-+    for i in py_v:
-+        s.push_back(make_shared_const_int(i))
- 
-     cdef shared_ptr[const int] a
-     for a in s:

diff --git a/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch b/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch
deleted file mode 100644
index fb849eca8666..000000000000
--- a/dev-python/cython/files/cython-3.0.0_beta3-py312-long.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-From d82e4e34582e908d315b912a60d81d5759850df5 Mon Sep 17 00:00:00 2001
-From: Stefan Behnel <stefan_ml@behnel.de>
-Date: Mon, 29 May 2023 21:58:15 +0200
-Subject: [PATCH] Fix the argument type passed into the new
- "PyUnstable_Long_Compact*()" C-API functions in CPython 3.12.
-
----
- Cython/Utility/TypeConversion.c | 4 ++--
- 1 file changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/Cython/Utility/TypeConversion.c b/Cython/Utility/TypeConversion.c
-index efc5c1373..09e87d81c 100644
---- a/Cython/Utility/TypeConversion.c
-+++ b/Cython/Utility/TypeConversion.c
-@@ -149,8 +149,8 @@ static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
-         ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * __Pyx_PyLong_DigitCount(x))
- 
-   #if defined(PyUnstable_Long_IsCompact) && defined(PyUnstable_Long_CompactValue)
--    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact(x)
--    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue(x)
-+    #define __Pyx_PyLong_IsCompact(x)     PyUnstable_Long_IsCompact((PyLongObject*) x)
-+    #define __Pyx_PyLong_CompactValue(x)  PyUnstable_Long_CompactValue((PyLongObject*) x)
-   #else
-     #define __Pyx_PyLong_IsCompact(x)     (((PyLongObject*)x)->long_value.lv_tag < (2 << _PyLong_NON_SIZE_BITS))
-     #define __Pyx_PyLong_CompactValue(x)  ((1 - (Py_ssize_t) __Pyx_PyLong_Sign(x)) * (Py_ssize_t) __Pyx_PyLong_Digits(x)[0])
--- 
-2.41.0
-


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2023-07-28 11:07 Sam James
  0 siblings, 0 replies; 14+ messages in thread
From: Sam James @ 2023-07-28 11:07 UTC (permalink / raw
  To: gentoo-commits

commit:     e1e8c193a6ce07f105dc3767bed420b7010eefd9
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Jul 28 11:07:23 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Jul 28 11:07:23 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1e8c193

dev-python/cython: backport --version fix

Closes: https://bugs.gentoo.org/911333
Thanks-to: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-python/cython/cython-3.0.0-r1.ebuild           | 85 ++++++++++++++++++++++
 .../files/cython-3.0.0-version-stderr-stdout.patch | 35 +++++++++
 2 files changed, 120 insertions(+)

diff --git a/dev-python/cython/cython-3.0.0-r1.ebuild b/dev-python/cython/cython-3.0.0-r1.ebuild
new file mode 100644
index 000000000000..5455a20d026a
--- /dev/null
+++ b/dev-python/cython/cython-3.0.0-r1.ebuild
@@ -0,0 +1,85 @@
+# 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"
+	"${FILESDIR}/${P}-version-stderr-stdout.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.0-version-stderr-stdout.patch b/dev-python/cython/files/cython-3.0.0-version-stderr-stdout.patch
new file mode 100644
index 000000000000..7a12c6eead53
--- /dev/null
+++ b/dev-python/cython/files/cython-3.0.0-version-stderr-stdout.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/911333
+https://github.com/cython/cython/pull/5572
+https://github.com/cython/cython/commit/ca69b359b040bf6c0fc90692bbea3bdd9d7877e6
+
+From ca69b359b040bf6c0fc90692bbea3bdd9d7877e6 Mon Sep 17 00:00:00 2001
+From: Eli Schwartz <eschwartz@archlinux.org>
+Date: Fri, 28 Jul 2023 06:52:03 -0400
+Subject: [PATCH] Only write the version to stderr, if it's a separate file
+ descriptor from stdout (GH-5572)
+
+At least one project tries to detect the Cython version by redirecting stderr to
+stdout and capturing it. This is done in pure POSIX shell, so it probably seemed
+like the simple and obvious solution for a less capable programming language
+given that no output at all was expected on stdout.
+
+But the result is that the version number appears twice, and then gets misparsed
+and ends up triggering bad assumptions in the code running cython.
+
+It turns out that it's pretty easy to just print once, though. Detect when
+stdout and stderr are redirected to the same location, and only print once.
+
+See https://github.com/cython/cython/issues/5504
+Fixes https://bugs.gentoo.org/911333
+--- a/Cython/Compiler/Main.py
++++ b/Cython/Compiler/Main.py
+@@ -776,7 +776,7 @@ def main(command_line = 0):
+         print("Cython version %s" % __version__)
+         # For legacy reasons, we also write the version to stderr.
+         # New tools should expect it in stdout, but existing ones still pipe from stderr.
+-        if not sys.stderr.isatty():
++        if not sys.stderr.isatty() and os.fstat(1) != os.fstat(2):
+             sys.stderr.write("Cython version %s\n" % __version__)
+     if options.working_path!="":
+         os.chdir(options.working_path)
+


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2023-09-12  7:05 Michał Górny
  0 siblings, 0 replies; 14+ messages in thread
From: Michał Górny @ 2023-09-12  7:05 UTC (permalink / raw
  To: gentoo-commits

commit:     2396c57d44d635032ef1092286baef54c92d10d9
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Tue Sep 12 07:05:24 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> 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 <mgorny <AT> 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 <dw-git@d-woods.co.uk>
+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
+ }
+ 
+ 


^ permalink raw reply related	[flat|nested] 14+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/
@ 2023-10-02  4:22 Michał Górny
  0 siblings, 0 replies; 14+ messages in thread
From: Michał Górny @ 2023-10-02  4:22 UTC (permalink / raw
  To: gentoo-commits

commit:     61f2127c97460981b916177762b105913f2e51c6
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Mon Oct  2 04:20:29 2023 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Mon Oct  2 04:20:29 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=61f2127c

dev-python/cython: Remove old

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

 dev-python/cython/Manifest                         |  1 -
 dev-python/cython/cython-3.0.0-r1.ebuild           | 85 ----------------------
 dev-python/cython/cython-3.0.2.ebuild              | 84 ---------------------
 .../files/cython-3.0.0-version-stderr-stdout.patch | 35 ---------
 4 files changed, 205 deletions(-)

diff --git a/dev-python/cython/Manifest b/dev-python/cython/Manifest
index ee5db7ac6f58..de64a4d0e0f0 100644
--- a/dev-python/cython/Manifest
+++ b/dev-python/cython/Manifest
@@ -1,3 +1,2 @@
 DIST cython-0.29.36.gh.tar.gz 2115333 BLAKE2B 6d43779c7222ff65d7de3a35ec18ef636480807d53480a8f94cc8c92d462fcc2f4d201a3bbf6e840a11fd33025e32c53f85626b05c131d10eed2859cdca7eb2d SHA512 a086fe1a11290cd3c870b891e61a0a0e2595bab9c26888024a758b6950c07059346d682fa9349e46c0af89805abbdd750059b3189960b8ce18007dfb5eb4391a
-DIST cython-3.0.0.gh.tar.gz 2713478 BLAKE2B 16be50b463cf155417fee02b4529bbde8c4402bac0098ddf2cb05e33ac4c5b455bf7595b046b2bc6edcc8121f2c6be3b7af60c3c721a37bebcf4c654cd41a43f SHA512 a9bf6f0a78accd0624bc2a61329541d97d60257ae3a6b6601f73bd9122427a3d460129b317f000d3061a4dfe3e6a6de59342354862ded13e85c7eb622ee39f9a
 DIST cython-3.0.2.gh.tar.gz 2744583 BLAKE2B f631891870a6ce24acf2bcde75ebcb9775cf0df7840fe9d7b138cfdea64d54e9253a53d35d892a9086f251c1294d9414eec8521218d031840a3cd06903fefb86 SHA512 f55be138efdca6ca61bd39c6f2fab736244328a170a6f6c9bda87036e022c846930b209e9e9101fad889cb179d6e60034ba6f299f14b3056536d46235b438eb7

diff --git a/dev-python/cython/cython-3.0.0-r1.ebuild b/dev-python/cython/cython-3.0.0-r1.ebuild
deleted file mode 100644
index 5f584cde4e14..000000000000
--- a/dev-python/cython/cython-3.0.0-r1.ebuild
+++ /dev/null
@@ -1,85 +0,0 @@
-# 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"
-	"${FILESDIR}/${P}-version-stderr-stdout.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/cython-3.0.2.ebuild b/dev-python/cython/cython-3.0.2.ebuild
deleted file mode 100644
index 3e911be4bd62..000000000000
--- a/dev-python/cython/cython-3.0.2.ebuild
+++ /dev/null
@@ -1,84 +0,0 @@
-# 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"
-)
-
-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.0-version-stderr-stdout.patch b/dev-python/cython/files/cython-3.0.0-version-stderr-stdout.patch
deleted file mode 100644
index 7a12c6eead53..000000000000
--- a/dev-python/cython/files/cython-3.0.0-version-stderr-stdout.patch
+++ /dev/null
@@ -1,35 +0,0 @@
-https://bugs.gentoo.org/911333
-https://github.com/cython/cython/pull/5572
-https://github.com/cython/cython/commit/ca69b359b040bf6c0fc90692bbea3bdd9d7877e6
-
-From ca69b359b040bf6c0fc90692bbea3bdd9d7877e6 Mon Sep 17 00:00:00 2001
-From: Eli Schwartz <eschwartz@archlinux.org>
-Date: Fri, 28 Jul 2023 06:52:03 -0400
-Subject: [PATCH] Only write the version to stderr, if it's a separate file
- descriptor from stdout (GH-5572)
-
-At least one project tries to detect the Cython version by redirecting stderr to
-stdout and capturing it. This is done in pure POSIX shell, so it probably seemed
-like the simple and obvious solution for a less capable programming language
-given that no output at all was expected on stdout.
-
-But the result is that the version number appears twice, and then gets misparsed
-and ends up triggering bad assumptions in the code running cython.
-
-It turns out that it's pretty easy to just print once, though. Detect when
-stdout and stderr are redirected to the same location, and only print once.
-
-See https://github.com/cython/cython/issues/5504
-Fixes https://bugs.gentoo.org/911333
---- a/Cython/Compiler/Main.py
-+++ b/Cython/Compiler/Main.py
-@@ -776,7 +776,7 @@ def main(command_line = 0):
-         print("Cython version %s" % __version__)
-         # For legacy reasons, we also write the version to stderr.
-         # New tools should expect it in stdout, but existing ones still pipe from stderr.
--        if not sys.stderr.isatty():
-+        if not sys.stderr.isatty() and os.fstat(1) != os.fstat(2):
-             sys.stderr.write("Cython version %s\n" % __version__)
-     if options.working_path!="":
-         os.chdir(options.working_path)
-


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-10-02  4:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-15 18:26 [gentoo-commits] repo/gentoo:master commit in: dev-python/cython/files/, dev-python/cython/ Michał Górny
  -- strict thread matches above, loose matches on Subject: below --
2023-10-02  4:22 Michał Górny
2023-09-12  7:05 Michał Górny
2023-07-28 11:07 Sam James
2023-07-17 17:53 Sam James
2023-03-24  5:12 Sam James
2021-09-03 18:18 Michał Górny
2021-05-15  0:36 Marek Szuba
2021-03-06  3:24 Sam James
2020-12-10 19:41 Sam James
2020-06-15 13:20 Michał Górny
2019-11-20  4:56 Patrick McLean
2019-07-04  3:27 Tim Harder
2016-03-24 11:16 Ian Delaney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox