From 88c0c32d3d87084ebde63e245a5ecea8fa207794 Mon Sep 17 00:00:00 2001 From: Benjamin Root Date: Sun, 9 Sep 2012 17:03:01 -0400 Subject: [PATCH] Added deprecation notices for Qt3-based backends. --- doc/api/api_changes.rst | 5 +++++ doc/users/whats_new.rst | 3 ++- lib/matplotlib/backends/backend_qt.py | 9 ++++++++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index bb1a017095d1..279da6587e8f 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -131,6 +131,11 @@ Changes in 1.2.x * ``twinx`` and ``twiny`` now returns an instance of SubplotBase if parent axes is an instance of SubplotBase. +* All Qt3-based backends are now deprecated due to the lack of py3k bindings. + Qt and QtAgg backends will continue to work in v1.2.x for py2.6 + and py2.7. It is anticipated that the Qt3 support will be completely + removed for the next release. + Changes in 1.1.x ================ diff --git a/doc/users/whats_new.rst b/doc/users/whats_new.rst index afee7551a091..47a056da89a1 100644 --- a/doc/users/whats_new.rst +++ b/doc/users/whats_new.rst @@ -34,7 +34,8 @@ project. The following GUI backends work under Python 3.x: Gtk3Agg, Gtk3Cairo, Qt4Agg, TkAgg and MacOSX. The other GUI backends do not yet have adequate bindings for Python 3.x, but continue to work on Python 2.6 -and 2.7. The non-GUI backends, such as PDF, PS and SVG, work on both +and 2.7, particularly the Qt and QtAgg backends (which have been +deprecated). The non-GUI backends, such as PDF, PS and SVG, work on both Python 2.x and 3.x. Features that depend on the Python Imaging Library, such as JPEG diff --git a/lib/matplotlib/backends/backend_qt.py b/lib/matplotlib/backends/backend_qt.py index 38c5705de35c..70a07ec99303 100644 --- a/lib/matplotlib/backends/backend_qt.py +++ b/lib/matplotlib/backends/backend_qt.py @@ -2,6 +2,11 @@ import math import os import sys +import warnings + +warnings.warn("QT3-based backends are deprecated and will be removed after" + " the v1.2.x release. Use the equivalent QT4 backend instead.", + DeprecationWarning) import matplotlib from matplotlib import verbose @@ -18,7 +23,9 @@ try: import qt except ImportError: - raise ImportError("Qt backend requires pyqt to be installed.") + raise ImportError("Qt backend requires pyqt to be installed." + " NOTE: QT3-based backends will not work in" + " Python 3.") backend_version = "0.9.1" def fn_name(): return sys._getframe(1).f_code.co_name