From 8bf626aa197f512541fdbf3805efb9dca5c560c0 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 12:56:34 +0100 Subject: [PATCH 1/4] allow to run manually --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c5eeb68..c2fbf7c3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,8 @@ on: push: tags: - '*' + workflow_dispatch: + # Allow to run manually concurrency: # Cancel previous runs of this workflow for the same branch From 1ff620de4a0d93ccf81a7b309cee475f5abac674 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 30 May 2022 20:06:02 +0200 Subject: [PATCH 2/4] call cysignals hook --- cypari2/__init__.py | 3 +++ cypari2/custom_block.pyx | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 cypari2/custom_block.pyx diff --git a/cypari2/__init__.py b/cypari2/__init__.py index 1700c125..dbbade7e 100644 --- a/cypari2/__init__.py +++ b/cypari2/__init__.py @@ -1,3 +1,6 @@ from .pari_instance import Pari from .handle_error import PariError from .gen import Gen +from .custom_block import init_custom_block + +init_custom_block() diff --git a/cypari2/custom_block.pyx b/cypari2/custom_block.pyx new file mode 100644 index 00000000..ded0908f --- /dev/null +++ b/cypari2/custom_block.pyx @@ -0,0 +1,27 @@ +# distutils: libraries = gmp pari + +#***************************************************************************** +# Distributed under the terms of the GNU General Public License (GPL) +# as published by the Free Software Foundation; either version 2 of +# the License, or (at your option) any later version. +# http://www.gnu.org/licenses/ +#***************************************************************************** + +from cysignals.signals cimport add_custom_signals + +cdef extern from "pari/pari.h": + int PARI_SIGINT_block, PARI_SIGINT_pending + +cdef int custom_signal_is_blocked(): + return PARI_SIGINT_block + +cdef void custom_signal_unblock(): + PARI_SIGINT_block = 0 + +cdef void custom_set_pending_signal(int sig): + PARI_SIGINT_pending = sig + +def init_custom_block(): + add_custom_signals(&custom_signal_is_blocked, + &custom_signal_unblock, + &custom_set_pending_signal) From 129cd6bd2580d8ac975cbe3158c59fbe8b22eefb Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Tue, 31 May 2022 16:09:56 +0200 Subject: [PATCH 3/4] specify that variables are global --- cypari2/custom_block.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cypari2/custom_block.pyx b/cypari2/custom_block.pyx index ded0908f..ddbb8293 100644 --- a/cypari2/custom_block.pyx +++ b/cypari2/custom_block.pyx @@ -16,9 +16,11 @@ cdef int custom_signal_is_blocked(): return PARI_SIGINT_block cdef void custom_signal_unblock(): + global PARI_SIGINT_block PARI_SIGINT_block = 0 cdef void custom_set_pending_signal(int sig): + global PARI_SIGINT_pending PARI_SIGINT_pending = sig def init_custom_block(): From c3c4d3b9e5861de70e5c49e1a367375b6de219a7 Mon Sep 17 00:00:00 2001 From: Matthias Koeppe Date: Sun, 24 Mar 2024 19:10:29 -0700 Subject: [PATCH 4/4] pyproject.toml: Require cysignals >= 1.11.3 --- NEWS | 5 +++++ pyproject.toml | 10 ++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 8a9369be..3734062e 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,11 @@ cypari2 change log ================== +v2.2.0 (in development) +------ + +- require cysignals >= 1.11.3 + v2.1.5 ------ diff --git a/pyproject.toml b/pyproject.toml index a2c57359..f2c56580 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,9 @@ [build-system] -requires = ["setuptools", - "Cython>=3.0", - "cysignals>=1.7"] +requires = [ + "setuptools", + "Cython>=3.0", + "cysignals>=1.11.3", +] # We need access to the autogen package at build time. # Hence we declare a custom build backend. build-backend = "_custom_build_meta" # just re-exports setuptools.build_meta definitions @@ -17,7 +19,7 @@ maintainers = [ {name = "SageMath developers", email = "sage-devel@googlegroups.com"}, ] dependencies = [ - "cysignals>=1.7", + "cysignals>=1.11.3", ] requires-python = ">=3.9" readme = "README.rst"