Control: tags 1124192 + patch
Control: tags 1124192 + pending

Dear maintainer,

I've prepared an NMU for primecountpy (versioned as 0.1.1-1.1) and 
uploaded it to DELAYED/7. Please feel free to tell me if I should
cancel it.

cu
Adrian
diffstat for primecountpy-0.1.1 primecountpy-0.1.1

 changelog                                           |    7 +
 patches/0001-Port-to-primecount-8-API-changes.patch |   76 ++++++++++++++++++++
 patches/series                                      |    1 
 3 files changed, 84 insertions(+)

diff -Nru primecountpy-0.1.1/debian/changelog primecountpy-0.1.1/debian/changelog
--- primecountpy-0.1.1/debian/changelog	2025-12-02 04:50:49.000000000 +0200
+++ primecountpy-0.1.1/debian/changelog	2026-01-03 16:19:41.000000000 +0200
@@ -1,3 +1,10 @@
+primecountpy (0.1.1-1.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Backport upstream fix for FTBFS with primecount 8. (Closes: #1124192)
+
+ -- Adrian Bunk <[email protected]>  Sat, 03 Jan 2026 16:19:41 +0200
+
 primecountpy (0.1.1-1) unstable; urgency=medium
 
   * Team upload.
diff -Nru primecountpy-0.1.1/debian/patches/0001-Port-to-primecount-8-API-changes.patch primecountpy-0.1.1/debian/patches/0001-Port-to-primecount-8-API-changes.patch
--- primecountpy-0.1.1/debian/patches/0001-Port-to-primecount-8-API-changes.patch	1970-01-01 02:00:00.000000000 +0200
+++ primecountpy-0.1.1/debian/patches/0001-Port-to-primecount-8-API-changes.patch	2026-01-03 16:18:10.000000000 +0200
@@ -0,0 +1,76 @@
+From 5149670a546babf9f0a9747a36623cf9a92c83a4 Mon Sep 17 00:00:00 2001
+From: Antonio Rojas <[email protected]>
+Date: Wed, 17 Dec 2025 22:54:35 +0100
+Subject: Port to primecount 8 API changes
+
+Not backwards compatible
+---
+ primecountpy/defs.pxd       | 11 ++++++-----
+ primecountpy/primecount.pyx |  9 +++++----
+ 2 files changed, 11 insertions(+), 9 deletions(-)
+
+diff --git a/primecountpy/defs.pxd b/primecountpy/defs.pxd
+index fe98b1c..148b25a 100644
+--- a/primecountpy/defs.pxd
++++ b/primecountpy/defs.pxd
+@@ -1,13 +1,17 @@
+ # distutils: libraries = primesieve primecount
+ # distutils: language = c++
+ 
+-from libc.stdint cimport int64_t
++from libc.stdint cimport int64_t, uint64_t
+ from libcpp.string cimport string as cppstring
+ 
+ cdef extern from "primecount.hpp" namespace "primecount":
++    ctypedef struct pc_int128_t:
++        uint64_t lo
++        int64_t hi
++
+     int64_t pi(int64_t x)
+ 
+-    cppstring pi(const cppstring& x)
++    pc_int128_t pi(const pc_int128_t x)
+ 
+     int64_t nth_prime(int64_t n)
+ 
+@@ -16,7 +20,4 @@ cdef extern from "primecount.hpp" namespace "primecount":
+     void set_num_threads(int num_threads)
+     int get_num_threads()
+ 
+-    cppstring get_max_x()
+-    cppstring get_max_x(double alpha)
+-
+     cppstring primecount_version()
+diff --git a/primecountpy/primecount.pyx b/primecountpy/primecount.pyx
+index c930de0..69a344e 100644
+--- a/primecountpy/primecount.pyx
++++ b/primecountpy/primecount.pyx
+@@ -13,7 +13,6 @@ Interface to the `primecount <https://github.com/kimwalisch/primecount>`_ C++ li
+ 
+ from libc.stdint cimport int64_t
+ from libcpp.string cimport string as cppstring
+-from cpython.long cimport PyLong_FromString
+ 
+ from cysignals.signals cimport sig_on, sig_off
+ cimport defs as pcount
+@@ -62,12 +61,14 @@ cpdef prime_pi_128(n):
+         >>> prime_pi_128(10**10)
+         455052511
+     """
+-    cdef cppstring s = str(n).encode('ascii')
+-    cdef bytes ans
++    cdef pcount.pc_int128_t s
++    s.lo = (n % 2**64)
++    s.hi = (n >> 64)
++    cdef pcount.pc_int128_t ans
+     sig_on()
+     ans = pcount.pi(s)
+     sig_off()
+-    return PyLong_FromString(ans, NULL, 10)
++    return ans.lo | (ans.hi << 64)
+ 
+ cpdef int64_t nth_prime(int64_t n) except -1:
+     r"""
+-- 
+2.30.2
+
diff -Nru primecountpy-0.1.1/debian/patches/series primecountpy-0.1.1/debian/patches/series
--- primecountpy-0.1.1/debian/patches/series	1970-01-01 02:00:00.000000000 +0200
+++ primecountpy-0.1.1/debian/patches/series	2026-01-03 16:19:40.000000000 +0200
@@ -0,0 +1 @@
+0001-Port-to-primecount-8-API-changes.patch

Reply via email to