FS#41744 - [python-matplotlib] [python2-matplotlib] 1.4.0 not depends on pyqt4, but pyqt5

Attached to Project: Community Packages
Opened by Thomas King (thomasking0529) - Friday, 29 August 2014, 02:11 GMT
Last edited by Bruno Pagani (ArchangeGabriel) - Sunday, 23 December 2018, 10:37 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Felix Yan (felixonmars)
Bruno Pagani (ArchangeGabriel)
Architecture All
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description:
after pacman -Rdd python-pyqt4, matplotlib just runs but without python-pyqt5, it will not run any more, pyqt5 is not
an optional dependency

Additional info:


Steps to reproduce:
from matplotlib import pyplot
fig = pyplot.figure()
This task depends upon

Closed by  Bruno Pagani (ArchangeGabriel)
Sunday, 23 December 2018, 10:37 GMT
Reason for closing:  Fixed
Additional comments about closing:  python-matplotlib 3.0
Comment by Heitzmann (heitzmann) - Friday, 29 August 2014, 16:38 GMT
The current version of matplotlibrc uses Qt5Agg as the default backend, but pyqt4 is the required package, while pyqt5 is optional.
I believe we should change the dependency to pyqt5 and leave pyqt4 as optional.
Alternatively we could patch the default backend upon installation.
Comment by Sam (smls) - Saturday, 30 August 2014, 14:46 GMT
The Matplotlib 1.4.0 "What's New" document[1] offers these (somewhat cryptic) words: "[We] implemented a Qt5 backend. The differences in namespace locations between Qt4 and Qt5 was dealt with by shimming Qt4 to look like Qt5, thus the Qt5 implementation is the primary implementation. Backwards compatibility for Qt4 is maintained by wrapping the Qt5 implementation."

Btw, I ended up here because python2-matplotlib 1.4.0 from [community-testing] breaks my mnemosyne[2] AUR package (it works fine with python2-matplotlib 1.3.1 from [community]). Mnemosyne is a Python 2 + Qt 4 program, but Matplotlib 1.4.0 seems determined to try and load the PyQt5 libraries, which fails - one way or another - both when python2-pyqt5 is installed, and when it isn't. I'll try to create a minimal testcase later to ensure it isn't somehow Mnemosyne's fault, and then probably create a separate bug report for it. But I thought I'd mention it here for now, in case it is part of a bigger problem with matplotlib 1.4 backend handling.

[1] http://matplotlib.org/1.4.0/users/whats_new.html#backends
[2] https://aur.archlinux.org/packages/mnemosyne/
Comment by Jakub Klinkovský (lahwaacz) - Saturday, 30 August 2014, 18:44 GMT
The conclusion of [1] is pretty clear: Qt5 is the new backend, substituting Qt4. Client code relying on Qt4 being the default and not explicitly requesting matplotlib to use the Qt4 backend is likely to break. You should report this to the Mnemosyne project, not here.

Btw, matplotlib's INSTALL file [3] lists all GUI frameworks, even Qt4, as optional, so client code is *probably* expected to explicitly request matplotlib to use desired backend and adjust its own dependency accordingly. Arch has previously chosen to satisfy matplotlib's default backend selection as a hard dependency, so the logical step would be to update the dependency from pyqt4 to pyqt5 as mentioned above.

[3]: https://github.com/matplotlib/matplotlib/blob/master/INSTALL#L204
Comment by Rui Da Costa (ruidc) - Sunday, 19 October 2014, 13:53 GMT
Wouldn't the right thing to do be to have both (and other backend dependencies) as optional?

