python3-cypari2: update to 2.1.3.

This commit is contained in:
Gonzalo Tornaría 2022-10-30 17:10:30 -03:00 committed by Andrew J. Hesford
parent 2ca99aa389
commit a6a9a6b067
3 changed files with 56 additions and 37 deletions

View file

@ -0,0 +1,47 @@
See:
- https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1020456#10
- https://github.com/sagemath/cypari2/issues/122
- https://github.com/sagemath/cypari2/pull/123
diff --git a/cypari2/closure.pyx b/cypari2/closure.pyx
index 9848b51..ca87403 100644
--- a/cypari2/closure.pyx
+++ b/cypari2/closure.pyx
@@ -208,7 +208,7 @@ cpdef Gen objtoclosure(f):
>>> mul([1], [2])
Traceback (most recent call last):
...
- PariError: call_python: forbidden multiplication t_VEC (1 elts) * t_VEC (1 elts)
+ PariError: call_python: incorrect type in qfbcomp (t_VEC)
"""
if not callable(f):
raise TypeError("argument to objtoclosure() must be callable")
diff --git a/cypari2/handle_error.pyx b/cypari2/handle_error.pyx
index 1222889..ba93ad1 100644
--- a/cypari2/handle_error.pyx
+++ b/cypari2/handle_error.pyx
@@ -123,7 +123,7 @@ class PariError(RuntimeError):
>>> pari('!@#$%^&*()')
Traceback (most recent call last):
...
- PariError: syntax error, unexpected $undefined
+ PariError: syntax error, unexpected invalid token
"""
return self.errtext().rstrip(" .:")
diff --git a/cypari2/pari_instance.pyx b/cypari2/pari_instance.pyx
index 4291188..172fce5 100644
--- a/cypari2/pari_instance.pyx
+++ b/cypari2/pari_instance.pyx
@@ -1325,9 +1325,9 @@ cdef class Pari(Pari_auto):
>>> pari = cypari2.Pari()
>>> x = pari('x')
>>> pari.genus2red([-5*x**5, x**3 - 2*x**2 - 2*x + 1])
- [1416875, [2, -1; 5, 4; 2267, 1], x^6 - 240*x^4 - 2550*x^3 - 11400*x^2 - 24100*x - 19855, [[2, [2, [Mod(1, 2)]], []], [5, [1, []], ["[V] page 156", [3]]], [2267, [2, [Mod(432, 2267)]], ["[I{1-0-0}] page 170", []]]]]
+ [1416875, [2, -1; 5, 4; 2267, 1], [-6*x^5 + 2*x^3 - x, x^3 + 1], [[2, [2, [Mod(1, 2)]], []], [5, [1, []], ["[V] page 156", [3]]], [2267, [2, [Mod(432, 2267)]], ["[I{1-0-0}] page 170", []]]]]
>>> pari.genus2red([-5*x**5, x**3 - 2*x**2 - 2*x + 1],2267)
- [2267, Mat([2267, 1]), x^6 - 24*x^5 + 10*x^3 - 4*x + 1, [2267, [2, [Mod(432, 2267)]], ["[I{1-0-0}] page 170", []]]]
+ [2267, Mat([2267, 1]), [-6*x^5 + 2*x^3 - x, x^3 + 1], [2267, [2, [Mod(432, 2267)]], ["[I{1-0-0}] page 170", []]]]
"""
cdef Gen t0 = objtogen(P)
if p is None:

View file

@ -1,28 +0,0 @@
--- a/cypari2/convert.pyx
+++ b/cypari2/convert.pyx
@@ -59,8 +59,7 @@ cdef extern from *:
ctypedef struct PyLongObject:
digit* ob_digit
- Py_ssize_t* Py_SIZE_PTR "&Py_SIZE"(object)
-
+ void __Pyx_SET_SIZE(object, Py_ssize_t)
########################################################################
# Conversion PARI -> Python
@@ -450,13 +449,10 @@ cdef PyLong_FromINT(GEN g):
if d:
sizedigits_final = i+1
- # Set correct size (use a pointer to hack around Cython's
- # non-support for lvalues).
- cdef Py_ssize_t* sizeptr = Py_SIZE_PTR(x)
if signe(g) > 0:
- sizeptr[0] = sizedigits_final
+ __Pyx_SET_SIZE(x, sizedigits_final);
else:
- sizeptr[0] = -sizedigits_final
+ __Pyx_SET_SIZE(x, -sizedigits_final);
return x

View file

@ -1,8 +1,10 @@
# Template file for 'python3-cypari2'
pkgname=python3-cypari2
version=2.1.2
version=2.1.3
revision=1
wrksrc=cypari2-${version}
# This is precisely release 2.1.3 (Oct 3); but it's not tagged yet
_githash=34198a78e86ba6ba684b25ae5ebb3e1a4e54c19f
wrksrc=cypari2-${_githash}
build_style=python3-module
hostmakedepends="python3-setuptools python3-Cython pari perl"
makedepends="python3-devel python3-cysignals pari-devel gmp-devel"
@ -10,12 +12,10 @@ short_desc="Python interface to the number theory library PARI/GP"
maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
license="GPL-2.0-or-later"
homepage="https://github.com/sagemath/cypari2"
distfiles="${PYPI_SITE}/c/cypari2/cypari2-${version}.tar.gz"
checksum=03cd45edab8716ebbfdb754e65fea72e873c73dc91aec098fe4a01e35324ac7a
distfiles=https://github.com/sagemath/cypari2/archive/$_githash.tar.gz
checksum=16bcc5da48a05e3d56a1466e9ed0c2ec91d48fe875bf1adda237bb7690d3f7c3
post_extract() {
local _f
for _f in cypari2/*.pyx; do
rm -f ${_f%.pyx}.c
done
do_check() {
PYTHONPATH="$(cd build/lib* && pwd)" \
make check
}