diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 84c73e3e3289..b4a1bbbf35fa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -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: "" diff --git a/lib/matplotlib/backends/backend_qt.py b/lib/matplotlib/backends/backend_qt.py index bfbdf62fd27b..5b74176befff 100644 --- a/lib/matplotlib/backends/backend_qt.py +++ b/lib/matplotlib/backends/backend_qt.py @@ -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. @@ -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, @@ -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, diff --git a/lib/matplotlib/backends/qt_editor/_formlayout.py b/lib/matplotlib/backends/qt_editor/_formlayout.py index 9ca8963e2b23..8c3127bdbeee 100644 --- a/lib/matplotlib/backends/qt_editor/_formlayout.py +++ b/lib/matplotlib/backends/qt_editor/_formlayout.py @@ -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__) @@ -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( diff --git a/lib/matplotlib/testing/conftest.py b/lib/matplotlib/testing/conftest.py index 678825f4a89d..996bfbefef80 100644 --- a/lib/matplotlib/testing/conftest.py +++ b/lib/matplotlib/testing/conftest.py @@ -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) diff --git a/lib/matplotlib/tests/test_sphinxext.py b/lib/matplotlib/tests/test_sphinxext.py index 02d56aeedc55..f71c6e32018a 100644 --- a/lib/matplotlib/tests/test_sphinxext.py +++ b/lib/matplotlib/tests/test_sphinxext.py @@ -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): diff --git a/setup.py b/setup.py index d3c79e9ad1f6..e1a2b261ddbe 100644 --- a/setup.py +++ b/setup.py @@ -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', ],