Skip to content

FIX: deprecate qt4/5 rcparams #10351

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 2 commits into from
Jan 31, 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
37 changes: 18 additions & 19 deletions lib/matplotlib/rcsetup.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,27 +267,26 @@ def validate_backend(s):


def validate_qt4(s):
# Don't spam the test suite with warnings every time the rcparams are
# reset. While it may seem better to use filterwarnings from within the
# test suite, pytest 3.1+ explicitly disregards warnings filters (pytest
# issue #2430).
if not testing.is_called_from_pytest():
cbook.warn_deprecated(
"2.2",
"The backend.qt4 rcParam was deprecated in version 2.2. In order "
"to force the use of a specific Qt4 binding, either import that "
"binding first, or set the QT_API environment variable.")
if s is None:
# return a reasonable default for deprecation period
return 'PyQt4'
cbook.warn_deprecated(
"2.2",
"The backend.qt4 rcParam was deprecated in version 2.2. In order "
"to force the use of a specific Qt4 binding, either import that "
"binding first, or set the QT_API environment variable.")
return ValidateInStrings("backend.qt4", ['PyQt4', 'PySide', 'PyQt4v2'])(s)


def validate_qt5(s):
# See comment re: validate_qt4.
if not testing.is_called_from_pytest():
cbook.warn_deprecated(
"2.2",
"The backend.qt5 rcParam was deprecated in version 2.2. In order "
"to force the use of a specific Qt5 binding, either import that "
"binding first, or set the QT_API environment variable.")
if s is None:
# return a reasonable default for deprecation period
return 'PyQt5'
cbook.warn_deprecated(
"2.2",
"The backend.qt5 rcParam was deprecated in version 2.2. In order "
"to force the use of a specific Qt5 binding, either import that "
"binding first, or set the QT_API environment variable.")
return ValidateInStrings("backend.qt5", ['PyQt5', 'PySide2'])(s)


Expand Down Expand Up @@ -958,8 +957,8 @@ def _validate_linestyle(ls):
'backend': ['Agg', validate_backend], # agg is certainly
# present
'backend_fallback': [True, validate_bool], # agg is certainly present
'backend.qt4': ['PyQt4', validate_qt4],
'backend.qt5': ['PyQt5', validate_qt5],
'backend.qt4': [None, validate_qt4],
'backend.qt5': [None, validate_qt5],
'webagg.port': [8988, validate_int],
'webagg.address': ['127.0.0.1', validate_webagg_address],
'webagg.open_in_browser': [True, validate_bool],
Expand Down
5 changes: 0 additions & 5 deletions matplotlibrc.template
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@
# non-interactive backend.
backend : $TEMPLATE_BACKEND

# If you are using the Qt4Agg backend, you can choose here
# to use the PyQt4 bindings or the newer PySide bindings to
# the underlying Qt4 toolkit.
#backend.qt4 : PyQt4 # PyQt4 | PySide

# Note that this can be overridden by the environment variable
# QT_API used by Enthought Tool Suite (ETS); valid values are
# "pyqt" and "pyside". The "pyqt" setting has the side effect of
Expand Down
9 changes: 2 additions & 7 deletions tutorials/introductory/usage.py
Original file line number Diff line number Diff line change
Expand Up @@ -495,13 +495,8 @@ def my_plotter(ax, data1, data2, param_dict):
# How do I select PyQt4 or PySide?
# --------------------------------
#
# You can choose either PyQt4 or PySide when using the `qt4` backend by setting
# the appropriate value for `backend.qt4` in your :file:`matplotlibrc` file. The
# default value is `PyQt4`.
#
# The setting in your :file:`matplotlibrc` file can be overridden by setting the
# `QT_API` environment variable to either `pyqt` or `pyside` to use `PyQt4` or
# `PySide`, respectively.
# The `QT_API` environment variable can be set to either `pyqt` or `pyside`
# to use `PyQt4` or `PySide`, respectively.
#
# Since the default value for the bindings to be used is `PyQt4`,
# :mod:`matplotlib` first tries to import it, if the import fails, it tries to
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy