From 2a94a7ff1338708e49dbc23ed48734b260faafd2 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 31 Dec 2025 09:55:20 -0500 Subject: [PATCH 1/3] TST: account for asyncio changes in py314 An EventLoop will no longer be implicitly created by `get_event_loop()` Closes #30917 --- lib/matplotlib/tests/test_backends_interactive.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/matplotlib/tests/test_backends_interactive.py b/lib/matplotlib/tests/test_backends_interactive.py index 6bc7de433825..101c1cb81cad 100644 --- a/lib/matplotlib/tests/test_backends_interactive.py +++ b/lib/matplotlib/tests/test_backends_interactive.py @@ -208,6 +208,10 @@ def check_alt_backend(alt_backend): if fig.canvas.toolbar: # i.e toolbar2. fig.canvas.toolbar.draw_rubberband(None, 1., 1, 2., 2) + if backend == 'webagg' and sys.version_info >= (3, 14): + import asyncio + asyncio.set_event_loop(asyncio.new_event_loop()) + timer = fig.canvas.new_timer(1.) # Test that floats are cast to int. timer.add_callback(KeyEvent("key_press_event", fig.canvas, "q")._process) # Trigger quitting upon draw. From c5ba854ec91736fdb84793f739ddd5d85f927f11 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 31 Dec 2025 10:03:44 -0500 Subject: [PATCH 2/3] CI: add py314 to test matrix on GHA --- .github/workflows/tests.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 048f11be14d2..bd18ceca9f7b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -73,6 +73,8 @@ jobs: pygobject-ver: '<3.52.0' - os: ubuntu-24.04 python-version: '3.12' + - os: ubuntu-24.04 + python-version: '3.14' - os: ubuntu-24.04-arm python-version: '3.12' - os: macos-14 # This runner is on M1 (arm64) chips. @@ -87,6 +89,10 @@ jobs: python-version: '3.13' # https://github.com/matplotlib/matplotlib/issues/29732 pygobject-ver: '<3.52.0' + - os: macos-15 # This runner is on M1 (arm64) chips. + python-version: '3.14' + # https://github.com/matplotlib/matplotlib/issues/29732 + pygobject-ver: '<3.52.0' steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 From 6463594e511147dd2c89ac6bd7beddfde0a611d2 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Wed, 31 Dec 2025 10:56:42 -0500 Subject: [PATCH 3/3] CI: only try to install pyside2 on py311 --- .github/workflows/tests.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bd18ceca9f7b..679fa230783b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -270,8 +270,8 @@ jobs: # Even though PySide2 wheels can be installed on Python 3.12+, they are broken and since PySide2 is # deprecated, they are unlikely to be fixed. For the same deprecation reason, there are no wheels # on M1 macOS, so don't bother there either. - if [[ "${{ matrix.os }}" != 'macos-14' - && "${{ matrix.python-version }}" != '3.12' && "${{ matrix.python-version }}" != '3.13' ]]; then + if [[ "${{ matrix.os }}" != 'macos-14' && "${{ matrix.python-version }}" == '3.11' + ]]; then python -mpip install --upgrade pyside2 && python -c 'import PySide2.QtCore' && echo 'PySide2 is available' ||