[Python-modules-team] Bug#936745: reducing matplotlib2 build-depends.

peter green plugwash at p10link.net
Tue Nov 12 14:13:51 GMT 2019


matplotlib2 seems to be an important node in the python2 removal/reduction problem (and the qt4 removal problem). I have noticed there are a substantial number of python module packages that it build-depends on but does not depend on.

python-backports.functools-lru-cache
python-cairocffi
python-colorspacious
python-cycler
python-functools32
python-gi
python-ipywidgets
python-kiwisolver
python-mock
python-nose
python-numpy
python-numpy-dbg
python-numpydoc
python-pandas
python-pil
python-pkg-resources
python-pyqt5
python-pytest
python-qt4
python-scipy
python-setuptools
python-six
python-sphinx
python-sphinx-gallery
python-subprocess32
python-tk
python-tk-dbg
python-tornado
python-wxgtk3.0
python-xlwt

There is also the slightly-strange case of kiwisolver where there is no binary dependency on python-kiwisolver but there is one on python-kiwisolver-dbg.

Some of these dependencies are starting to cause problems. For example

ipywidgets needs to drop it's python2 packages because jupyter-notebook has already done so, but it can't because of the build-dependency from matplotlib2

the qt developers want to get rid of qt4, but can't because of the build-dependency from matplotlib2.

the pandas maintainers have packaged a new python3 only version, which leaves matplotlib2 build-depending on a cruft package.

I am guessing that many of these are to get testsuite coverage for optional features and are not strictly needed for the build, while testing stuff is nice I don't think it's vital for software that is on it's way out. I tried removing all of the aforementioned packages except python-setuptools and python-kiwisolver from the build-depends (and I uninstalled all python 2 packages from the chroot where I was doing my test builds before I installed the remaining build-depends).

I had to add the following packages back in to get a succesful build.

python-numpy
python-numpy-dbg
python-sphinx (needed for documentation build)
python-backports.functools-lru-cache (needed for documentation build)
python-cycler (needed for documentation build)
python-numpydoc (needed for documentation build)
python-sphinx-gallery (needed for documentation build)
python-colorspacious (needed for documentation build)
python-mock (needed for documentation build)

I also had to add a build-dependency on python-ipkernel which is needed by the documentation build and was previously pulled in indirectly.

That left the following list of changes to build-dependencies.

-               python-cairocffi [!ia64],
-               python-functools32,
-               python-gi,
-               python-ipywidgets,
+               python-ipykernel,
-               python-nose,
-               python-pandas [!hppa !m68k !powerpcspe !sparc64 !sh4 !x32],
-               python-pil,
-               python-pkg-resources,
-               python-pytest,
-               python-qt4,
-               python-pyqt5 [!hurd-i386],
-               python-scipy,
-               python-six (>= 1.4),
-               python-subprocess32,
-               python-tk (>= 2.5.2-1.1),
-               python-tk-dbg (>= 2.5.2-1.1),
-               python-tornado,
-               python-wxgtk3.0,
-               python-xlwt,

Unfortunately the matplotlib2 build is not reproducible, so while I was able to determine there were no significant changes to file lists (there were some id changes to id's in the documenation) I was not able to reasonably check for changes to file content.

What do others with more experience think? Should these build-dependencies be removed?

While working on this I also ran into an issue with the clean target not cleaning up properly which I fixed as it was getting in the way of my testing.

debdiff is attached.

-------------- next part --------------
diff -Nru matplotlib2-2.2.4/debian/changelog matplotlib2-2.2.4/debian/changelog
--- matplotlib2-2.2.4/debian/changelog	2019-09-17 03:44:50.000000000 +0000
+++ matplotlib2-2.2.4/debian/changelog	2019-11-12 10:59:29.000000000 +0000
@@ -1,3 +1,13 @@
+matplotlib2 (2.2.4-2.1) UNRELEASED; urgency=medium
+
+  * experimental local build
+  * reduce build-dependencies to (mostly) match binary ones.
+  * add build-depends on python-ipykernel, the documentation build
+    needs it (previously it was pulled in indirectly)
+  * fix clean target.
+
+ -- Peter Michael Green <plugwash at debian.org>  Tue, 12 Nov 2019 10:59:29 +0000
+
 matplotlib2 (2.2.4-2) unstable; urgency=medium
 
   * debian/control
diff -Nru matplotlib2-2.2.4/debian/control matplotlib2-2.2.4/debian/control
--- matplotlib2-2.2.4/debian/control	2019-09-17 03:44:50.000000000 +0000
+++ matplotlib2-2.2.4/debian/control	2019-11-12 10:59:29.000000000 +0000
@@ -19,36 +19,18 @@
                python-cycler (>= 0.10.0),
                python-dateutil,
                python-colorspacious,
-               python-cairocffi [!ia64],
-               python-functools32,
-               python-gi,
-               python-ipywidgets,
+               python-ipykernel,
                python-kiwisolver,
                python-kiwisolver-dbg,
                python-mock,
-               python-nose,
                python-numpy,
                python-numpy-dbg,
                python-numpydoc,
-               python-pandas [!hppa !m68k !powerpcspe !sparc64 !sh4 !x32],
-               python-pil,
-               python-pkg-resources,
                python-pyparsing (>= 1.5.6),
-               python-pytest,
-               python-qt4,
-               python-pyqt5 [!hurd-i386],
-               python-scipy,
                python-setuptools,
-               python-six (>= 1.4),
                python-sphinx (>= 1.0.7+dfsg),
                python-sphinx-gallery,
-               python-subprocess32,
-               python-tk (>= 2.5.2-1.1),
-               python-tk-dbg (>= 2.5.2-1.1),
-               python-tornado,
                python-tz,
-               python-wxgtk3.0,
-               python-xlwt,
                tcl8.6-dev,
                texlive-fonts-recommended,
                texlive-latex-extra,
diff -Nru matplotlib2-2.2.4/debian/rules matplotlib2-2.2.4/debian/rules
--- matplotlib2-2.2.4/debian/rules	2019-09-17 03:44:50.000000000 +0000
+++ matplotlib2-2.2.4/debian/rules	2019-11-12 10:59:29.000000000 +0000
@@ -93,6 +93,22 @@
 	# remove embedded CXX to prevent it to be picked up
 	rm -rf extern/CXX/
 
+	#more cleanup
+	rm -rf .eggs
+	find examples -name '*.png' -delete
+	find examples -name '*.pdf' -delete
+	find examples -name '*.svgz' -delete
+	rm -f examples/misc/*.svg
+	find . -name '*.zip' -delete
+	find . -name '*.md5' -delete
+	find . -name '*.pickle' -delete
+	find doc -name '*.ipynb' -delete
+	rm -rf doc/tutorials
+	rm -rf doc/gallery
+	rm -rf doc/build
+	rm -f doc/fontList.json
+	rm -f examples/misc/*.eps
+
 # install
 install-arch: build-arch install-arch-stamp
 	dh_testdir


More information about the Python-modules-team mailing list