Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Remove some wx version checks. #10636

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion 2 .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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' &&
Expand Down
17 changes: 7 additions & 10 deletions 17 doc/sphinxext/mock_gui_toolkits.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}
44 changes: 9 additions & 35 deletions 44 lib/matplotlib/backends/wx_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
21 changes: 0 additions & 21 deletions 21 setupext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
5 changes: 2 additions & 3 deletions 5 tutorials/introductory/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.