Skip to content

Commit be90e6b

Browse files
committed
workflows: test-matplotlib: patch source, simplify python-wheels path
Add two patches for our matplotlib tests: - One to increase a threading test timeout, helping to overcome hardware limitations (marked as "Inappropriate" as it's unique for our setup) - One to backport a fix from upstream main, which is proposed for backporting into the 3.11.x releases but not part of 3.11.0. This pins pytest below version 9.1.0 due to how that version results in numerous errors being reported during the test runs (marked as "Backport" with a commit link). Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
1 parent e65cc2a commit be90e6b

2 files changed

Lines changed: 60 additions & 6 deletions

File tree

.github/workflows/test-matplotlib.yml

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,6 @@ jobs:
4747
python-version: '3.12'
4848

4949
steps:
50-
- name: Checkout python-wheels
51-
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
52-
with:
53-
path: python-wheels-repo
54-
persist-credentials: false
55-
5650
- name: Checkout matplotlib v${{ env.MPL_VERSION }}
5751
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
5852
with:
@@ -61,13 +55,25 @@ jobs:
6155
fetch-depth: 0
6256
persist-credentials: false
6357

58+
- name: Checkout python-wheels
59+
uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
60+
with:
61+
path: python-wheels
62+
persist-credentials: false
63+
6464
- name: Set up Python ${{ matrix.python-version }}
6565
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
6666
with:
6767
python-version: ${{ matrix.python-version }}
6868
activate-environment: true
6969
enable-cache: false
7070

71+
# We need to patch the matplotlib source to increase a threading test
72+
# timeout for the native runners
73+
- name: patch matplotlib source
74+
run: |
75+
git apply python-wheels/patches/matplotlib/${{ env.MPL_VERSION }}/00*.patch
76+
7177
- name: Install OS dependencies
7278
run: |
7379
echo 'Acquire::Retries "3";' | sudo tee /etc/apt/apt.conf.d/80-retries
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
From afb7f27453493011e33d7bc84be964fbe84eeaf3 Mon Sep 17 00:00:00 2001
2+
From: Ruth Comer <10599679+rcomer@users.noreply.github.com>
3+
Date: Sun, 14 Jun 2026 21:04:35 +0100
4+
Subject: [PATCH] TST: temporarily pin pytest
5+
6+
Upstream-Status: Backport [https://github.com/matplotlib/matplotlib/pull/31896/changes/afb7f27]
7+
8+
Upstream devs have pinned pytest below 9.1.0 due to numerous test failures. This
9+
commit is only in main so far. We should backport it to avoid various
10+
TestSpectral errors on our end.
11+
12+
See also: https://github.com/matplotlib/matplotlib/issues/31897
13+
14+
Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com>
15+
---
16+
environment.yml | 2 +-
17+
pyproject.toml | 2 +-
18+
2 files changed, 2 insertions(+), 2 deletions(-)
19+
20+
diff --git a/environment.yml b/environment.yml
21+
index 27624759ea..057b8466fe 100644
22+
--- a/environment.yml
23+
+++ b/environment.yml
24+
@@ -63,7 +63,7 @@ dependencies:
25+
- psutil
26+
- prek
27+
- pydocstyle>=5.1.0
28+
- - pytest!=4.6.0,!=5.4.0,!=8.1.0
29+
+ - pytest!=4.6.0,!=5.4.0,!=8.1.0,<9.1.0
30+
- pytest-cov
31+
- pytest-rerunfailures
32+
- pytest-timeout
33+
diff --git a/pyproject.toml b/pyproject.toml
34+
index cf0cde26cd..b63ce715ed 100644
35+
--- a/pyproject.toml
36+
+++ b/pyproject.toml
37+
@@ -129,7 +129,7 @@ test = [
38+
"certifi",
39+
"coverage!=6.3",
40+
"psutil; sys_platform != 'cygwin'",
41+
- "pytest!=4.6.0,!=5.4.0,!=8.1.0",
42+
+ "pytest!=4.6.0,!=5.4.0,!=8.1.0,<9.1.0",
43+
"pytest-cov",
44+
"pytest-rerunfailures!=16.0",
45+
"pytest-timeout",
46+
--
47+
2.55.0
48+

0 commit comments

Comments
 (0)