FS#41820 - [python2-matplotlib] unneeded dependency on pyqt5
Attached to Project:
Community Packages
Opened by Rui Da Costa (ruidc) - Thursday, 04 September 2014, 14:01 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Sunday, 23 December 2018, 10:36 GMT
Opened by Rui Da Costa (ruidc) - Thursday, 04 September 2014, 14:01 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Sunday, 23 December 2018, 10:36 GMT
|
Details
Current package incorrectly depends on PyQt5 which is not
required by upstream - it is one of several optional
backends, none of which is required.
For headless server operations this is undesirable as it brings in X11 dependencies. Build-time generated matplotlibrc settings file then specifies PyQt backend which contradicts upstream default suggestion and the stated base for other distribution binaries. For environments already running Qt v4, this will also force incompatibilities as some setting default to Qt v5 which is not always compatible. The best solution would be to make all GUI dependencies optional and set a matplotlibrc backend to something that requires no dependencies like PDF or PS, and raise a note to the user to install preferred GUI dependencies. Source Notes: requirements do not list any GUI as a requirement: https://github.com/matplotlib/matplotlib/blob/master/INSTALL#L171 from http://matplotlib.org/faq/usage_faq.html#what-is-a-backend : With a typical installation of matplotlib, such as from a binary installer or a linux distribution package, a good default backend will already be set, allowing both interactive work and plotting from scripts, with output to the screen and/or to a file, so at least initially you will not need to use either of the two methods given above. The default backend is set dynamically at build time and saved to matplotlibrc file (which then gets installed to usr/lib/python2.7/site-packages/matplotlib/mpl-data/matplotlibrc ) this is done from https://github.com/matplotlib/matplotlib/blob/master/setup.py#L90 |
This task depends upon
Closed by Bruno Pagani (ArchangeGabriel)
Sunday, 23 December 2018, 10:36 GMT
Reason for closing: Implemented
Additional comments about closing: Fixed, no reaction for 2 months, considering this as done.
Sunday, 23 December 2018, 10:36 GMT
Reason for closing: Implemented
Additional comments about closing: Fixed, no reaction for 2 months, considering this as done.
FS#40723, but it's got enough more information that I'm not just going to close it.the user's question:
>or do you have a better idea of how to set a global default backend?
is solved by reading the docs upstream:
http://matplotlib.org/faq/usage_faq.html#what-is-a-backend
where it mentions to modify the matplotlibrc or use the ".use" method.
However, applications e.g. pitivi could able to set the desired backend like this, so I don't think that it's really a problem:
https://git.gnome.org/browse/pitivi/tree/pitivi/timeline/elements.py#n23
Here is the upstream report:
https://github.com/matplotlib/matplotlib/issues/3679
And here is a large pull request, which implements fallback feature:
https://github.com/matplotlib/matplotlib/pull/9795
Once the PR is merged, we can safely remove the python2-pyqt5 dependency.
There is another task is open for this:
https://bugs.archlinux.org/task/41744
The first release of the Matplotlib 3.0 series
This is the first version of Matplotlib to only support Python 3.
Highlights of this release include:
- GUI backend is selected at run-time based on what toolkits are
installed. A GUI toolkit will not be selected on a headless
server.