diff options
Diffstat (limited to 'dev-python/cysignals')
-rw-r--r-- | dev-python/cysignals/Manifest | 5 | ||||
-rw-r--r-- | dev-python/cysignals/cysignals-1.11.4-r1.ebuild | 41 | ||||
-rw-r--r-- | dev-python/cysignals/cysignals-1.11.4.ebuild | 30 | ||||
-rw-r--r-- | dev-python/cysignals/files/cysignals-1.11.4-helper.patch | 85 | ||||
-rw-r--r-- | dev-python/cysignals/metadata.xml | 5 |
5 files changed, 134 insertions, 32 deletions
diff --git a/dev-python/cysignals/Manifest b/dev-python/cysignals/Manifest index 6855c3ae159f..465d4242fc22 100644 --- a/dev-python/cysignals/Manifest +++ b/dev-python/cysignals/Manifest @@ -1,3 +1,4 @@ +AUX cysignals-1.11.4-helper.patch 3049 BLAKE2B 26ea0fb57e855d2fbc302d8ba84200ae541f4e28015ed447531a814ffbfa4a967be98ea94c0c77333f1b4adf80a58afbc73812676d56db0d9832a79e8c5ff104 SHA512 282714ef674177af58b53db9541106fac0bd54238b7e55c2754bcd553928fbc189413304471a92288139d83297b4b70330b50d5b23fa8ea078f4f1bdddaa8535 DIST cysignals-1.11.4.tar.gz 105100 BLAKE2B c21c5cae69332885dd4b9f13d0fbe9ab836466dd699f0d51908d129107ce4922f4076fafa8dce3650983fd69d25182464f9831545a8da3535699d36d198ec6a7 SHA512 b083a62bcca71634cdd21ca6c8d1363e7754ed97d6f2ad0280b0ae97fdf1264be3dc202acf67added4c12a0815420d9641269da1212b83472ea304883d3b85ab -EBUILD cysignals-1.11.4.ebuild 686 BLAKE2B 314638615f6cfdcadccd65e8467fe63091827965e6f186025d4a6dd18775b4edab2d7ecde764fc588404d3f5b07624cdc921754ce071c8d7b02c244090acfe84 SHA512 aa12fbfb6bf64a59a7acdc5c80f55a9f8722209901d24b152dd8526d8a878f0f35f048822daa455f621b9098f42c1490f4621c09373cc1797e9c2e3c7a647ce1 -MISC metadata.xml 1135 BLAKE2B e5b09338d238c7f65d9bc4878a969e66b6d29fc6dffe67b3d0d1776199c14b1717a5459776cd1afe9e11db3c1a72786c96d9b0add57b353aec564c937f6156bd SHA512 b79fdd39d4ad90cd68c224bd79398e50a6879b7c38602b50f8034f32dae1c4eaf7e8beffab5eb997a4368091fa3f52635a9e655906a27d8a6ff290ace548101c +EBUILD cysignals-1.11.4-r1.ebuild 782 BLAKE2B 97d3178eae47abda676386e6450e181412c827de3ce0e4a2f06694763726e2933c210f19b6d19bdb4a7868d6b28f26afd7490f2fd747335f699534446945c50d SHA512 d0041db24f25adae35fe82b58386c6257b32830e6e8934bab1b9ed07f34d017dc4d35262c6e70643ce13e019e1f8fd363cc3b415819641d2350e28dca69ffb38 +MISC metadata.xml 1243 BLAKE2B 468b28828e1fa906f91a23ed5e2825a77e3bad500f71e58732074abedbb11bacd1dbd6d60e49531ba2d84efa43b49ce1665158a410d5ffdd079203c294588929 SHA512 7533b618a2b050df3122aae90cb0c1dded97b82c28baca8ab7c295e7d37bcbfd0e4a762233190651e8bbadd91d901b673716aa04cf2d61b1969b2bb7a9e3be3e diff --git a/dev-python/cysignals/cysignals-1.11.4-r1.ebuild b/dev-python/cysignals/cysignals-1.11.4-r1.ebuild new file mode 100644 index 000000000000..7940ad35c445 --- /dev/null +++ b/dev-python/cysignals/cysignals-1.11.4-r1.ebuild @@ -0,0 +1,41 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..13} ) + +inherit distutils-r1 pypi + +DESCRIPTION="Interrupt and signal handling for Cython" +HOMEPAGE=" + https://github.com/sagemath/cysignals/ + https://pypi.org/project/cysignals/ +" + +# setup.py has "or later" +LICENSE="LGPL-3+" +SLOT="0" +KEYWORDS="amd64 ~riscv" + +DEPEND=" + sci-mathematics/pari:= +" +RDEPEND=" + ${DEPEND} +" +BDEPEND=" + >=dev-python/cython-3.0.0[${PYTHON_USEDEP}] +" + +PATCHES=( + # https://github.com/sagemath/cysignals/pull/204 + "${FILESDIR}/${P}-helper.patch" +) + +python_test(){ + local -x PATH="${BUILD_DIR}/scripts:${PATH}" + "${EPYTHON}" -B rundoctests.py src/cysignals/*.pyx || die +} diff --git a/dev-python/cysignals/cysignals-1.11.4.ebuild b/dev-python/cysignals/cysignals-1.11.4.ebuild deleted file mode 100644 index 8adad553bbb2..000000000000 --- a/dev-python/cysignals/cysignals-1.11.4.ebuild +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright 1999-2023 Gentoo Authors -# Distributed under the terms of the GNU General Public License v2 - -EAPI=8 - -PYTHON_COMPAT=( python3_{10..12} ) -DISTUTILS_USE_PEP517=setuptools -DISTUTILS_EXT=1 - -inherit distutils-r1 pypi - -DESCRIPTION="Interrupt and signal handling for Cython" -HOMEPAGE="https://pypi.org/project/cysignals/ - https://github.com/sagemath/cysignals" - -# setup.py has "or later" -LICENSE="LGPL-3+" -SLOT="0" -KEYWORDS="amd64" -IUSE="" - -DEPEND="sci-mathematics/pari:=" -RDEPEND="${DEPEND}" -BDEPEND=">=dev-python/cython-3.0.0[${PYTHON_USEDEP}]" - -python_test(){ - PATH="${BUILD_DIR}/scripts:${PATH}" \ - "${EPYTHON}" -B "${S}"/rundoctests.py \ - "${S}"/src/cysignals/*.pyx || die -} diff --git a/dev-python/cysignals/files/cysignals-1.11.4-helper.patch b/dev-python/cysignals/files/cysignals-1.11.4-helper.patch new file mode 100644 index 000000000000..0c09f236eccb --- /dev/null +++ b/dev-python/cysignals/files/cysignals-1.11.4-helper.patch @@ -0,0 +1,85 @@ +From 2abd7ef94775b3320b6f1954b55168e06da0e6b3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org> +Date: Sat, 6 Jul 2024 13:06:49 +0200 +Subject: [PATCH] Install cysignals-CSI-helper as package data for better + portability + +Rather than installing `cysignals-CSI-helper.py` into a `share` +directory and then trying to figure out the correct path to it, install +it as Python package data and use the standard `importlib.resources` +API to access it. For Python versions older than 3.9, +the `importlib_resources` backport is used instead. + +Fixes #200 +--- + setup.py | 4 +++- + .../cysignals-CSI-helper.py | 0 + src/scripts/cysignals-CSI | 20 ++++++++++--------- + 3 files changed, 14 insertions(+), 10 deletions(-) + rename src/{scripts => cysignals}/cysignals-CSI-helper.py (100%) + +diff --git a/setup.py b/setup.py +index 7953170..7154a4a 100755 +--- a/setup.py ++++ b/setup.py +@@ -215,7 +215,6 @@ setup( + packages=["cysignals"], + package_dir={"": "src"}, + package_data={"cysignals": ["*.pxd", "*.h"]}, +- data_files=[(opj("share", "cysignals"), [opj("src", "scripts", "cysignals-CSI-helper.py")])], + scripts=glob(opj("src", "scripts", "cysignals-CSI")), + cmdclass=dict( + configure=configure, +@@ -223,4 +222,7 @@ setup( + build_ext=build_ext, + bdist_egg=no_egg + ), ++ install_requires=[ ++ "importlib_resources; python_version < '3.9'", ++ ], + ) +diff --git a/src/scripts/cysignals-CSI-helper.py b/src/cysignals/cysignals-CSI-helper.py +similarity index 100% +rename from src/scripts/cysignals-CSI-helper.py +rename to src/cysignals/cysignals-CSI-helper.py +diff --git a/src/scripts/cysignals-CSI b/src/scripts/cysignals-CSI +index dd8b4e6..3896dca 100755 +--- a/src/scripts/cysignals-CSI ++++ b/src/scripts/cysignals-CSI +@@ -41,6 +41,11 @@ from argparse import ArgumentParser + from datetime import datetime + from distutils.spawn import find_executable + ++if sys.version_info >= (3, 9): ++ import importlib.resources as importlib_resources ++else: ++ import importlib_resources ++ + + def pid_exists(pid): + """ +@@ -65,15 +70,12 @@ def gdb_commands(pid, color): + cmds += b'import sys; sys.stdout.flush()\n' + cmds += b'end\n' + cmds += b'bt full\n' +- cysignals_share = os.path.join(os.path.dirname(sys.argv[0]), '..', +- 'share', 'cysignals') +- script = os.path.join(cysignals_share, 'cysignals-CSI-helper.py') +- with open(script, 'rb') as f: +- cmds += b'python\n' +- cmds += b'color = %r; ' % color +- cmds += b'sys_path = %r; ' % sys.path +- cmds += f.read() +- cmds += b'end\n' ++ script = importlib_resources.files('cysignals') / 'cysignals-CSI-helper.py' ++ cmds += b'python\n' ++ cmds += b'color = %r; ' % color ++ cmds += b'sys_path = %r; ' % sys.path ++ cmds += script.read_bytes() ++ cmds += b'end\n' + cmds += b'detach inferior 1\n' + cmds += b'quit\n' + return cmds +-- +2.45.2 + diff --git a/dev-python/cysignals/metadata.xml b/dev-python/cysignals/metadata.xml index abe39229c92a..14227de3e617 100644 --- a/dev-python/cysignals/metadata.xml +++ b/dev-python/cysignals/metadata.xml @@ -20,6 +20,11 @@ <name>Gentoo Mathematics Project</name> </maintainer> + <maintainer type="project"> + <email>python@gentoo.org</email> + <name>Python</name> + </maintainer> + <longdescription lang="en"> When writing Cython code, special care must be taken to ensure that the code can be interrupted with CTRL-C. Since Cython optimizes for |