Skip to content

Commit

Permalink
Merge pull request #20888 from meeseeksmachine/auto-backport-of-pr-20…
Browse files Browse the repository at this point in the history
…864-on-v3.5.x

Backport PR #20864 on branch v3.5.x (Add Python 3.10 testing.)
  • Loading branch information
QuLogic committed Aug 24, 2021
2 parents d6ad47e + 4b3d1d8 commit 0796fe6
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 16 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/tests.yml
Expand Up @@ -41,6 +41,11 @@ jobs:
python-version: 3.9
extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
- os: ubuntu-20.04
python-version: '3.10-dev'
# Re-add this when extra dependencies have wheels.
# extra-requirements: '-r requirements/testing/extra.txt'
XVFB_RUN: xvfb-run -a
- os: macos-latest
python-version: 3.8
XVFB_RUN: ""
Expand Down
24 changes: 12 additions & 12 deletions lib/matplotlib/backends/backend_qt.py
Expand Up @@ -630,9 +630,9 @@ class NavigationToolbar2QT(NavigationToolbar2, QtWidgets.QToolBar):
def __init__(self, canvas, parent, coordinates=True):
"""coordinates: should we show the coordinates on the right?"""
QtWidgets.QToolBar.__init__(self, parent)
self.setAllowedAreas(
_enum("QtCore.Qt.ToolBarArea").TopToolBarArea
| _enum("QtCore.Qt.ToolBarArea").TopToolBarArea)
self.setAllowedAreas(QtCore.Qt.ToolBarArea(
_to_int(_enum("QtCore.Qt.ToolBarArea").TopToolBarArea) |
_to_int(_enum("QtCore.Qt.ToolBarArea").BottomToolBarArea)))

self.coordinates = coordinates
self._actions = {} # mapping of toolitem method names to QActions.
Expand All @@ -655,9 +655,9 @@ def __init__(self, canvas, parent, coordinates=True):
# will resize this label instead of the buttons.
if self.coordinates:
self.locLabel = QtWidgets.QLabel("", self)
self.locLabel.setAlignment(
_enum("QtCore.Qt.AlignmentFlag").AlignRight
| _enum("QtCore.Qt.AlignmentFlag").AlignVCenter)
self.locLabel.setAlignment(QtCore.Qt.AlignmentFlag(
_to_int(_enum("QtCore.Qt.AlignmentFlag").AlignRight) |
_to_int(_enum("QtCore.Qt.AlignmentFlag").AlignVCenter)))
self.locLabel.setSizePolicy(QtWidgets.QSizePolicy(
_enum("QtWidgets.QSizePolicy.Policy").Expanding,
_enum("QtWidgets.QSizePolicy.Policy").Ignored,
Expand Down Expand Up @@ -887,13 +887,13 @@ class ToolbarQt(ToolContainerBase, QtWidgets.QToolBar):
def __init__(self, toolmanager, parent):
ToolContainerBase.__init__(self, toolmanager)
QtWidgets.QToolBar.__init__(self, parent)
self.setAllowedAreas(
_enum("QtCore.Qt.ToolBarArea").TopToolBarArea
| _enum("QtCore.Qt.ToolBarArea").TopToolBarArea)
self.setAllowedAreas(QtCore.Qt.ToolBarArea(
_to_int(_enum("QtCore.Qt.ToolBarArea").TopToolBarArea) |
_to_int(_enum("QtCore.Qt.ToolBarArea").BottomToolBarArea)))
message_label = QtWidgets.QLabel("")
message_label.setAlignment(
_enum("QtCore.Qt.AlignmentFlag").AlignRight
| _enum("QtCore.Qt.AlignmentFlag").AlignVCenter)
message_label.setAlignment(QtCore.Qt.AlignmentFlag(
_to_int(_enum("QtCore.Qt.AlignmentFlag").AlignRight) |
_to_int(_enum("QtCore.Qt.AlignmentFlag").AlignVCenter)))
message_label.setSizePolicy(QtWidgets.QSizePolicy(
_enum("QtWidgets.QSizePolicy.Policy").Expanding,
_enum("QtWidgets.QSizePolicy.Policy").Ignored,
Expand Down
10 changes: 7 additions & 3 deletions lib/matplotlib/backends/qt_editor/_formlayout.py
Expand Up @@ -48,7 +48,7 @@

from matplotlib import _api, colors as mcolors
from .. import qt_compat
from ..qt_compat import QtGui, QtWidgets, QtCore, _enum
from ..qt_compat import QtGui, QtWidgets, QtCore, _enum, _to_int

_log = logging.getLogger(__name__)

Expand Down Expand Up @@ -441,8 +441,12 @@ def __init__(self, data, title="", comment="",

# Button box
self.bbox = bbox = QtWidgets.QDialogButtonBox(
_enum("QtWidgets.QDialogButtonBox.StandardButton").Ok
| _enum("QtWidgets.QDialogButtonBox.StandardButton").Cancel)
QtWidgets.QDialogButtonBox.StandardButton(
_to_int(
_enum("QtWidgets.QDialogButtonBox.StandardButton").Ok) |
_to_int(
_enum("QtWidgets.QDialogButtonBox.StandardButton").Cancel)
))
self.formwidget.update_buttons.connect(self.update_buttons)
if self.apply_callback is not None:
apply_btn = bbox.addButton(
Expand Down
3 changes: 3 additions & 0 deletions lib/matplotlib/testing/conftest.py
Expand Up @@ -21,6 +21,9 @@ def pytest_configure(config):
("filterwarnings", "error"),
("filterwarnings",
"ignore:.*The py23 module has been deprecated:DeprecationWarning"),
("filterwarnings",
r"ignore:DynamicImporter.find_spec\(\) not found; "
r"falling back to find_module\(\):ImportWarning"),
]:
config.addinivalue_line(key, value)

Expand Down
3 changes: 2 additions & 1 deletion lib/matplotlib/tests/test_sphinxext.py
Expand Up @@ -10,7 +10,8 @@
import pytest


pytest.importorskip('sphinx')
pytest.importorskip('sphinx',
minversion=None if sys.version_info < (3, 10) else '4.1.3')


def test_tinypages(tmpdir):
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -299,6 +299,7 @@ def make_release_tree(self, base_dir, files):
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Topic :: Scientific/Engineering :: Visualization',
],

Expand Down

0 comments on commit 0796fe6

Please sign in to comment.