Skip to content
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

Add Python 3.10 testing. #20864

Merged
merged 5 commits into from Aug 24, 2021
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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 @@ -626,9 +626,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 @@ -651,9 +651,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 @@ -883,13 +883,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 @@ -304,6 +304,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