diff --git a/.travis.yml b/.travis.yml index 852837464d6c..d6cc99d531d9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -153,7 +153,7 @@ install: python -c 'import PyQt5.QtCore' && echo 'PyQt5 is available' || echo 'PyQt5 is not available' - python -mpip install -U --pre \ + python -mpip install -U \ --no-index -f https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-14.04 \ wxPython && python -c 'import wx' && diff --git a/doc/sphinxext/mock_gui_toolkits.py b/doc/sphinxext/mock_gui_toolkits.py index 9e786f318782..bb378e77382c 100644 --- a/doc/sphinxext/mock_gui_toolkits.py +++ b/doc/sphinxext/mock_gui_toolkits.py @@ -118,15 +118,12 @@ class ToolBar(object): class Frame(object): pass - VERSION_STRING = '2.9' - def setup(app): - sys.modules['cairocffi'] = MyCairoCffi() - sys.modules['PyQt4'] = MyPyQt4() - sys.modules['sip'] = MySip() - sys.modules['wx'] = MyWX() - sys.modules['wxversion'] = MagicMock() - - metadata = {'parallel_read_safe': True, 'parallel_write_safe': True} - return metadata + sys.modules.update( + cairocffi=MyCairoCffi(), + PyQt4=MyPyQt4(), + sip=MySip(), + wx=MyWX(), + ) + return {'parallel_read_safe': True, 'parallel_write_safe': True} diff --git a/lib/matplotlib/backends/wx_compat.py b/lib/matplotlib/backends/wx_compat.py index 9dc4a87fffe1..87f6312299f4 100644 --- a/lib/matplotlib/backends/wx_compat.py +++ b/lib/matplotlib/backends/wx_compat.py @@ -11,27 +11,12 @@ unicode_literals) import six -from distutils.version import StrictVersion, LooseVersion -missingwx = "Matplotlib backend_wx and backend_wxagg require wxPython>=2.9" +import wx +backend_version = wx.VERSION_STRING +is_phoenix = 'phoenix' in wx.PlatformInfo -try: - import wx - backend_version = wx.VERSION_STRING - is_phoenix = 'phoenix' in wx.PlatformInfo -except ImportError: - raise ImportError(missingwx) - -try: - wx_version = StrictVersion(wx.VERSION_STRING) -except ValueError: - wx_version = LooseVersion(wx.VERSION_STRING) - -# Ensure we have the correct version imported -if wx_version < str("2.9"): - raise ImportError(missingwx) - if is_phoenix: # define all the wxPython phoenix stuff @@ -157,22 +142,11 @@ def _AddTool(parent, wx_ids, text, bmp, tooltip_text): else: add_tool = parent.DoAddTool - if not is_phoenix or wx_version >= str("4.0.0b2"): - # NOTE: when support for Phoenix prior to 4.0.0b2 is dropped then - # all that is needed is this clause, and the if and else clause can - # be removed. - kwargs = dict(label=text, - bitmap=bmp, - bmpDisabled=wx.NullBitmap, - shortHelp=text, - longHelp=tooltip_text, - kind=kind) - else: - kwargs = dict(label=text, - bitmap=bmp, - bmpDisabled=wx.NullBitmap, - shortHelpString=text, - longHelpString=tooltip_text, - kind=kind) + kwargs = dict(label=text, + bitmap=bmp, + bmpDisabled=wx.NullBitmap, + shortHelp=text, + longHelp=tooltip_text, + kind=kind) return add_tool(wx_ids[text], **kwargs) diff --git a/setupext.py b/setupext.py index 37679d9f3bb3..7221a8dc658f 100644 --- a/setupext.py +++ b/setupext.py @@ -1567,33 +1567,12 @@ class BackendWxAgg(OptionalBackendPackage): name = "wxagg" def check_requirements(self): - wxversioninstalled = True - try: - import wxversion - except ImportError: - wxversioninstalled = False - - if wxversioninstalled: - try: - _wx_ensure_failed = wxversion.AlreadyImportedError - except AttributeError: - _wx_ensure_failed = wxversion.VersionError - - try: - wxversion.ensureMinimal('2.9') - except _wx_ensure_failed: - pass - try: import wx backend_version = wx.VERSION_STRING except ImportError: raise CheckFailed("requires wxPython") - if not is_min_version(backend_version, "2.9"): - raise CheckFailed( - "Requires wxPython 2.9, found %s" % backend_version) - return "version %s" % backend_version diff --git a/tutorials/introductory/usage.py b/tutorials/introductory/usage.py index 5d56b9f4a3b6..fde76daf7532 100644 --- a/tutorials/introductory/usage.py +++ b/tutorials/introductory/usage.py @@ -437,9 +437,8 @@ def my_plotter(ax, data1, data2, param_dict): # Qt4Agg Agg rendering to a :term:`Qt4` canvas (requires PyQt4_ or # ``pyside``). This backend can be activated in IPython with # ``%matplotlib qt4``. -# WXAgg Agg rendering to a :term:`wxWidgets` canvas (requires wxPython_; -# v4.0 (in beta) is required for Python3). This backend can be -# activated in IPython with ``%matplotlib wx``.# +# WXAgg Agg rendering to a :term:`wxWidgets` canvas (requires wxPython_ 4). +# This backend can be activated in IPython with ``%matplotlib wx``. # ========= ================================================================ # # .. _`Anti-Grain Geometry`: http://antigrain.com/