Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d4ff5fa

Browse files
authored
Merge pull request #30918 from tacaswell/fix/py314_eventloop
TST: account for asyncio changes in py314
2 parents 8149fb5 + 6463594 commit d4ff5fa

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

.github/workflows/tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ jobs:
7373
pygobject-ver: '<3.52.0'
7474
- os: ubuntu-24.04
7575
python-version: '3.12'
76+
- os: ubuntu-24.04
77+
python-version: '3.14'
7678
- os: ubuntu-24.04-arm
7779
python-version: '3.12'
7880
- os: macos-14 # This runner is on M1 (arm64) chips.
@@ -87,6 +89,10 @@ jobs:
8789
python-version: '3.13'
8890
# https://github.com/matplotlib/matplotlib/issues/29732
8991
pygobject-ver: '<3.52.0'
92+
- os: macos-15 # This runner is on M1 (arm64) chips.
93+
python-version: '3.14'
94+
# https://github.com/matplotlib/matplotlib/issues/29732
95+
pygobject-ver: '<3.52.0'
9096

9197
steps:
9298
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
@@ -264,8 +270,8 @@ jobs:
264270
# Even though PySide2 wheels can be installed on Python 3.12+, they are broken and since PySide2 is
265271
# deprecated, they are unlikely to be fixed. For the same deprecation reason, there are no wheels
266272
# on M1 macOS, so don't bother there either.
267-
if [[ "${{ matrix.os }}" != 'macos-14'
268-
&& "${{ matrix.python-version }}" != '3.12' && "${{ matrix.python-version }}" != '3.13' ]]; then
273+
if [[ "${{ matrix.os }}" != 'macos-14' && "${{ matrix.python-version }}" == '3.11'
274+
]]; then
269275
python -mpip install --upgrade pyside2 &&
270276
python -c 'import PySide2.QtCore' &&
271277
echo 'PySide2 is available' ||

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,10 @@ def check_alt_backend(alt_backend):
208208
if fig.canvas.toolbar: # i.e toolbar2.
209209
fig.canvas.toolbar.draw_rubberband(None, 1., 1, 2., 2)
210210

211+
if backend == 'webagg' and sys.version_info >= (3, 14):
212+
import asyncio
213+
asyncio.set_event_loop(asyncio.new_event_loop())
214+
211215
timer = fig.canvas.new_timer(1.) # Test that floats are cast to int.
212216
timer.add_callback(KeyEvent("key_press_event", fig.canvas, "q")._process)
213217
# Trigger quitting upon draw.

0 commit comments

Comments
 (0)