* [PR PATCH] update to python3-{cysignals-1.12.2,cypari-2.2.1,fpylll-0.6.3}
@ 2025-01-23 3:42 tornaria
2025-01-23 3:58 ` [PR PATCH] [Merged]: " ahesford
0 siblings, 1 reply; 2+ messages in thread
From: tornaria @ 2025-01-23 3:42 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1379 bytes --]
There is a new pull request by tornaria against master on the void-packages repository
https://github.com/tornaria/void-packages cysignals
https://github.com/void-linux/void-packages/pull/54084
update to python3-{cysignals-1.12.2,cypari-2.2.1,fpylll-0.6.3}
- **python3-cysignals: update to 1.12.2.**
- **python3-cypari2: update to 2.2.1.**
- **python3-fpylll: update to 0.6.3.**
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
A patch file from https://github.com/void-linux/void-packages/pull/54084.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-cysignals-54084.patch --]
[-- Type: text/x-diff, Size: 32987 bytes --]
From a81cf84db6ea68a9056332f13c09d580d6690aa1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 23 Dec 2024 13:49:34 -0300
Subject: [PATCH 1/3] python3-cysignals: update to 1.12.2.
---
.../patches/216-fix_custom_signal.patch | 54 +++++++++++++++++++
.../patches/222-fix_data_race.patch | 51 ++++++++++++++++++
.../python3-cysignals/patches/fix-cross.patch | 23 --------
.../patches/verify_exc_value.patch | 22 --------
srcpkgs/python3-cysignals/template | 36 +++++--------
5 files changed, 119 insertions(+), 67 deletions(-)
create mode 100644 srcpkgs/python3-cysignals/patches/216-fix_custom_signal.patch
create mode 100644 srcpkgs/python3-cysignals/patches/222-fix_data_race.patch
delete mode 100644 srcpkgs/python3-cysignals/patches/fix-cross.patch
delete mode 100644 srcpkgs/python3-cysignals/patches/verify_exc_value.patch
diff --git a/srcpkgs/python3-cysignals/patches/216-fix_custom_signal.patch b/srcpkgs/python3-cysignals/patches/216-fix_custom_signal.patch
new file mode 100644
index 00000000000000..ced6b8732c579c
--- /dev/null
+++ b/srcpkgs/python3-cysignals/patches/216-fix_custom_signal.patch
@@ -0,0 +1,54 @@
+Taken from https://github.com/sagemath/cysignals/pull/222
+
+diff --git a/pyproject.toml b/pyproject.toml
+index d30ad23..edcb5c8 100644
+--- a/pyproject.toml
++++ b/pyproject.toml
+@@ -34,4 +34,4 @@ requires-python = ">=3.9"
+
+ [tool.pytest.ini_options]
+ addopts = "--doctest-modules --import-mode importlib"
+-norecursedirs = "builddir docs example"
++testpaths = "src tests"
+diff --git a/src/cysignals/implementation.c b/src/cysignals/implementation.c
+index 20a83d0..18b8144 100644
+--- a/src/cysignals/implementation.c
++++ b/src/cysignals/implementation.c
+@@ -591,7 +591,7 @@ static void _sig_on_interrupt_received(void)
+ do_raise_exception(cysigs.interrupt_received);
+ cysigs.sig_on_count = 0;
+ cysigs.interrupt_received = 0;
+- custom_signal_unblock();
++ custom_set_pending_signal(0);
+
+ #if HAVE_SIGPROCMASK
+ sigprocmask(SIG_SETMASK, &oldset, NULL);
+diff --git a/tests/test_custom_signals.py b/tests/test_custom_signals.py
+new file mode 100644
+index 0000000..0afc36f
+--- /dev/null
++++ b/tests/test_custom_signals.py
+@@ -0,0 +1,23 @@
++"""
++Tests for custom signals.
++"""
++
++import time
++import pytest
++
++def test_clear_pending():
++ """
++ Regression test for https://github.com/sagemath/cysignals/pull/216
++ """
++
++ alarm = pytest.importorskip("cysignals.alarm") # n/a on windows
++ cypari2 = pytest.importorskip("cypari2")
++
++ with pytest.raises(alarm.AlarmInterrupt):
++ alarm.alarm(0.01)
++ time.sleep(1)
++
++ try:
++ cypari2.Pari()
++ except alarm.AlarmInterrupt:
++ pytest.fail("AlarmInterrupt was not cleared")
diff --git a/srcpkgs/python3-cysignals/patches/222-fix_data_race.patch b/srcpkgs/python3-cysignals/patches/222-fix_data_race.patch
new file mode 100644
index 00000000000000..c9fdf3885f5c22
--- /dev/null
+++ b/srcpkgs/python3-cysignals/patches/222-fix_data_race.patch
@@ -0,0 +1,51 @@
+Taken from https://github.com/sagemath/cysignals/pull/222
+
+diff --git a/src/cysignals/signals.pyx b/src/cysignals/signals.pyx
+index 72f206e..96a99ad 100644
+--- a/src/cysignals/signals.pyx
++++ b/src/cysignals/signals.pyx
+@@ -25,7 +25,7 @@ See ``tests.pyx`` for extensive tests.
+
+ from libc.signal cimport *
+ from libc.stdio cimport freopen, stdin
+-from cpython.ref cimport Py_XINCREF, Py_XDECREF
++from cpython.ref cimport Py_XINCREF, Py_CLEAR
+ from cpython.exc cimport (PyErr_Occurred, PyErr_NormalizeException,
+ PyErr_Fetch, PyErr_Restore)
+ from cpython.version cimport PY_MAJOR_VERSION
+@@ -204,7 +204,7 @@ cdef int sig_raise_exception "sig_raise_exception"(int sig, const char* msg) exc
+ PyErr_Fetch(&typ, &val, &tb)
+ PyErr_NormalizeException(&typ, &val, &tb)
+ Py_XINCREF(val)
+- Py_XDECREF(cysigs.exc_value)
++ Py_CLEAR(cysigs.exc_value)
+ cysigs.exc_value = val
+ PyErr_Restore(typ, val, tb)
+
+@@ -362,8 +362,7 @@ cdef void verify_exc_value() noexcept:
+ """
+ if cysigs.exc_value.ob_refcnt == 1:
+ # No other references => exception is certainly gone
+- Py_XDECREF(cysigs.exc_value)
+- cysigs.exc_value = NULL
++ Py_CLEAR(cysigs.exc_value)
+ return
+
+ if PyErr_Occurred() is not NULL:
+@@ -394,8 +393,7 @@ cdef void verify_exc_value() noexcept:
+ pass
+ else:
+ if <PyObject*>handled is cysigs.exc_value:
+- Py_XDECREF(cysigs.exc_value)
+- cysigs.exc_value = NULL
++ Py_CLEAR(cysigs.exc_value)
+ return
+
+ # To be safe, we run the garbage collector because it may clear
+@@ -411,5 +409,4 @@ cdef void verify_exc_value() noexcept:
+ # called again during garbage collection it might have already been set
+ # to NULL; see https://github.com/sagemath/cysignals/issues/126
+ if cysigs.exc_value != NULL and cysigs.exc_value.ob_refcnt == 1:
+- Py_XDECREF(cysigs.exc_value)
+- cysigs.exc_value = NULL
++ Py_CLEAR(cysigs.exc_value)
diff --git a/srcpkgs/python3-cysignals/patches/fix-cross.patch b/srcpkgs/python3-cysignals/patches/fix-cross.patch
deleted file mode 100644
index 8d08c516e0eb14..00000000000000
--- a/srcpkgs/python3-cysignals/patches/fix-cross.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff --git a/configure.ac b/configure.ac
-index d0624ec..f5a6786 100644
---- a/configure.ac
-+++ b/configure.ac
-@@ -48,7 +48,7 @@ fi
- AC_MSG_CHECKING([for emms instruction])
- # We add the "leal" instruction to reduce false positives in case some
- # non-x86 architecture also has an "emms" instruction.
--AC_RUN_IFELSE([AC_LANG_PROGRAM([[]], [[asm("leal (%eax), %eax; emms");]])],
-+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[asm("leal (%eax), %eax; emms");]])],
- dnl YES
- [AC_MSG_RESULT([yes])]
- AC_DEFINE(HAVE_EMMS, 1, [Define to 1 if your processor understands the "emms" instruction.])
-@@ -84,6 +84,9 @@ AC_RUN_IFELSE([AC_LANG_PROGRAM(
- ,
- dnl NO
- [AC_MSG_RESULT([no])]
-+ ,
-+ [AC_MSG_RESULT([cross, assume yes])]
-+ sigsetjmp=yes
- )
-
- AC_MSG_CHECKING([for GNU libc])
diff --git a/srcpkgs/python3-cysignals/patches/verify_exc_value.patch b/srcpkgs/python3-cysignals/patches/verify_exc_value.patch
deleted file mode 100644
index f5e7077c5ce235..00000000000000
--- a/srcpkgs/python3-cysignals/patches/verify_exc_value.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/cysignals/signals.pyx b/src/cysignals/signals.pyx
-index 114a156..4bb7476 100644
---- a/src/cysignals/signals.pyx
-+++ b/src/cysignals/signals.pyx
-@@ -376,7 +376,7 @@ cdef void verify_exc_value() noexcept:
- # to the exception.
- try:
- handled = sys.last_value
-- except AttributeError:
-+ except:
- pass
- else:
- if <PyObject*>handled is cysigs.exc_value:
-@@ -388,7 +388,7 @@ cdef void verify_exc_value() noexcept:
- # references to our exception.
- try:
- collect()
-- except Exception:
-+ except:
- # This can happen when Python is shutting down and the gc module
- # is not functional anymore.
- pass
diff --git a/srcpkgs/python3-cysignals/template b/srcpkgs/python3-cysignals/template
index 212dd5ee7ab69f..b2bb20342806b1 100644
--- a/srcpkgs/python3-cysignals/template
+++ b/srcpkgs/python3-cysignals/template
@@ -1,33 +1,25 @@
# Template file for 'python3-cysignals'
pkgname=python3-cysignals
-version=1.11.4
-revision=3
-# need gnu-configure build style to support cross build
-build_style=gnu-configure
-build_helper=python3
-hostmakedepends="python3-setuptools python3-wheel python3-Cython
- python3-build python3-installer autoconf"
-makedepends="python3-devel pari-devel"
+version=1.12.2
+revision=1
+build_style=python3-pep517
+build_helper=meson
+hostmakedepends="python3-meson-python python3-Cython"
+makedepends="python3-devel"
depends="python3"
+checkdepends="python3-pytest gdb"
short_desc="Interrupt and signal handling for Cython"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="LGPL-3.0-or-later"
homepage="https://github.com/sagemath/cysignals"
changelog="https://github.com/sagemath/cysignals/releases"
distfiles="${PYPI_SITE}/c/cysignals/cysignals-${version}.tar.gz"
-checksum=0f1e321e55a07f901c86a36a1e4497f6ff9dfe700681d0130a38c36e4eb238c3
+checksum=407db178fb18a91118ca742ede62000b2bee62b617eb49d26fcdad7e9ba2771a
-post_patch() {
- # run autoconf because we patched configure.ac
- autoconf
-}
+# cysignals must be compiled without _FORTIFY_SOURCE
+CFLAGS="-U_FORTIFY_SOURCE"
-do_build() {
- # build as in python3-pep517 build style
- python3 -m build --no-isolation --wheel .
-}
-
-do_install() {
- # install as in python3-pep517 build style
- python3 -m installer --destdir ${DESTDIR} --no-compile-bytecode dist/*.whl
-}
+if [ "$XBPS_CHECK_PKGS" = full ]; then
+ # this would cause a build-time circular dependency
+ checkdepends+=" python3-cypari2"
+fi
From 998317ac636b66c5a4455c69a1726eacad57ceea Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 6 Jan 2025 23:22:29 -0300
Subject: [PATCH 2/3] python3-cypari2: update to 2.2.1.
---
srcpkgs/python3-cypari2/patches/165.patch | 38 --
srcpkgs/python3-cypari2/patches/166.diff | 447 ----------------------
srcpkgs/python3-cypari2/patches/167.diff | 38 --
srcpkgs/python3-cypari2/template | 6 +-
4 files changed, 3 insertions(+), 526 deletions(-)
delete mode 100644 srcpkgs/python3-cypari2/patches/165.patch
delete mode 100644 srcpkgs/python3-cypari2/patches/166.diff
delete mode 100644 srcpkgs/python3-cypari2/patches/167.diff
diff --git a/srcpkgs/python3-cypari2/patches/165.patch b/srcpkgs/python3-cypari2/patches/165.patch
deleted file mode 100644
index e7e01b71c06fcb..00000000000000
--- a/srcpkgs/python3-cypari2/patches/165.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-See: https://github.com/sagemath/cypari2/pull/165
-and https://github.com/sagemath/sage/pull/38749
-
-From 0a5a7b42e53d065f8d78bdaa8181d6afa20d1f4f Mon Sep 17 00:00:00 2001
-From: Antonio Rojas <arojas@archlinux.org>
-Date: Tue, 1 Oct 2024 18:54:19 +0200
-Subject: [PATCH] Add pari_PRIMES declaration
-
-Needed to port sagemath to work with pari 2.17
----
- cypari2/paridecl.pxd | 1 +
- cypari2/types.pxd | 1 +
- 2 files changed, 2 insertions(+)
-
-diff --git a/cypari2/paridecl.pxd b/cypari2/paridecl.pxd
-index 29cb8ef..9ccf336 100644
---- a/cypari2/paridecl.pxd
-+++ b/cypari2/paridecl.pxd
-@@ -118,6 +118,7 @@ cdef extern from *: # PARI headers already included by types.pxd
- extern PariOUT* pariOut
- extern PariOUT* pariErr
- extern byteptr diffptr
-+ extern pari_prime* pari_PRIMES
-
- ###############################################
- # #
-diff --git a/cypari2/types.pxd b/cypari2/types.pxd
-index 9ee4fe6..7f00b52 100644
---- a/cypari2/types.pxd
-+++ b/cypari2/types.pxd
-@@ -24,6 +24,7 @@ cdef extern from "pari/pari.h":
- ctypedef long* GEN
- ctypedef char* byteptr
- ctypedef unsigned long pari_sp
-+ ctypedef unsigned long pari_prime
-
- # PARI types
- enum:
diff --git a/srcpkgs/python3-cypari2/patches/166.diff b/srcpkgs/python3-cypari2/patches/166.diff
deleted file mode 100644
index 2c9d57ed291a11..00000000000000
--- a/srcpkgs/python3-cypari2/patches/166.diff
+++ /dev/null
@@ -1,447 +0,0 @@
-Adapt to precision changes in pari 2.17
-
-See: https://github.com/sagemath/cypari2/pull/166
-
-diff --git a/autogen/args.py b/autogen/args.py
-index cd84008..02c57b9 100644
---- a/autogen/args.py
-+++ b/autogen/args.py
-@@ -304,11 +304,11 @@ def _typerepr(self):
- def ctype(self):
- return "long"
- def always_default(self):
-- return "0"
-+ return "DEFAULT_BITPREC"
- def get_argument_name(self, namesiter):
- return "precision"
- def c_convert_code(self):
-- s = " {name} = prec_bits_to_words({name})\n"
-+ s = " {name} = nbits2prec({name})\n"
- return s.format(name=self.name)
-
- class PariArgumentBitprec(PariArgumentClass):
-@@ -317,13 +317,9 @@ def _typerepr(self):
- def ctype(self):
- return "long"
- def always_default(self):
-- return "0"
-+ return "DEFAULT_BITPREC"
- def get_argument_name(self, namesiter):
- return "precision"
-- def c_convert_code(self):
-- s = " if not {name}:\n"
-- s += " {name} = default_bitprec()\n"
-- return s.format(name=self.name)
-
- class PariArgumentSeriesPrec(PariArgumentClass):
- def _typerepr(self):
-diff --git a/autogen/doc.py b/autogen/doc.py
-index 711827b..c71e7c6 100644
---- a/autogen/doc.py
-+++ b/autogen/doc.py
-@@ -289,7 +289,7 @@ def get_rest_doc(function):
- >>> from autogen.doc import get_rest_doc
- >>> print(get_rest_doc("teichmuller"))
- Teichmüller character of the :math:`p`-adic number :math:`x`, i.e. the unique
-- :math:`(p-1)`-th root of unity congruent to :math:`x / p^{v_p(x)}` modulo :math:`p`...
-+ :math:`(p-1)`-th root of unity congruent to :math:`x / p^{v_...(x)}` modulo :math:`p`...
-
- ::
-
-@@ -300,24 +300,24 @@ def get_rest_doc(function):
- .. MATH::
- <BLANKLINE>
- f(x) = \exp (-i\pi/24).\eta ((x+1)/2)/\eta (x) {such that}
-- j = (f^{24}-16)^3/f^{24},
-+ j = (f^{24}-16)^.../f^{24},
- <BLANKLINE>
- where :math:`j` is the elliptic :math:`j`-invariant (see the function :literal:`ellj`).
- If :math:`flag = 1`, returns
- <BLANKLINE>
- .. MATH::
- <BLANKLINE>
-- f_1(x) = \eta (x/2)/\eta (x) {such that}
-- j = (f_1^{24}+16)^3/f_1^{24}.
-+ f_...(x) = \eta (x/2)/\eta (x) {such that}
-+ j = (f_...^{24}+16)^.../f_...^{24}.
- <BLANKLINE>
- Finally, if :math:`flag = 2`, returns
- <BLANKLINE>
- .. MATH::
- <BLANKLINE>
-- f_2(x) = \sqrt{2}\eta (2x)/\eta (x) {such that}
-- j = (f_2^{24}+16)^3/f_2^{24}.
-+ f_...(x) = \sqrt{2}\eta (2x)/\eta (x) {such that}
-+ j = (f_...^{24}+16)^.../f_...^{24}.
- <BLANKLINE>
-- Note the identities :math:`f^8 = f_1^8+f_2^8` and :math:`ff_1f_2 = \sqrt2`.
-+ Note the identities :math:`f^... = f_...^...+f_...^...` and :math:`ff_...f_... = \sqrt2`.
-
-
- ::
-@@ -333,7 +333,7 @@ def get_rest_doc(function):
- .. MATH::
- <BLANKLINE>
- \sum
-- (x_i or y_i) 2^i
-+ (x_... or y_...) 2^...
- <BLANKLINE>
- See ``bitand`` (in the PARI manual) for the behavior for negative arguments.
- """
-diff --git a/autogen/generator.py b/autogen/generator.py
-index 048adce..4154723 100644
---- a/autogen/generator.py
-+++ b/autogen/generator.py
-@@ -139,7 +139,7 @@ def handle_pari_function(self, function, cname, prototype="", help="", obsolete=
- ... help=r"bnfinit(P,{flag=0},{tech=[]}): compute...",
- ... **{"class":"basic", "section":"number_fields"})
- GEN bnfinit0(GEN, long, GEN, long)
-- def bnfinit(P, long flag=0, tech=None, long precision=0):
-+ def bnfinit(P, long flag=0, tech=None, long precision=DEFAULT_BITPREC):
- ...
- cdef bint _have_tech = (tech is not None)
- if _have_tech:
-@@ -149,7 +149,7 @@ def bnfinit(P, long flag=0, tech=None, long precision=0):
- cdef GEN _tech = NULL
- if _have_tech:
- _tech = (<Gen>tech).g
-- precision = prec_bits_to_words(precision)
-+ precision = nbits2prec(precision)
- cdef GEN _ret = bnfinit0(_P, flag, _tech, precision)
- return new_gen(_ret)
- <BLANKLINE>
-diff --git a/autogen/parser.py b/autogen/parser.py
-index d910946..a7fe02f 100644
---- a/autogen/parser.py
-+++ b/autogen/parser.py
-@@ -109,7 +109,7 @@ def parse_prototype(proto, help, initial_args=[]):
- >>> parse_prototype(proto, help)
- ([GEN x, GEN* r=NULL], GEN)
- >>> parse_prototype("lp", "foo()", [str("TEST")])
-- (['TEST', prec precision=0], long)
-+ (['TEST', prec precision=DEFAULT_BITPREC], long)
- """
- # Use the help string just for the argument names.
- # "names" should be an iterator over the argument names.
-diff --git a/cypari2/gen.pyx b/cypari2/gen.pyx
-index a109244..d910ae5 100644
---- a/cypari2/gen.pyx
-+++ b/cypari2/gen.pyx
-@@ -66,8 +66,7 @@ from .types cimport *
- from .string_utils cimport to_string, to_bytes
- from .paripriv cimport *
- from .convert cimport PyObject_AsGEN, gen_to_integer
--from .pari_instance cimport (prec_bits_to_words,
-- default_bitprec, get_var)
-+from .pari_instance cimport DEFAULT_BITPREC, get_var
- from .stack cimport (new_gen, new_gens2, new_gen_noclear,
- clone_gen, clear_stack, reset_avma,
- remove_from_pari_stack, move_gens_to_heap)
-@@ -647,7 +646,7 @@ cdef class Gen(Gen_base):
- if m is not None:
- t0 = t0.Mod(m)
- sig_on()
-- return new_gen(gpow(t0.g, t1.g, prec_bits_to_words(0)))
-+ return new_gen(gpow(t0.g, t1.g, nbits2prec(DEFAULT_BITPREC)))
-
- def __neg__(self):
- sig_on()
-@@ -902,6 +901,7 @@ cdef class Gen(Gen_base):
-
- >>> x = pari('x')
-
-+ >>> pari.setrand(1)
- >>> (x**2 - 65).bnfinit().bnf_get_fu()
- [Mod(x - 8, x^2 - 65)]
- >>> (x**4 - x**2 + 1).bnfinit().bnf_get_fu()
-@@ -951,6 +951,7 @@ cdef class Gen(Gen_base):
- >>> import warnings
- >>> with warnings.catch_warnings(record=True) as w:
- ... warnings.simplefilter('always')
-+ ... pari.setrand(1)
- ... funits = (x**2 - 65).bnfinit().bnfunit()
- ... assert len(w) == 1
- ... assert issubclass(w[0].category, DeprecationWarning)
-@@ -2911,7 +2912,7 @@ cdef class Gen(Gen_base):
- sig_on()
- return new_gen(bernfrac(self))
-
-- def bernreal(self, unsigned long precision=0):
-+ def bernreal(self, unsigned long precision=DEFAULT_BITPREC):
- r"""
- The Bernoulli number `B_x`, as for the function bernfrac,
- but `B_x` is returned as a real number (with the current
-@@ -2926,9 +2927,9 @@ cdef class Gen(Gen_base):
- 54.9711779448622
- """
- sig_on()
-- return new_gen(bernreal(self, prec_bits_to_words(precision)))
-+ return new_gen(bernreal(self, nbits2prec(precision)))
-
-- def besselk(nu, x, unsigned long precision=0):
-+ def besselk(nu, x, unsigned long precision=DEFAULT_BITPREC):
- """
- nu.besselk(x): K-Bessel function (modified Bessel function
- of the second kind) of index nu, which can be complex, and argument
-@@ -2963,9 +2964,9 @@ cdef class Gen(Gen_base):
- """
- cdef Gen t0 = objtogen(x)
- sig_on()
-- return new_gen(kbessel(nu.g, t0.g, prec_bits_to_words(precision)))
-+ return new_gen(kbessel(nu.g, t0.g, nbits2prec(precision)))
-
-- def eint1(x, long n=0, unsigned long precision=0):
-+ def eint1(x, long n=0, unsigned long precision=DEFAULT_BITPREC):
- r"""
- x.eint1(n): exponential integral E1(x):
-
-@@ -2991,13 +2992,14 @@ cdef class Gen(Gen_base):
- """
- sig_on()
- if n <= 0:
-- return new_gen(eint1(x.g, prec_bits_to_words(precision)))
-+ return new_gen(eint1(x.g, nbits2prec(precision)))
- else:
-- return new_gen(veceint1(x.g, stoi(n), prec_bits_to_words(precision)))
-+ return new_gen(veceint1(x.g, stoi(n), nbits2prec(precision)))
-
- log_gamma = Gen_base.lngamma
-
-- def polylog(x, long m, long flag=0, unsigned long precision=0):
-+ def polylog(x, long m, long flag=0,
-+ unsigned long precision=DEFAULT_BITPREC):
- """
- x.polylog(m,flag=0): m-th polylogarithm of x. flag is optional, and
- can be 0: default, 1: D_m -modified m-th polylog of x, 2:
-@@ -3026,9 +3028,9 @@ cdef class Gen(Gen_base):
- -0.400459056163451
- """
- sig_on()
-- return new_gen(polylog0(m, x.g, flag, prec_bits_to_words(precision)))
-+ return new_gen(polylog0(m, x.g, flag, nbits2prec(precision)))
-
-- def sqrtn(x, n, unsigned long precision=0):
-+ def sqrtn(x, n, unsigned long precision=DEFAULT_BITPREC):
- r"""
- x.sqrtn(n): return the principal branch of the n-th root of x,
- i.e., the one such that
-@@ -3090,7 +3092,7 @@ cdef class Gen(Gen_base):
- cdef GEN ans, zetan
- cdef Gen t0 = objtogen(n)
- sig_on()
-- ans = gsqrtn(x.g, t0.g, &zetan, prec_bits_to_words(precision))
-+ ans = gsqrtn(x.g, t0.g, &zetan, nbits2prec(precision))
- return new_gens2(ans, zetan)
-
- def ffprimroot(self):
-@@ -4531,7 +4533,8 @@ cdef class Gen(Gen_base):
- g = polint(self.g, t0.g, t1.g, &dy)
- return new_gens2(g, dy)
-
-- def ellwp(self, z='z', long n=20, long flag=0, unsigned long precision=0):
-+ def ellwp(self, z='z', long n=20, long flag=0,
-+ unsigned long precision=DEFAULT_BITPREC):
- """
- Return the value or the series expansion of the Weierstrass
- `P`-function at `z` on the lattice `self` (or the lattice
-@@ -4609,7 +4612,7 @@ cdef class Gen(Gen_base):
- elif typ(g0) == t_RFRAC:
- g0 = rfrac_to_ser(g0, n+4)
-
-- cdef GEN r = ellwp0(self.g, g0, flag, prec_bits_to_words(precision))
-+ cdef GEN r = ellwp0(self.g, g0, flag, nbits2prec(precision))
- if flag == 1 and have_ellwp_flag1_bug():
- # Work around ellwp() bug: double the second element
- set_gel(r, 2, gmulgs(gel(r, 2), 2))
-diff --git a/cypari2/pari_instance.pxd b/cypari2/pari_instance.pxd
-index f239487..d6a75a7 100644
---- a/cypari2/pari_instance.pxd
-+++ b/cypari2/pari_instance.pxd
-@@ -3,10 +3,16 @@ cimport cython
-
- from .gen cimport Gen
-
--cpdef long prec_bits_to_words(unsigned long prec_in_bits) noexcept
-+# DEPRECATED INTERNAL FUNCTION used (incorrectly) in sagemath < 10.5
- cpdef long prec_words_to_bits(long prec_in_words) noexcept
- cpdef long default_bitprec() noexcept
-
-+cdef extern from *:
-+ """
-+ #define DEFAULT_BITPREC prec2nbits(DEFAULTPREC)
-+ """
-+ long DEFAULT_BITPREC
-+
- cdef class Pari_auto:
- pass
-
-diff --git a/cypari2/pari_instance.pyx b/cypari2/pari_instance.pyx
-index 65d705a..3e21a7d 100644
---- a/cypari2/pari_instance.pyx
-+++ b/cypari2/pari_instance.pyx
-@@ -235,9 +235,9 @@ Verify that ``nfroots()`` (which has an unusual signature with a
- non-default argument following a default argument) works:
-
- >>> pari.nfroots(x='x^4 - 1')
--[-1, 1]
-+[-1, 1]...
- >>> pari.nfroots(pari.nfinit('t^2 + 1'), "x^4 - 1")
--[-1, 1, Mod(-t, t^2 + 1), Mod(t, t^2 + 1)]
-+[-1, 1, Mod(-t, t^2 + 1), Mod(t, t^2 + 1)]...
-
- Reset default precision for the following tests:
-
-@@ -299,10 +299,6 @@ from .stack cimport (new_gen, new_gen_noclear, clear_stack,
- from .handle_error cimport _pari_init_error_handling
- from .closure cimport _pari_init_closure
-
--# Default precision (in PARI words) for the PARI library interface,
--# when no explicit precision is given and the inputs are exact.
--cdef long prec = prec_bits_to_words(53)
--
-
- #################################################################
- # conversions between various real precision models
-@@ -341,36 +337,10 @@ def prec_dec_to_bits(long prec_in_dec):
- return int(prec_in_dec*log_10 + 1.0) # Add one to round up
-
-
--cpdef long prec_bits_to_words(unsigned long prec_in_bits) noexcept:
-- r"""
-- Convert from precision expressed in bits to pari real precision
-- expressed in words. Note: this rounds up to the nearest word,
-- adjusts for the two codewords of a pari real, and is
-- architecture-dependent.
--
-- Examples:
--
-- >>> from cypari2.pari_instance import prec_bits_to_words
-- >>> import sys
-- >>> bitness = '64' if sys.maxsize > (1 << 32) else '32'
-- >>> prec_bits_to_words(70) == (5 if bitness == '32' else 4)
-- True
--
-- >>> ans32 = [(32, 3), (64, 4), (96, 5), (128, 6), (160, 7), (192, 8), (224, 9), (256, 10)]
-- >>> ans64 = [(32, 3), (64, 3), (96, 4), (128, 4), (160, 5), (192, 5), (224, 6), (256, 6)]
-- >>> [(32*n, prec_bits_to_words(32*n)) for n in range(1, 9)] == (ans32 if bitness == '32' else ans64)
-- True
-- """
-- if not prec_in_bits:
-- return prec
-- cdef unsigned long wordsize = BITS_IN_LONG
--
-- # This equals ceil(prec_in_bits/wordsize) + 2
-- return (prec_in_bits - 1)//wordsize + 3
--
--
- cpdef long prec_words_to_bits(long prec_in_words) noexcept:
- r"""
-+ Deprecated internal function. Used (incorrectly) in sagemath < 10.5.
-+
- Convert from pari real precision expressed in words to precision
- expressed in bits. Note: this adjusts for the two codewords of a
- pari real, and is architecture-dependent.
-@@ -379,6 +349,8 @@ cpdef long prec_words_to_bits(long prec_in_words) noexcept:
-
- >>> from cypari2.pari_instance import prec_words_to_bits
- >>> import sys
-+ >>> import warnings
-+ >>> warnings.simplefilter("ignore")
- >>> bitness = '64' if sys.maxsize > (1 << 32) else '32'
- >>> prec_words_to_bits(10) == (256 if bitness == '32' else 512)
- True
-@@ -388,6 +360,9 @@ cpdef long prec_words_to_bits(long prec_in_words) noexcept:
- >>> [(n, prec_words_to_bits(n)) for n in range(3, 10)] == (ans32 if bitness == '32' else ans64)
- True
- """
-+ from warnings import warn
-+ warn("'prec_words_to_bits` in cypari2 is internal and deprecated",
-+ DeprecationWarning)
- # see user's guide to the pari library, page 10
- return (prec_in_words - 2) * BITS_IN_LONG
-
-@@ -402,51 +377,7 @@ cpdef long default_bitprec() noexcept:
- >>> default_bitprec()
- 64
- """
-- return (prec - 2) * BITS_IN_LONG
--
--
--def prec_dec_to_words(long prec_in_dec):
-- r"""
-- Convert from precision expressed in decimal to precision expressed
-- in words. Note: this rounds up to the nearest word, adjusts for the
-- two codewords of a pari real, and is architecture-dependent.
--
-- Examples:
--
-- >>> from cypari2.pari_instance import prec_dec_to_words
-- >>> import sys
-- >>> bitness = '64' if sys.maxsize > (1 << 32) else '32'
-- >>> prec_dec_to_words(38) == (6 if bitness == '32' else 4)
-- True
--
-- >>> ans32 = [(10, 4), (20, 5), (30, 6), (40, 7), (50, 8), (60, 9), (70, 10), (80, 11)]
-- >>> ans64 = [(10, 3), (20, 4), (30, 4), (40, 5), (50, 5), (60, 6), (70, 6), (80, 7)] # 64-bit
-- >>> [(n, prec_dec_to_words(n)) for n in range(10, 90, 10)] == (ans32 if bitness == '32' else ans64)
-- True
-- """
-- return prec_bits_to_words(prec_dec_to_bits(prec_in_dec))
--
--
--def prec_words_to_dec(long prec_in_words):
-- r"""
-- Convert from precision expressed in words to precision expressed in
-- decimal. Note: this adjusts for the two codewords of a pari real,
-- and is architecture-dependent.
--
-- Examples:
--
-- >>> from cypari2.pari_instance import prec_words_to_dec
-- >>> import sys
-- >>> bitness = '64' if sys.maxsize > (1 << 32) else '32'
-- >>> prec_words_to_dec(5) == (28 if bitness == '32' else 57)
-- True
--
-- >>> ans32 = [(3, 9), (4, 19), (5, 28), (6, 38), (7, 48), (8, 57), (9, 67)]
-- >>> ans64 = [(3, 19), (4, 38), (5, 57), (6, 77), (7, 96), (8, 115), (9, 134)]
-- >>> [(n, prec_words_to_dec(n)) for n in range(3, 10)] == (ans32 if bitness == '32' else ans64)
-- True
-- """
-- return prec_bits_to_dec(prec_words_to_bits(prec_in_words))
-+ return DEFAULT_BITPREC
-
-
- # Callbacks from PARI to print stuff using sys.stdout.write() instead
-diff --git a/cypari2/paridecl.pxd b/cypari2/paridecl.pxd
-index 9ccf336..7b8d12d 100644
---- a/cypari2/paridecl.pxd
-+++ b/cypari2/paridecl.pxd
-@@ -5107,6 +5107,7 @@ cdef extern from *: # PARI headers already included by types.pxd
- void killblock(GEN x)
- GEN leading_coeff(GEN x)
- void lg_increase(GEN x)
-+ long lg2prec(long x)
- long lgcols(GEN x)
- long lgpol(GEN x)
- GEN matpascal(long n)
-@@ -5196,6 +5197,7 @@ cdef extern from *: # PARI headers already included by types.pxd
- GEN polx_zx(long sv)
- GEN powii(GEN x, GEN n)
- GEN powIs(long n)
-+ long prec2lg(long x)
- long prec2nbits(long x)
- double prec2nbits_mul(long x, double y)
- long prec2ndec(long x)
-diff --git a/cypari2/types.pxd b/cypari2/types.pxd
-index 7f00b52..2c6487d 100644
---- a/cypari2/types.pxd
-+++ b/cypari2/types.pxd
-@@ -53,6 +53,7 @@ cdef extern from "pari/pari.h":
- t_INFINITY
-
- int BITS_IN_LONG
-+ int LOWDEFAULTPREC
- long DEFAULTPREC # 64 bits precision
- long MEDDEFAULTPREC # 128 bits precision
- long BIGDEFAULTPREC # 192 bits precision
diff --git a/srcpkgs/python3-cypari2/patches/167.diff b/srcpkgs/python3-cypari2/patches/167.diff
deleted file mode 100644
index 03dfb3f9556dec..00000000000000
--- a/srcpkgs/python3-cypari2/patches/167.diff
+++ /dev/null
@@ -1,38 +0,0 @@
-Add missing noexcept clauses
-
-See: https://github.com/sagemath/cypari2/pull/167
-
-diff --git a/.gitignore b/.gitignore
-index da57033..ccc25a5 100644
---- a/.gitignore
-+++ b/.gitignore
-@@ -8,6 +8,7 @@ cypari2/auto_paridecl.pxd.tmp
- cypari2/auto_paridecl.pxd
- cypari2/closure.c
- cypari2/convert.c
-+cypari2/custom_block.c
- cypari2/gen.c
- cypari2/handle_error.c
- cypari2/pari_instance.c
-diff --git a/cypari2/custom_block.pyx b/cypari2/custom_block.pyx
-index ddbb829..67419f8 100644
---- a/cypari2/custom_block.pyx
-+++ b/cypari2/custom_block.pyx
-@@ -12,14 +12,14 @@ 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():
-+cdef int custom_signal_is_blocked() noexcept:
- return PARI_SIGINT_block
-
--cdef void custom_signal_unblock():
-+cdef void custom_signal_unblock() noexcept:
- global PARI_SIGINT_block
- PARI_SIGINT_block = 0
-
--cdef void custom_set_pending_signal(int sig):
-+cdef void custom_set_pending_signal(int sig) noexcept:
- global PARI_SIGINT_pending
- PARI_SIGINT_pending = sig
-
diff --git a/srcpkgs/python3-cypari2/template b/srcpkgs/python3-cypari2/template
index 3d6324136ac980..f3bdbfddbae009 100644
--- a/srcpkgs/python3-cypari2/template
+++ b/srcpkgs/python3-cypari2/template
@@ -1,7 +1,7 @@
# Template file for 'python3-cypari2'
pkgname=python3-cypari2
-version=2.2.0
-revision=3
+version=2.2.1
+revision=1
build_style=python3-pep517
hostmakedepends="python3-setuptools python3-wheel python3-Cython
python3-cysignals pari perl"
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later"
homepage="https://github.com/sagemath/cypari2"
changelog="https://github.com/sagemath/cypari2/releases"
distfiles="https://github.com/sagemath/cypari2/archive/refs/tags/${version}.tar.gz"
-checksum=08804f8e73859447cd1882d0cdc6d1e62dd813c3f291e8cba4313916e162f7cd
+checksum=3bcadf6d3e49db7438eeae581db57ec465dcff90fc5177812716f1bfc86895d3
do_check() {
# Please do not disable this custom check;
From 0fb1b14088a6dcbb3a01627876caff655fa126d3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 14 Jan 2025 20:49:01 -0300
Subject: [PATCH 3/3] python3-fpylll: update to 0.6.3.
---
srcpkgs/python3-fpylll/template | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/srcpkgs/python3-fpylll/template b/srcpkgs/python3-fpylll/template
index 56cd75d5603b4c..015e06b20b2732 100644
--- a/srcpkgs/python3-fpylll/template
+++ b/srcpkgs/python3-fpylll/template
@@ -1,6 +1,6 @@
# Template file for 'python3-fpylll'
pkgname=python3-fpylll
-version=0.6.2
+version=0.6.3
revision=1
build_style=python3-pep517
hostmakedepends="python3-setuptools python3-wheel python3-Cython
@@ -13,5 +13,5 @@ maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="GPL-2.0-or-later"
homepage="https://github.com/fplll/fpylll"
changelog="https://github.com/fplll/fpylll/releases"
-distfiles="${PYPI_SITE}/f/fpylll/fpylll-${version}.tar.gz"
-checksum=d5b2f250afb6fb2f9c70e03ffe1169ff6f2e167e348da1328cc20b693b915fbe
+distfiles="https://github.com/fplll/fpylll/releases/download/${version}/fpylll-${version}.tar.gz"
+checksum=a3f4049e1c27b52136f71f722312c4265e3a2dcb5722536ec8247d708dd4248a
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PR PATCH] [Merged]: update to python3-{cysignals-1.12.2,cypari-2.2.1,fpylll-0.6.3}
2025-01-23 3:42 [PR PATCH] update to python3-{cysignals-1.12.2,cypari-2.2.1,fpylll-0.6.3} tornaria
@ 2025-01-23 3:58 ` ahesford
0 siblings, 0 replies; 2+ messages in thread
From: ahesford @ 2025-01-23 3:58 UTC (permalink / raw)
To: ml
[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]
There's a merged pull request on the void-packages repository
update to python3-{cysignals-1.12.2,cypari-2.2.1,fpylll-0.6.3}
https://github.com/void-linux/void-packages/pull/54084
Description:
- **python3-cysignals: update to 1.12.2.**
- **python3-cypari2: update to 2.2.1.**
- **python3-fpylll: update to 0.6.3.**
<!-- Uncomment relevant sections and delete options which are not applicable -->
#### Testing the changes
- I tested the changes in this PR: **YES**
<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->
<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
- aarch64-musl
- armv7l
- armv6l-musl
-->
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-01-23 3:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-01-23 3:42 [PR PATCH] update to python3-{cysignals-1.12.2,cypari-2.2.1,fpylll-0.6.3} tornaria
2025-01-23 3:58 ` [PR PATCH] [Merged]: " ahesford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).