Control: tags 999538 + patch
Control: tags 999538 + pending

Dear maintainer,

I've prepared an NMU for pytables (versioned as 3.6.1-5.1) and
uploaded it to DELAYED/2. Please feel free to tell me if I
should delay it longer.

Also available as an MR: 
https://salsa.debian.org/science-team/pytables/-/merge_requests/1

Regards,

SR
diff -Nru pytables-3.6.1/debian/changelog pytables-3.6.1/debian/changelog
--- pytables-3.6.1/debian/changelog	2021-09-28 02:05:13.000000000 -0400
+++ pytables-3.6.1/debian/changelog	2021-11-20 23:32:58.000000000 -0400
@@ -1,3 +1,12 @@
+pytables (3.6.1-5.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Patch: Fix FTBFS with numpy >= 1.20 (Closes: #999538)
+  * Patch: Fix FTBFS with Python 3.10.
+  * Install Python 3.10 C Extensions (2-digit minor version).
+
+ -- Stefano Rivera <stefa...@debian.org>  Sat, 20 Nov 2021 23:32:58 -0400
+
 pytables (3.6.1-5) unstable; urgency=medium
 
   * debian/control:
diff -Nru pytables-3.6.1/debian/patches/0010-Use-lowercase-float-int-as-numpy-dtype.patch pytables-3.6.1/debian/patches/0010-Use-lowercase-float-int-as-numpy-dtype.patch
--- pytables-3.6.1/debian/patches/0010-Use-lowercase-float-int-as-numpy-dtype.patch	1969-12-31 20:00:00.000000000 -0400
+++ pytables-3.6.1/debian/patches/0010-Use-lowercase-float-int-as-numpy-dtype.patch	2021-11-20 23:32:58.000000000 -0400
@@ -0,0 +1,176 @@
+From: =?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbys...@in.waw.pl>
+Date: Sun, 24 Jan 2021 16:36:21 +0100
+Subject: Use lowercase float/int as numpy dtype
+
+Float64 is gone with numpy 1.20, which causes doctests to fail
+(https://bugzilla.redhat.com/show_bug.cgi?id=1914335).
+
+Similarly all uses of Float32, Int32 should be replaced by float32 and int32.
+
+>>> numpy.__version__
+'1.19.4'
+>>> [k for k in numpy.sctypeDict.keys() if str(k).lower().startswith('float')]
+['float16', 'Float16', 'float32', 'Float32', 'float64', 'Float64', 'float128', 'Float128', 'float_', 'float']
+
+>>> numpy.__version__
+'1.20.0rc2'
+>>> [k for k in numpy.sctypeDict.keys() if str(k).lower().startswith('float')]
+['float16', 'float32', 'float64', 'float128', 'float_', 'float']
+
+Bug-Upstream: https://github.com/PyTables/PyTables/issues/875
+Bug-Debian: https://bugs.debian.org/999538
+Origin: upstream, https://github.com/PyTables/PyTables/pull/862
+---
+ bench/bsddb-table-bench.py     | 10 +++++-----
+ bench/postgres-search-bench.py |  4 ++--
+ bench/pytables-search-bench.py |  6 +++---
+ bench/recarray2-test.py        |  2 +-
+ bench/shelve-bench.py          | 10 +++++-----
+ bench/sqlite-search-bench.py   |  4 ++--
+ tables/atom.py                 |  2 +-
+ 7 files changed, 19 insertions(+), 19 deletions(-)
+
+diff --git a/bench/bsddb-table-bench.py b/bench/bsddb-table-bench.py
+index dd9f875..a2e0236 100644
+--- a/bench/bsddb-table-bench.py
++++ b/bench/bsddb-table-bench.py
+@@ -83,11 +83,11 @@ def createFile(filename, totalrows, recsize, verbose):
+     # Get the record object associated with the new table
+     if recsize == "big":
+         isrec = Big()
+-        arr = np.array(np.arange(32), type=np.Float64)
+-        arr2 = np.array(np.arange(32), type=np.Float64)
++        arr = np.array(np.arange(32), type=np.float64)
++        arr2 = np.array(np.arange(32), type=np.float64)
+     elif recsize == "medium":
+         isrec = Medium()
+-        arr = np.array(np.arange(2), type=np.Float64)
++        arr = np.array(np.arange(2), type=np.float64)
+     else:
+         isrec = Small()
+     # print d
+@@ -107,8 +107,8 @@ def createFile(filename, totalrows, recsize, verbose):
+             #d['TDCcount'] = i % 256
+             d['ADCcount'] = (i * 256) % (1 << 16)
+             if recsize == "big":
+-                #d.float1 = np.array([i]*32, np.Float64)
+-                #d.float2 = np.array([i**2]*32, np.Float64)
++                #d.float1 = np.array([i]*32, np.float64)
++                #d.float2 = np.array([i**2]*32, np.float64)
+                 arr[0] = 1.1
+                 d['float1'] = arr
+                 arr2[0] = 2.2
+diff --git a/bench/postgres-search-bench.py b/bench/postgres-search-bench.py
+index d2c9f4f..7fe83f6 100644
+--- a/bench/postgres-search-bench.py
++++ b/bench/postgres-search-bench.py
+@@ -15,11 +15,11 @@ def flatten(l):
+ 
+ 
+ def fill_arrays(start, stop):
+-    col_i = numpy.arange(start, stop, type=numpy.Int32)
++    col_i = numpy.arange(start, stop, type=numpy.int32)
+     if userandom:
+         col_j = numpy.random.uniform(0, nrows, size=[stop - start])
+     else:
+-        col_j = numpy.array(col_i, type=numpy.Float64)
++        col_j = numpy.array(col_i, type=numpy.float64)
+     return col_i, col_j
+ 
+ # Generator for ensure pytables benchmark compatibility
+diff --git a/bench/pytables-search-bench.py b/bench/pytables-search-bench.py
+index 726d30b..6417186 100644
+--- a/bench/pytables-search-bench.py
++++ b/bench/pytables-search-bench.py
+@@ -37,11 +37,11 @@ def create_db(filename, nrows):
+         stop = (j + 1) * step
+         if stop > nrows:
+             stop = nrows
+-        arr_f8 = np.arange(i, stop, type=np.Float64)
+-        arr_i4 = np.arange(i, stop, type=np.Int32)
++        arr_f8 = np.arange(i, stop, type=np.float64)
++        arr_i4 = np.arange(i, stop, type=np.int32)
+         if userandom:
+             arr_f8 += np.random.normal(0, stop * scale, shape=[stop - i])
+-            arr_i4 = np.array(arr_f8, type=np.Int32)
++            arr_i4 = np.array(arr_f8, type=np.int32)
+         recarr = np.rec.fromarrays([arr_i4, arr_i4, arr_f8, arr_f8])
+         table.append(recarr)
+         j += 1
+diff --git a/bench/recarray2-test.py b/bench/recarray2-test.py
+index a8602d8..bf55389 100644
+--- a/bench/recarray2-test.py
++++ b/bench/recarray2-test.py
+@@ -22,7 +22,7 @@ delta = 0.000001
+ # Creation of recarrays objects for test
+ x1 = np.array(np.arange(reclen))
+ x2 = chararray.array(None, itemsize=7, shape=reclen)
+-x3 = np.array(np.arange(reclen, reclen * 3, 2), np.Float64)
++x3 = np.array(np.arange(reclen, reclen * 3, 2), np.float64)
+ r1 = recarray.fromarrays([x1, x2, x3], names='a,b,c')
+ r2 = recarray2.fromarrays([x1, x2, x3], names='a,b,c')
+ 
+diff --git a/bench/shelve-bench.py b/bench/shelve-bench.py
+index d30739d..a591ed1 100644
+--- a/bench/shelve-bench.py
++++ b/bench/shelve-bench.py
+@@ -65,8 +65,8 @@ def createFile(filename, totalrows, recsize):
+     # Get the record object associated with the new table
+     if recsize == "big":
+         d = Big()
+-        arr = NA.array(NA.arange(32), type=NA.Float64)
+-        arr2 = NA.array(NA.arange(32), type=NA.Float64)
++        arr = NA.array(NA.arange(32), type=NA.float64)
++        arr2 = NA.array(NA.arange(32), type=NA.float64)
+     elif recsize == "medium":
+         d = Medium()
+     else:
+@@ -87,15 +87,15 @@ def createFile(filename, totalrows, recsize):
+                 #d.TDCcount = i % 256
+                 d.ADCcount = (i * 256) % (1 << 16)
+                 if recsize == "big":
+-                    #d.float1 = NA.array([i]*32, NA.Float64)
+-                    #d.float2 = NA.array([i**2]*32, NA.Float64)
++                    #d.float1 = NA.array([i]*32, NA.float64)
++                    #d.float2 = NA.array([i**2]*32, NA.float64)
+                     arr[0] = 1.1
+                     d.float1 = arr
+                     arr2[0] = 2.2
+                     d.float2 = arr2
+                     pass
+                 else:
+-                    d.float1 = NA.array([i ** 2] * 2, NA.Float64)
++                    d.float1 = NA.array([i ** 2] * 2, NA.float64)
+                     #d.float1 = float(i)
+                     #d.float2 = float(i)
+                 d.grid_i = i
+diff --git a/bench/sqlite-search-bench.py b/bench/sqlite-search-bench.py
+index 76dc7c5..dc61169 100644
+--- a/bench/sqlite-search-bench.py
++++ b/bench/sqlite-search-bench.py
+@@ -136,10 +136,10 @@ CREATE INDEX ivar3 ON small(var3);
+             if randomvalues:
+                 var3 = np.random.uniform(minimum, maximum, shape=[j - i])
+             else:
+-                var3 = np.arange(i, j, type=np.Float64)
++                var3 = np.arange(i, j, type=np.float64)
+                 if noise:
+                     var3 += np.random.uniform(-3, 3, shape=[j - i])
+-            var2 = np.array(var3, type=np.Int32)
++            var2 = np.array(var3, type=np.int32)
+             var1 = np.array(None, shape=[j - i], dtype='s4')
+             if not heavy:
+                 for n in range(j - i):
+diff --git a/tables/atom.py b/tables/atom.py
+index f92e16a..f93d915 100644
+--- a/tables/atom.py
++++ b/tables/atom.py
+@@ -338,7 +338,7 @@ class Atom(metaclass=MetaAtom):
+             Traceback (most recent call last):
+             ...
+             ValueError: unknown NumPy scalar type: 'S5'
+-            >>> Atom.from_sctype('Float64')
++            >>> Atom.from_sctype('float64')
+             Float64Atom(shape=(), dflt=0.0)
+ 
+         """
diff -Nru pytables-3.6.1/debian/patches/0011-doctest-adjust-__init__-TypeError-formatting.patch pytables-3.6.1/debian/patches/0011-doctest-adjust-__init__-TypeError-formatting.patch
--- pytables-3.6.1/debian/patches/0011-doctest-adjust-__init__-TypeError-formatting.patch	1969-12-31 20:00:00.000000000 -0400
+++ pytables-3.6.1/debian/patches/0011-doctest-adjust-__init__-TypeError-formatting.patch	2021-11-20 23:32:58.000000000 -0400
@@ -0,0 +1,47 @@
+From: =?utf-8?q?Zbigniew_J=C4=99drzejewski-Szmek?= <zbys...@in.waw.pl>
+Date: Mon, 16 Nov 2020 10:53:05 +0100
+Subject: doctest: adjust __init__ TypeError formatting
+
+Python3.10 includes the class name in the TypeError string for
+__init__(), so the literal match does not work anymore.
+
+Origin: upstream, https://github.com/PyTables/PyTables/pull/829
+---
+ tables/atom.py    | 4 ++--
+ tables/filters.py | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/tables/atom.py b/tables/atom.py
+index f93d915..7204f8c 100644
+--- a/tables/atom.py
++++ b/tables/atom.py
+@@ -571,10 +571,10 @@ class Atom(metaclass=MetaAtom):
+             >>> atom3 = atom1.copy(shape=(2, 2))
+             >>> print(atom3)
+             Int32Atom(shape=(2, 2), dflt=0)
+-            >>> atom1.copy(foobar=42)
++            >>> atom1.copy(foobar=42) #doctest: +ELLIPSIS
+             Traceback (most recent call last):
+             ...
+-            TypeError: __init__() got an unexpected keyword argument 'foobar'
++            TypeError: ...__init__() got an unexpected keyword argument 'foobar'
+ 
+         """
+         newargs = self._get_init_args()
+diff --git a/tables/filters.py b/tables/filters.py
+index 3315a6a..49c6b9e 100644
+--- a/tables/filters.py
++++ b/tables/filters.py
+@@ -435,10 +435,10 @@ class Filters(object):
+             Filters(complevel=0, shuffle=False, bitshuffle=False, fletcher32=False, least_significant_digit=None)
+             >>> print(filters3)
+             Filters(complevel=1, complib='zlib', shuffle=False, bitshuffle=False, fletcher32=False, least_significant_digit=None)
+-            >>> filters1.copy(foobar=42)
++            >>> filters1.copy(foobar=42) #doctest: +ELLIPSIS
+             Traceback (most recent call last):
+             ...
+-            TypeError: __init__() got an unexpected keyword argument 'foobar'
++            TypeError: ...__init__() got an unexpected keyword argument 'foobar'
+ 
+         """
+ 
diff -Nru pytables-3.6.1/debian/patches/series pytables-3.6.1/debian/patches/series
--- pytables-3.6.1/debian/patches/series	2021-09-28 02:05:13.000000000 -0400
+++ pytables-3.6.1/debian/patches/series	2021-11-20 23:32:58.000000000 -0400
@@ -7,3 +7,5 @@
 0007-Fix-syntax-warnings.patch
 0008-Fix-the-interpreter-name-in-examples.patch
 0009-Fix-unittests-on-vlarrays.patch
+0010-Use-lowercase-float-int-as-numpy-dtype.patch
+0011-doctest-adjust-__init__-TypeError-formatting.patch
diff -Nru pytables-3.6.1/debian/python3-tables-lib.install pytables-3.6.1/debian/python3-tables-lib.install
--- pytables-3.6.1/debian/python3-tables-lib.install	2021-09-28 02:05:13.000000000 -0400
+++ pytables-3.6.1/debian/python3-tables-lib.install	2021-11-20 23:32:58.000000000 -0400
@@ -1 +1 @@
-usr/lib/python3*/*-packages/tables/*.cpython-3?[m-]*.so
+usr/lib/python3*/*-packages/tables/*.cpython-3*.so

Reply via email to