[WIP] Deprecate gtk, gdk and wx backends and remove Cocoaagg#6574
[WIP] Deprecate gtk, gdk and wx backends and remove Cocoaagg#6574jenshnielsen wants to merge 7 commits intomatplotlib:masterfrom
Conversation
| warn_deprecated('2.0', message="The GDK backend is " | ||
| "deprecated. It is untested, known to be " | ||
| "broken and will be removed in Matplotlib 2.2. " | ||
| "Use the Agg backend instead.", |
There was a problem hiding this comment.
I don't think you need this line; the replacement advice is auto-generated when you supply the alternative kwarg.
There was a problem hiding this comment.
I thought so too but I don't see it without explicitly adding the last line.
This is the warning message from the above as it looks for me
/usr/local/lib/python2.7/site-packages/matplotlib/cbook.py:137: MatplotlibDeprecationWarning: The GTK backend is deprecated. It is untested, known to be broken and will be removed in Matplotlib 2.2. Use the GTKAgg backend instead.
warnings.warn(message, mplDeprecation, stacklevel=1)
|
@OceanWolf @fariza Can you take a look at this verify that this does not warn on the supported versions of gtk* backends? |
Update make.py
ttconv: Also replace carriage return with spaces.
|
Yay for getting rid of a MacO$ backend that I can't test the backend refactor on! But why don't we deprecate I didn't realise that P.S. Never heard of FLTK until now ;). |
|
On 2016/06/13 10:33 AM, OceanWolf wrote:
It was never a complete backend, and has been deprecated since 1.3 with |
|
Ahh, okay, then we have given users plenty of time to migrate away from it. In terms of testing, I can't get the In debian we don't have a @fariza do you still use python2, if not I will recompile mpl for python2. |
|
As far as I know PyGtk2 never supported python3 so the GTK2 backends are python 2 only |
|
This was the case long time ago, I don't know still the same but I have always thought |
|
Not 100% sure about that... import gi
gi.require_version("Gtk", "2.0")
from gi.repository import Gtk as gtk, Gdk as gdk, GObject as gobject, GLib, Pango as pangogives I can't test further as I don't think |
|
Btw, if you want to make it really clear and extra safe you can write: if self.__class__ == FigureCanvasGTK:
warn.deprecated()I have tested this syntax on both python2.7 and python3.5.1 in class Parent(object):
def __init__(self):
print('Setting up Parent', self.__class__)
if self.__class__ == Parent:
print('I am me')
else:
print('I am someone else')
class Child(Parent):
def __init__(self):
print('Setting up Child', self.__class__)
super(Child, self).__init__()
print('--- Creating Parent ---')
a = Parent()
print('--- Creating Child ---')
b = Child() |
|
Suspect this was broken by the six merge |
1e9df8b to
4e302b7
Compare
|
Closing in favour of #6582 |
I still need to add an api_change note and update the documentation to reflect the deprecation.
The inheritance between the various Gtk backends is a bit complicated but this solution correctly prints the deprecation warning when using the Gtk and Gdk backends but not the GtkAgg og GtkCairo backends.
I also removed some references to the long since removed fltk and emf backends
Fixes #6541