[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#921120: sagemath breaks sagetex autopkgtest: ImportError: No module named _tkinter, please install the python-tk package



On Fri, 1 Feb 2019 20:45:08 +0100 Paul Gevers <elbrus@debian.org> wrote:
> reassign 921120 src:sagetex 3.2+ds-1
> retitle 921120 sagetex (autopkgtest) depends misses python-tk
> affects 921120 src:sagemath
> thanks
> 
> Hi Tobias, sagemath maintainers
> 
> On 01-02-2019 20:35, Tobias Hansen wrote:
> > I guess the solution is to add python-tk to Depends: in the sagetex autopkgtest control file.
> 
> I think so too, thus reassigning. Mind you, I haven't checked if sagetex
> needs the python-tk regular dependency even.
> 
> Paul
> 

Hi,

I didn't know about sagetex before but checked what's wrong to unblock
sphinx migration.

I found that sagetex might require python-tk as a backend when using
\sageplot in latex.
Autopkgtest fail when testing that line [0]:
```
\sageplot[width=.75\textwidth]{p, axes=False}
```

So this is not really a test-only dependency, but also a sagetex itself one.

Actually, I found in [1] that matplotlib can use many different
backends. There are rendering backends and interactive backends. Cairo
is a rendering backend for example, and TK is an interactive one.
The default used backend is choosen according to different things
(configuration file, environment variable, python function call).

Actually, sagetex is using the default backend which is TkAgg and so
require python-tk when doing `\sageplot`.

=> the minimal solution is to add a dependency on python-tk in sagetex.

But I don't think sagetex require an interactive backend, but just
something that can generate a pdf, eps of image file is enough.
So a rendering backend could be enough for sagetex.
Also, sagetex should not depend on user configuration of matplotlib.

=> So in the long run, I think sagetex should:
 - Depend on a specific rendering backend like cairo that does all
required formats (eps, pdf, png and formats provided by users)
 - Use matplotlib.use('cairo') (or another backend) so only a known
working backend is used and not whatever the user configured.

According to [1], cairo is the only one to support multiple formats
including eps, pdf and png.

But switching now from the default python-tk to cairo might be a too big
change now that the soft freeze is near and that it blocks other
packages from migrating ...

So I suggest to just add a dependency on python-tk in sagetex for buster
and implement the other solution with longer thinking of impacts later.

[0] https://salsa.debian.org/tex-team/sagetex/blob/master/example.tex#L97
[1] https://matplotlib.org/faq/usage_faq.html#what-is-a-backend

-- 
Alexis Murzeau
PGP: B7E6 0EBB 9293 7B06 BDBC  2787 E7BD 1904 F480 937F

Attachment: signature.asc
Description: OpenPGP digital signature


Reply to: