[Python-modules-team] Bug#943923: python-apptools: please stop build-depending on python-pandas

Rebecca N. Palmer rebecca_palmer at zoho.com
Thu Oct 31 22:21:35 GMT 2019


Package: python-apptools
Version: 4.4.0-3
Control: block 937296 by -1
Control: tags -1 patch

pandas upstream dropped Python 2 support in 0.25 (before adding Python 
3.8 support).  As further discussed in #937296, the Debian package 
python-pandas is currently part of a big tangle of circular 
(build-)dependencies, but can be cut out of that tangle by removing the 
build-dependencies from python-apptools and matplotlib2.

Hence, please apply the attached patch to drop the python-pandas build 
dependency and allow the test suite to be run without it.
-------------- next part --------------
diff -Nru python-apptools-4.4.0/debian/changelog python-apptools-4.4.0/debian/changelog
--- python-apptools-4.4.0/debian/changelog	2019-03-05 20:26:46.000000000 +0000
+++ python-apptools-4.4.0/debian/changelog	2019-10-31 21:42:13.000000000 +0000
@@ -1,3 +1,10 @@
+python-apptools (4.4.0-4) UNRELEASED; urgency=medium
+
+  * Stop build-depending on python-pandas,
+    and fix resulting test issues.
+
+ -- Rebecca N. Palmer <rebecca_palmer at zoho.com>  Thu, 31 Oct 2019 21:42:13 +0000
+
 python-apptools (4.4.0-3) unstable; urgency=medium
 
   * Fixing broken links in python-apptools-doc
diff -Nru python-apptools-4.4.0/debian/control python-apptools-4.4.0/debian/control
--- python-apptools-4.4.0/debian/control	2019-03-05 20:26:46.000000000 +0000
+++ python-apptools-4.4.0/debian/control	2019-10-31 21:33:48.000000000 +0000
@@ -11,7 +11,6 @@
  python-setuptools,
  python-traits,
  python-tables,
- python-pandas,
  python-nose,
  python-configobj,
  python3-all,
diff -Nru python-apptools-4.4.0/debian/patches/series python-apptools-4.4.0/debian/patches/series
--- python-apptools-4.4.0/debian/patches/series	2019-03-05 20:26:46.000000000 +0000
+++ python-apptools-4.4.0/debian/patches/series	2019-10-31 21:42:13.000000000 +0000
@@ -4,3 +4,4 @@
 dont_delete_tmp
 skip_test_file_properties
 man_page_section
+test_without_pandas
diff -Nru python-apptools-4.4.0/debian/patches/test_without_pandas python-apptools-4.4.0/debian/patches/test_without_pandas
--- python-apptools-4.4.0/debian/patches/test_without_pandas	1970-01-01 01:00:00.000000000 +0100
+++ python-apptools-4.4.0/debian/patches/test_without_pandas	2019-10-31 21:42:13.000000000 +0000
@@ -0,0 +1,52 @@
+Description: Allow importing H5TableNode without pandas
+
+Needed to run the test suite without python-pandas.
+
+Author: Rebecca N. Palmer <rebecca_palmer at zoho.com>
+Bug-Debian: https://bugs.debian.org/<bugnumber>
+Forwarded: no
+
+--- python-apptools-4.4.0.orig/apptools/io/h5/table_node.py
++++ python-apptools-4.4.0/apptools/io/h5/table_node.py
+@@ -1,5 +1,8 @@
+ import numpy as np
+-from pandas import DataFrame
++try:
++    from pandas import DataFrame
++except ImportError:
++    DataFrame = None
+ from tables.table import Table as PyTablesTable
+ 
+ 
+@@ -116,6 +119,8 @@ class H5TableNode(object):
+         XXX: This does not work if the table contains a multidimensional column
+         """
+         # Slicing rows gives a numpy struct array, which DataFrame understands.
++        if DataFrame is None:
++            raise ImportError("to_dataframe requires pandas, which was not found")
+         return DataFrame(self.ix[:])
+ 
+     #--------------------------------------------------------------------------
+--- python-apptools-4.4.0.orig/apptools/io/h5/tests/test_table_node.py
++++ python-apptools-4.4.0/apptools/io/h5/tests/test_table_node.py
+@@ -1,6 +1,10 @@
+ import numpy as np
+ from numpy.testing import assert_allclose
+-from pandas import DataFrame
++from numpy.testing.decorators import skipif
++try:
++    from pandas import DataFrame
++except ImportError:
++    DataFrame = None
+ 
+ from ..table_node import H5TableNode
+ from .utils import temp_h5_file
+@@ -46,7 +50,7 @@ def test_keys():
+         h5table = H5TableNode.add_to_h5file(h5, NODE, description)
+         assert set(h5table.keys()) == keys
+ 
+-
++ at skipif(DataFrame == None, "requires pandas")
+ def test_to_dataframe():
+     description = [('a', np.float64)]
+     with temp_h5_file() as h5:


More information about the Python-modules-team mailing list