The problem is this installs Qt5 which then becomes the default for other applications by it's presence.
Comment by Felix Yan (felixonmars) - Sunday, 19 October 2014, 13:55 GMT
While I want to leave both as optional, it will become a broken-by-default setting if the user doesn't have Qt5 installed.
Comment by Rui Da Costa (ruidc) - Sunday, 19 October 2014, 20:58 GMT
Then pick a backend with the least dependencies like pdf or ps. It's not broken just non-configured. It is a library for devs after all and any downstream dependencies should specify their own. Why should a user need qt to use matplotlib. If action is needed by user on upgrade or install then print a message upon installation like other packages do.
Comment by Thomas King (thomasking0529) - Sunday, 19 October 2014, 23:38 GMT
Then what's the meaning of matplot if there is no qt5 backend and then no graphical output? I don't think Arch is other communities like ubuntu or redhat to do a bunch of modifications with upstream packages, Arch is just keep pace with them and distribute the newest binary.
Comment by Felix Yan (felixonmars) - Monday, 20 October 2014, 03:10 GMT
No, the dependency check is on build time, for example the tk backend will not be build if not present on build time. And according to upstream logic, when all backends are present, they set Qt5 as the default value on build time.
Comment by Rui Da Costa (ruidc) - Monday, 20 October 2014, 05:09 GMT
Then have it as a build /make dependency but not intall dependency. The point is choice and not forcing it.
Comment by Felix Yan (felixonmars) - Monday, 20 October 2014, 05:33 GMT
Then you can submit a patch to upstream if you'd like to, of course.
Comment by Felix Yan (felixonmars) - Monday, 20 October 2014, 05:51 GMT
Just logged an issue [1] upstream about runtime detection - which I think would be the best way to solve this if possible.

[1] https://github.com/matplotlib/matplotlib/issues/3679
Comment by Rui Da Costa (ruidc) - Monday, 20 October 2014, 06:25 GMT
>Then what's the meaning of matplot if there is no qt5 backend and then no graphical output?
to produce charts to files as well as GUIs. Archlinux by default has no GUI. What's the meaning of making me install one when producing to files is equally valid?
Comment by Rui Da Costa (ruidc) - Monday, 20 October 2014, 06:58 GMT
see also: https://bugs.archlinux.org/task/41820

>I don't think Arch is other communities like ubuntu or redhat
This is part of what I understand Arch to be:

https://wiki.archlinux.org/index.php/The_Arch_Way :
"Arch Linux defines simplicity as without unnecessary additions"
"Another guiding principle of Arch Linux development is freedom. Users are not only permitted to make all decisions concerning system configuration, but also choose what their system will be. "
Comment by Thomas King (thomasking0529) - Monday, 20 October 2014, 07:30 GMT
Darktable also has cli, so you think arch should provide two packages like wireshark for both cli and gui versions? GUI output is the core function of matplot, and check the official tutorial, plt.show() is must-have, output to charts is just an optional function.
I think you may just want to get a pure and clean linux system. But just like pycuda, it depends on cuda, but just a small subset of cuda's funcions. Don't burden too much on arch community, maybe you should try ubuntu? As I know, at least opencv is splitted to multiple sub-packages, maybe the matplot is treated the same way.
Comment by Rui Da Costa (ruidc) - Monday, 20 October 2014, 07:46 GMT
how is it burdening? if you want pyqt, install it and use it, it's an option. And *your* choice! You however are asking me to upgrade to qt5 which causes problems, when qt4 has worked, continues to work and is still supported!
And I don't think you're being constructive telling users to go and use Ubuntu, that's not constructive to the community.
Comment by Thomas King (thomasking0529) - Monday, 20 October 2014, 14:19 GMT
No, I'm not trying to be constructive. In fact, I just think it's of no sense. If pyqt5 breaks some packages, then report bug as those packages. If they're not in Arch repo, then post a feature request.
YOU ARE ASKING SOMEONE TO DO EXTRA WORK TO PLEASE YOURSELF. That's why I'm here.
And now, I'll stand by pyqt5, so, Felix Yan, what should he do? Please you? Please me?
Stop this discussion. Wrong thing at wrong time at wrong place.
Comment by Rui Da Costa (ruidc) - Monday, 20 October 2014, 14:55 GMT
I'm not asking Felix to do extra work, I'm happy to do it myself, I'm trying to get the right thing done. Please take your attitude somewhere else, you give the community a bad name.
Comment by Heitzmann (heitzmann) - Monday, 20 October 2014, 15:20 GMT
I believe the whole problem is what happens when the user installs matplotlib with a few backends available (those not being dependencies) and then removes them. The system-wide matplotlibrc will set a default backend that might not be available any longer. I see 2 possible solutions:

