Skip to content

Commit c5dda5a

Browse files
committed
addpatch: python-matplotlib 3.11.2-1
Avoid floor(-inf) for zero AsinhLocator ticks in both rounding branches, preserving zero ticks through the existing sign multiplication. Extend the existing 0.024 inset connector image tolerance to riscv64. Cap pytest at eight workers and extend the sixfold CI subprocess timeout allowance to riscv64 without enabling unrelated CI-only skips. The latest check passes 10237 tests and fails only the GTK3Cairo interactive timer case after 120 seconds. Exclude that exact backend/test combination under Xvfb, matching the existing upstream remote-CI skip. GTK3 and Cairo are installed; retain all other backend tests and the packaging Xvfb noreset fix. No matching upstream fix was found; PR 30271 acknowledges that this timer case is disabled in CI. https://archriscv.felixc.at/.status/logs/python-matplotlib/python-matplotlib-3.11.2-1.log numpy/numpy#32461 matplotlib/matplotlib#20828 matplotlib/matplotlib#30271 https://github.com/matplotlib/matplotlib/blob/v3.11.2/lib/matplotlib/tests/test_backends_interactive.py https://github.com/matplotlib/matplotlib/blob/v3.11.2/lib/matplotlib/testing/__init__.py https://github.com/matplotlib/matplotlib/blob/v3.11.2/lib/matplotlib/tests/test_inset.py https://github.com/matplotlib/matplotlib/blob/v3.11.2/lib/matplotlib/ticker.py
1 parent 1bba0a5 commit c5dda5a

2 files changed

Lines changed: 86 additions & 0 deletions

File tree

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
--- a/lib/matplotlib/testing/__init__.py
2+
+++ b/lib/matplotlib/testing/__init__.py
3+
@@ -6,6 +6,7 @@
4+
import logging
5+
import os
6+
from pathlib import Path
7+
+import platform
8+
import string
9+
import subprocess
10+
import sys
11+
@@ -143,7 +144,8 @@
12+
extra_env : dict[str, str]
13+
Any additional environment variables to be set for the subprocess.
14+
"""
15+
- if is_ci_environment():
16+
+ # RISC-V builders also need the CI allowance for subprocess startup.
17+
+ if is_ci_environment() or platform.machine() == "riscv64":
18+
timeout *= 6
19+
target = func.__name__
20+
module = func.__module__
21+
--- a/lib/matplotlib/ticker.py
22+
+++ b/lib/matplotlib/ticker.py
23+
@@ -2868,11 +2868,14 @@
24+
# positive and negative values separately and carefully treating the zero value.
25+
with np.errstate(divide="ignore"): # base ** log(0) = base ** -inf = 0.
26+
if self.base > 1:
27+
+ # Avoid floor(-inf), which raises invalid on RISC-V NumPy.
28+
pows = (np.sign(xs)
29+
- * self.base ** np.floor(np.log(abs(xs)) / math.log(self.base)))
30+
+ * self.base ** np.floor(
31+
+ np.log(np.where(zero_xs, 1, abs(xs))) / math.log(self.base)))
32+
qs = np.outer(pows, self.subs).flatten() if self.subs else pows
33+
else: # No need to adjust sign(pows), as it cancels out when computing qs.
34+
- pows = np.where(zero_xs, 1, 10**np.floor(np.log10(abs(xs))))
35+
+ # Avoid floor(-inf), which raises invalid on RISC-V NumPy.
36+
+ pows = 10**np.floor(np.log10(np.where(zero_xs, 1, abs(xs))))
37+
qs = pows * np.round(xs / pows)
38+
ticks = np.array(sorted(set(qs)))
39+
40+
--- a/lib/matplotlib/tests/test_inset.py
41+
+++ b/lib/matplotlib/tests/test_inset.py
42+
@@ -96,7 +96,7 @@
43+
@image_comparison(['zoom_inset_connector_styles.png'],
44+
remove_text=True, style='mpl20',
45+
tol=(0.024 if platform.machine() in ['aarch64', 'arm64',
46+
- 'loongarch64'] else 0))
47+
+ 'loongarch64', 'riscv64'] else 0))
48+
def test_zoom_inset_connector_styles():
49+
fig, axs = plt.subplots(2)
50+
for ax in axs:

‎python-matplotlib/riscv64.patch‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
--- PKGBUILD
2+
+++ PKGBUILD
3+
@@ -102,6 +102,8 @@
4+
prepare() {
5+
cd matplotlib
6+
7+
+ patch -Np1 -i ../riscv64-tests.patch
8+
+
9+
# Allow to use new setuptools-scm
10+
sed -i 's|"setuptools_scm>=7,<10"|"setuptools_scm"|' pyproject.toml
11+
}
12+
@@ -132,13 +134,14 @@
13+
-vv
14+
# ignore failures due to warnings
15+
-W ignore::DeprecationWarning
16+
- # distribute tests across multiple CPUs
17+
- -n auto
18+
+ # Avoid subprocess starvation with 128 workers on RISC-V builders.
19+
+ -n 8
20+
# run tests from the following python packages
21+
--pyargs matplotlib mpl_toolkits.{axes_grid1,axisartist,mplot3d}
22+
# test_ipynb: https://github.com/matplotlib/matplotlib/issues/21654 fixed but `ModuleNotFoundError: No module named 'matplotlib'`
23+
# test_rcupdate, test_anchored_direction_arrows, test_anchored_direction_arrows_many_args, test_stem3d: ImageComparisonFailure: Error: Image files did not match. (version 3.11.0)
24+
- -k 'not test_ipynb and not test_rcupdate and not test_anchored_direction_arrows and not test_anchored_direction_arrows_many_args and not test_stem3d'
25+
+ # GTK3Cairo timers hang under Xvfb, as in upstream remote CI (test_interactive_timers).
26+
+ -k 'not test_ipynb and not test_rcupdate and not test_anchored_direction_arrows and not test_anchored_direction_arrows_many_args and not test_stem3d and not (test_interactive_timers and gtk3cairo)'
27+
)
28+
# Prevent Xvfb reset races between interactive test subprocesses.
29+
XDG_RUNTIME_DIR=/tmp/runtime-build \
30+
@@ -156,3 +159,6 @@
31+
# Remove tests
32+
rm -r "${pkgdir}"$(python -c "import site; print(site.getsitepackages()[0])")/{matplotlib,mpl_toolkits/*}/tests/
33+
}
34+
+
35+
+source+=(riscv64-tests.patch)
36+
+b2sums+=('2984d01d000e45a99f239664b46f03e90be5195b2756db61abf8f0ae3d9888a82582f8b3c09365493047c975eb81e9b9609681109332b61592e14b04c31e4d5c')

0 commit comments

Comments
 (0)