reopen 999533
reassign 999533 matplotlib 3.5.0-1
retitle 999533 matplotlib: python3-pil.imagetk should be Depends
affects 999533 src:python-cartopy src:topplot src:aplpy
affects 999533 src:python-ltfatpy src:python-bayespy
affects 999533 src:python-matplotlib-venn
tags 999533 patch
thanks

On Fri, 12 Nov 2021 21:33:15 +0100 Sebastiaan Couwenberg wrote:
On 11/12/21 08:19, Lucas Nussbaum wrote:
>> cartopy/tests/mpl/__init__.py:15: in <module>
>>      import matplotlib.pyplot as plt
>> /usr/lib/python3/dist-packages/matplotlib/pyplot.py:2226: in <module>
>>      switch_backend(rcParams["backend"])
>> /usr/lib/python3/dist-packages/matplotlib/pyplot.py:267: in switch_backend
>>      class backend_mod(matplotlib.backend_bases._Backend):
>> /usr/lib/python3/dist-packages/matplotlib/pyplot.py:268: in backend_mod
>>      locals().update(vars(importlib.import_module(backend_name)))
>> /usr/lib/python3.9/importlib/__init__.py:127: in import_module
>>      return _bootstrap._gcd_import(name[level:], package, level)
>> /usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py:1: in 
<module>
>>      from . import _backend_tk
>> /usr/lib/python3/dist-packages/matplotlib/backends/_backend_tk.py:14: in 
<module>
>>      from PIL import Image, ImageTk
>> E   ImportError: cannot import name 'ImageTk' from 'PIL' 
(/usr/lib/python3/dist-packages/PIL/__init__.py)

This is not a bug in cartopy, matplotlib tries to use ImageTk but the package is not installed.

python3-matplotlib only Recommends python3-pil.imagetk, this should be a Depends.

This issue is still present in matplotlib (3.5.0-2) and affects several packages. These should not have to add python3-pil.imagetk to their build dependencies because matplotlib does not pull it in.

The attached patch moves the Recommends to Depends.

Kind Regards,

Bas

--
 GPG Key ID: 4096R/6750F10AE88D4AF1
Fingerprint: 8182 DE41 7056 408D 6146  50D1 6750 F10A E88D 4AF1
diff -ruN a/debian/changelog b/debian/changelog
--- a/debian/changelog	2021-11-27 08:02:11.000000000 +0100
+++ b/debian/changelog	2021-12-03 09:34:30.728494076 +0100
@@ -1,3 +1,11 @@
+matplotlib (3.5.0-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Change python3-pil.imagetk to Depends.
+    (closes: #999533)
+
+ -- Bas Couwenberg <sebas...@debian.org>  Fri, 03 Dec 2021 09:33:35 +0100
+
 matplotlib (3.5.0-2) unstable; urgency=medium
 
   * debian/control
diff -ruN a/debian/control b/debian/control
--- a/debian/control	2021-11-27 08:02:11.000000000 +0100
+++ b/debian/control	2021-12-03 09:33:31.832955665 +0100
@@ -74,14 +74,14 @@
          libjs-jquery-ui,
          python-matplotlib-data (>= ${source:Version}),
          python3-dateutil,
+         python3-pil,
+         python3-pil.imagetk,
          python3-pyparsing (>= 1.5.6),
          python3-six (>= 1.4),
+         python3-tk,
          ${misc:Depends},
          ${python3:Depends},
          ${shlibs:Depends},
-Recommends: python3-pil,
-            python3-pil.imagetk,
-            python3-tk,
 Enhances: ipython3,
 Suggests: dvipng,
           ffmpeg,

Reply via email to