1- Leave all backends as optional dependencies so the user is warned he or she uninstalls any of them. Then it's up to the user to fix the system-wide deafault.

2- Set the default backend to Tk no matter which ones are installed, since Tk should be in principle always available (afaik...). Then each user sets their preferred backend in their personal rc file.
Comment by Rui Da Costa (ruidc) - Monday, 20 October 2014, 15:41 GMT
the matplotlibrc is being created at compile time based upon what is present (see points in https://bugs.archlinux.org/task/41820 ).
I believe 1. is the right way to go and leaves the user choice, at least for qt backends where they do not need to be present at compile time according to the upstream devs comments on Felix's ticket.
re: 2. it is not a dependency of python2 in Arch, but is an optional dependency too, and is the traditional GUI for python - but Felix finds it ugly.
Comment by Rui Da Costa (ruidc) - Monday, 20 October 2014, 16:31 GMT
note that I'm not the only one with this desire: https://aur.archlinux.org/packages/python-matplotlib-noqt/
Comment by Thomas King (thomasking0529) - Monday, 20 October 2014, 22:57 GMT
"If pyqt5 breaks some packages, then report bug as those packages. If they're not in Arch repo, then post a feature request."
Have you seen my words?
To summarize: This is a feature request should be reported to upstream and it's so obvious that shouldn't be reported here.
Well, why should I keep watching this, just because someone reopened it for a weird reason?
Well, ignore me. I don't like such a bad reputation as "give a bad name".
Comment by Thomas King (thomasking0529) - Monday, 20 October 2014, 23:48 GMT
Well, well..
And another question is YOURSELFT, not EXTRA WORK, most people need GUI. And you, hate GUI, I can say that you're just hate GUI, and want a clean system to satisfy YOURSELF.
And another, KISS, SIMPLE, yeah, SIMPLE. You're making things get complicated. You want to remove ALL GUI dependencies. I don't think felix get your opinion, "ALL GUI".
You're eager for a no-GUI matplot, yeah? Just for your MINIMAL usage?
As my opinion, GUI is matplot's minimal usage, and you want to make it BROKEN. Too horrible.
I'm fighting for MY minimal usage.
There is AUR package, then go for it.
Don't harm my profits.
Comment by Balló György (City-busz) - Tuesday, 13 September 2016, 13:52 GMT
Is there any news? Currently Pitivi depends on python-matplotlib, which is a GTK+ 3 application, therefore I don't want to see Qt 5 as dependency for that package. It just uses the GTK3Cairo backend:
https://git.gnome.org/browse/pitivi/tree/pitivi/timeline/elements.py#n31

So I think that python-pyqt5 should be optional.
Comment by Svito (chpii) - Sunday, 15 January 2017, 21:04 GMT
This issue has been reported upstream [1] over 2 years ago. Check to see news there.

[1] https://github.com/matplotlib/matplotlib/issues/3679
Comment by Bruno Pagani (ArchangeGabriel) - Tuesday, 23 October 2018, 18:31 GMT
This has been implemented in 3.0. :)
Comment by Kassian Sun (Ksmata) - Wednesday, 24 October 2018, 02:16 GMT
Oh such a long time...
Comment by Bruno Pagani (ArchangeGabriel) - Wednesday, 24 October 2018, 13:30 GMT
Please test python-matplotlib 3.0.0-1 in [community-testing].

Loading...