Compare commits

..

4 Commits

5 changed files with 207 additions and 30 deletions

36
Pillow-13-compat.patch Normal file
View File

@@ -0,0 +1,36 @@
From 0b2fa3f952b6b97a121a3d7f05a0753b52b802cc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= <cr52@protonmail.com>
Date: Sat, 28 Jun 2025 11:39:49 +0200
Subject: [PATCH] BUG: fix future incompatibility with Pillow 13
---
lib/matplotlib/backends/_backend_tk.py | 2 +-
lib/matplotlib/backends/backend_pdf.py | 2 ++-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/lib/matplotlib/backends/_backend_tk.py b/lib/matplotlib/backends/_backend_tk.py
index 0bbff1379ffa..eaf868fd8bec 100644
--- a/lib/matplotlib/backends/_backend_tk.py
+++ b/lib/matplotlib/backends/_backend_tk.py
@@ -775,7 +775,7 @@ def _recolor_icon(image, color):
image_data = np.asarray(image).copy()
black_mask = (image_data[..., :3] == 0).all(axis=-1)
image_data[black_mask, :3] = color
- return Image.fromarray(image_data, mode="RGBA")
+ return Image.fromarray(image_data)
# Use the high-resolution (48x48 px) icon if it exists and is needed
with Image.open(path_large if (size > 24 and path_large.exists())
diff --git a/lib/matplotlib/backends/backend_pdf.py b/lib/matplotlib/backends/backend_pdf.py
index f20bdffd4a3a..4429dc9ba707 100644
--- a/lib/matplotlib/backends/backend_pdf.py
+++ b/lib/matplotlib/backends/backend_pdf.py
@@ -1784,7 +1784,7 @@ def _writeImg(self, data, id, smask=None):
data[:, :, 2])
indices = np.argsort(palette24).astype(np.uint8)
rgb8 = indices[np.searchsorted(palette24, rgb24, sorter=indices)]
- img = Image.fromarray(rgb8, mode='P')
+ img = Image.fromarray(rgb8).convert("P")
img.putpalette(palette)
png_data, bit_depth, palette = self._writePng(img)
if bit_depth is None or palette is None:

BIN
matplotlib-3.10.3.tar.gz (Stored with Git LFS) Normal file

Binary file not shown.

BIN
matplotlib-3.9.0.tar.gz (Stored with Git LFS)

Binary file not shown.

View File

@@ -1,3 +1,101 @@
-------------------------------------------------------------------
Thu Jul 3 07:36:25 UTC 2025 - Nico Krapp <nico.krapp@suse.com>
- Add Pillow-13-compat.patch to fix tests with new Pillow version
-------------------------------------------------------------------
Mon Jun 9 15:35:10 UTC 2025 - Ben Greiner <code@bnavigator.de>
- Update to 3.10.3
* Two Bugfix releases. No notable changes beyond the GitHub
statistics of merged PRs.
(https://matplotlib.org/stable/users/github_stats.html#github-stats)
- Remove wxPython backend from Ring1
- Clarify Qt Support
-------------------------------------------------------------------
Mon Jun 2 07:48:07 UTC 2025 - Dirk Müller <dmueller@suse.com>
- switch to generate Qt6 bindings as Qt5 is going EOL
-------------------------------------------------------------------
Thu Apr 3 15:16:55 UTC 2025 - Antonio Larrosa <alarrosa@suse.com>
- Disable two more tests in SLFO that use Qt bindings.
-------------------------------------------------------------------
Mon Mar 24 12:24:37 UTC 2025 - Antonio Larrosa <alarrosa@suse.com>
- We're removing all python Qt bindings from SLE16, so don't build
the qt backend nor test it there.
-------------------------------------------------------------------
Fri Mar 21 08:55:15 UTC 2025 - Markéta Machová <mmachova@suse.com>
- Update to 3.10.1
* Respect array alpha with interpolation_stage='rgba'
* Remove md5 usage to prevent issues on FIPS enabled systems
* Fix pyplot.matshow figure handling
* Fix modifying Axes' position also alters the original Bbox object
used for initialization
* Fix title position for polar plots
* Add version gate to GTK4 calls when necessary
* Raise warning if both c and facecolors are used in scatter plot
- Drop merged matplotlib-pr29631-install-test-ipynb.patch
- Skip test failing with texlive 2025
-------------------------------------------------------------------
Sun Feb 16 20:07:11 UTC 2025 - Ben Greiner <code@bnavigator.de>
- Fix testfiles
* Move extra files tagged for tests to testdata package
* Add matplotlib-pr29631-install-test-ipynb.patch
gh#matplotlib/matplotlib#29631
-------------------------------------------------------------------
Mon Feb 3 11:21:46 UTC 2025 - Markéta Machová <mmachova@suse.com>
- update to 3.10.0
* Preliminary support for free-threaded CPython 3.13
* New more-accessible color cycle
* Dark-mode diverging colormaps
* Exception handling control
* InsetIndicator artist
* FillBetweenPolyCollection
* Fill between 3D lines
* Data in 3D plots can now be dynamically clipped to the axes
view limits
* Rotating 3d plots with the mouse
* Increased Figure limits with Agg renderer
* Subfigures no longer provisional
* Subfigures are now added in row-major order
* Improve compatibility with pytest 8.2.0
-------------------------------------------------------------------
Thu Oct 24 19:04:27 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 3.9.2:
* Be more resilient to I/O failures when writing font cache
* Fix nondeterministic behavior with subplot spacing and
constrained layout
* Fix sticky edge tolerance relative to data range
* Improve formatting of image values in cases of singular norms
* Re-add matplotlib.cm.get_cmap; note this function will still
be removed at a later date
* Allow duplicate backend entry points
* Fix Axes autoscaling of thin bars at large locations
* Fix Axes autoscaling with axhspan / axvspan
* Fix Axes3D autoscaling of Line3DCollection / Poly3DCollection
* Fix Axes3D mouse interactivity with non-default roll angle
* Fix box aspect ratios in Axes3D with alternate vertical axis
* Fix case handling of backends specified as module://...
* Fix crash with TkAgg on Windows with tk.window_focus: True
* Fix interactive update of SubFigures
* Fix interactivity when using the IPython console
* Fix pickling of AxesWidgets and SubFigures
* Fix scaling on GTK3Cairo / GTK4Cairo backends
* Fix text wrapping within SubFigures
-------------------------------------------------------------------
Wed Oct 23 08:30:59 UTC 2024 - Daniel Garcia <daniel.garcia@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-matplotlib
#
# Copyright (c) 2024 SUSE LLC
# Copyright (c) 2025 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -29,9 +29,24 @@ ExclusiveArch: x86_64 aarch64
%bcond_with test
%endif
%bcond_with ringdisabled
# Qt support through PyQt6 is in Leap16 but not SLFO
%if 0%{?suse_version} == 1600 && !0%{?is_opensuse}
%bcond_with qt
%else
%bcond_without qt
%endif
# Disable wxWidgets backend in Factory Ring 1 (Minimal-X) and SLE <= 16
%if %{with ringdisabled} || 0%{?suse_version} <= %SLE_VERSION
%bcond_with wx
%else
%bcond_without wx
%endif
%{?sle15_python_module_pythons}
Name: python-matplotlib%{psuffix}
Version: 3.9.0
Version: 3.10.3
Release: 0
Summary: Plotting Library for Python
License: SUSE-Matplotlib
@@ -43,7 +58,9 @@ Source98: https://github.com/qhull/qhull/archive/v8.0.2/qhull-8.0.2.tar.gz
Source99: https://downloads.sourceforge.net/project/freetype/freetype2/2.6.1/freetype-2.6.1.tar.gz
Source100: python-matplotlib.rpmlintrc
# PATCH-FEATURE-OPENSUSE matplotlib-meson-options-opensuse.patch code@bnavigator.de -- Custom build options for meson-python
Patch0: matplotlib-meson-options-opensuse.patch
Patch1: matplotlib-meson-options-opensuse.patch
# PATCH-FIX-UPSTREAM Pillow-13-compat.patch https://github.com/matplotlib/matplotlib/pull/30221
Patch2: Pillow-13-compat.patch
Recommends: ghostscript
Recommends: libxml2-tools
Recommends: poppler-tools
@@ -80,17 +97,12 @@ Requires: python-numpy >= 1.23
Requires: python-packaging >= 20.0
Requires: python-pyparsing > 2.3.1
Requires: python-python-dateutil >= 2.7
%if 0%{?python_version_nodots} < 310
Requires: python-importlib-resources >= 3.2.0
%endif
# /SECTION
# SECTION test
%if %{with test}
BuildRequires: %{python_module matplotlib = %{version}}
BuildRequires: %{python_module matplotlib-cairo = %{version}}
BuildRequires: %{python_module matplotlib-gtk3 = %{version}}
BuildRequires: %{python_module matplotlib-gtk4 = %{version}}
BuildRequires: %{python_module matplotlib-qt5 = %{version}}
BuildRequires: %{python_module matplotlib-testdata = %{version}}
BuildRequires: %{python_module matplotlib-tk = %{version}}
BuildRequires: %{python_module matplotlib-web = %{version}}
@@ -99,12 +111,6 @@ BuildRequires: %{python_module pytest-xdist}
BuildRequires: %{python_module pytest-xvfb}
BuildRequires: %{python_module pytest}
BuildRequires: %{python_module pytz}
%if 0%{?suse_version} > %SLE_VERSION
BuildRequires: %{python_module matplotlib-nbagg = %{version} if %python-base >= 3.10}
%endif
%if 0%{?suse_version} > %SLE_VERSION
BuildRequires: %{python_module matplotlib-wx = %{version}}
%endif
# SECTION latex test dependencies
BuildRequires: %{python_module matplotlib-latex = %{version}}
BuildRequires: Mesa-dri
@@ -113,25 +119,30 @@ BuildRequires: inkscape
BuildRequires: poppler-tools
# /SECTION latex
# SECTION cairo backend options
BuildRequires: %{python_module matplotlib-cairo = %{version}}
BuildRequires: %{python_module cairo >= 1.14.0}
BuildRequires: %{python_module cairocffi >= 0.8}
# /SECTION cairo
# SECTION nbagg backend tests
# SECTION nbagg backend tests: not in Minimal-X or SLE <= 16
%if %{without ringdisabled} && 0%{?suse_version} > %SLE_VERSION
BuildRequires: %{python_module matplotlib-nbagg = %{version}}
BuildRequires: %{python_module nbconvert if %python-base >= 3.10}
BuildRequires: %{python_module nbformat if %python-base >= 3.10}
%endif
# /SECTION nbagg
# SECTION qt backends: Only test PyQt5 in Minimal-X
BuildRequires: %{python_module qt5}
%if %{without ringdisabled}
%if 0%{?suse_version} > %SLE_VERSION
# SECTION qt backend tests
%if %{with qt}
BuildRequires: %{python_module PyQt6}
BuildRequires: python3-pyside2
BuildRequires: %{python_module matplotlib-qt = %{version}}
%if %{without ringdisabled} && 0%{?suse_version} > %SLE_VERSION
# Don'test Pyside6 in Minimal-X or Leap <=16
BuildRequires: python3-pyside6
%endif
%endif
# /SECTION qt
%if %{with wx}
BuildRequires: %{python_module matplotlib-wx = %{version}}
%endif
# /SECTION test
%endif
%python_subpackages
@@ -228,12 +239,14 @@ BuildArch: noarch
This package allows %{name} to display latex in plots
and figures.
%if %{with qt}
%package qt
Summary: Qt backend for %{name}
Requires: %{name} = %{version}
Requires: (python-qt5 or python-PyQt6 >= 6.1 or python-pyside2 or python-pyside6)
Requires: (python-PyQt6 >= 6.1 or python-pyside6)
Provides: %{name}-qt-shared = %{version}
Provides: %{name}-qt5 = %{version}
Provides: %{name}-qt6 = %{version}
Obsoletes: %{name}-qt-shared < %{version}
# Renamed at upgrade from MPL 3.6.3 to 3.8.2
Obsoletes: %{name}-qt5 < 3.8.2
@@ -241,7 +254,9 @@ Obsoletes: %{name}-qt5 < 3.8.2
%description qt
This package includes the Qt-based backend
for the %{name} plotting package
PyQt5, PyQt6, Pyside2 or Pyside 6 may be used
PyQt6 or Pyside 6 may be used.
PyQt5 and Pyside2 still work, but are not supported by openSUSE anymore.
%endif
%package testdata
Summary: Test data for %{name}
@@ -271,7 +286,7 @@ Requires: python-tornado
This package includes the browser-based webagg backend
for the %{name} plotting package
%if 0%{?suse_version} > %SLE_VERSION
%if %{with wx}
%package wx
Summary: WxWidgets backend for %{name}
Requires: %{name} = %{version}
@@ -341,6 +356,8 @@ skip_tests+=" or test_compressed1"
# image comparison failures due to precisions dicrepancies to the x86 produced references
skip_tests+=" or png or svg or pdf"
%endif
# test failure with texlive 2025 https://github.com/matplotlib/matplotlib/issues/29790
skip_tests+=" or (test_backend_pgf and test_rcupdate)"
# Fails in SLFO:Main
%if 0%{?suse_version} <= %SLE_VERSION
@@ -348,6 +365,11 @@ skip_tests+=" or png or svg or pdf"
skip_tests+=" or test_determinism"
skip_tests+=" or test_pcolormesh[png] or test_pcolormesh_alpha[png]"
%endif
%if %{without qt}
# The next two tests fail when there's no python qt5 bindings, as in SLFO:Main
skip_tests+=" or test_span_selector_animated_artists_callback"
skip_tests+=" or test_qt_missing"
%endif
# backend tests landing in the wrong xdist process may fail with an error. Test them without xdist.
no_xdist="test_backend or test_span_selector_animated_artists_callback"
@@ -392,7 +414,10 @@ $python -m pytest --pyargs matplotlib.tests \
%exclude %{python_sitearch}/matplotlib/backends/backend_gtk4agg.*
%exclude %{python_sitearch}/matplotlib/backends/backend_gtk4cairo.*
%exclude %{python_sitearch}/matplotlib/backends/backend_nbagg.*
%exclude %{python_sitearch}/matplotlib/backends/backend_qt.*
%exclude %{python_sitearch}/matplotlib/backends/backend_qt5.*
%exclude %{python_sitearch}/matplotlib/backends/backend_qtagg.*
%exclude %{python_sitearch}/matplotlib/backends/backend_qtcairo.py*
%exclude %{python_sitearch}/matplotlib/backends/backend_qt5agg.*
%exclude %{python_sitearch}/matplotlib/backends/backend_qt5cairo.py*
%exclude %{python_sitearch}/matplotlib/backends/backend_tkagg.*
@@ -415,6 +440,9 @@ $python -m pytest --pyargs matplotlib.tests \
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk4agg.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_gtk4cairo.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_nbagg.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qtagg.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qtcairo.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5agg.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5cairo.*.py*
@@ -426,11 +454,14 @@ $python -m pytest --pyargs matplotlib.tests \
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_wxagg.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/backend_wxcairo.*.py*
%exclude %{python_sitearch}/matplotlib/backends/__pycache__/qt_compat.*.py*
%exclude %{python_sitearch}/matplotlib/tests/*.pfb
%exclude %{python_sitearch}/matplotlib/tests/*.ttf
%exclude %{python_sitearch}/matplotlib/tests/*.ipynb
%exclude %{python_sitearch}/matplotlib/tests/baseline_images
%exclude %{python_sitearch}/matplotlib/tests/tinypages
%exclude %{python_sitearch}/mpl_toolkits/axes_grid1/tests/baseline_images
%exclude %{python_sitearch}/mpl_toolkits/axisartist/tests/baseline_images
%exclude %{python_sitearch}/mpl_toolkits/mplot3d/tests/baseline_images
%exclude %{python_sitearch}/matplotlib/tests/tinypages
# Dummy package to pull in latex dependencies.
%files %{python_files latex}
@@ -464,32 +495,44 @@ $python -m pytest --pyargs matplotlib.tests \
%{python_sitearch}/matplotlib/backends/_backend_gtk.py
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/_backend_gtk.*.py*
%if 0%{?suse_version} > %SLE_VERSION && 0%{?python_version_nodots} >= 310
%if 0%{?suse_version} > %SLE_VERSION
%files %{python_files nbagg}
%license LICENSE/
%{python_sitearch}/matplotlib/backends/backend_nbagg.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_nbagg.*.py*
%endif
%if %{with qt}
%files %{python_files qt}
%license LICENSE/
%{python_sitearch}/matplotlib/backends/backend_qt.py*
%{python_sitearch}/matplotlib/backends/backend_qtagg.py*
%{python_sitearch}/matplotlib/backends/backend_qtcairo.py*
%{python_sitearch}/matplotlib/backends/backend_qt5.py*
%{python_sitearch}/matplotlib/backends/backend_qt5agg.py*
%{python_sitearch}/matplotlib/backends/backend_qt5cairo.py*
%{python_sitearch}/matplotlib/backends/qt_compat.py*
%{python_sitearch}/matplotlib/backends/qt_editor/
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qtagg.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qtcairo.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5agg.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_qt5cairo.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/qt_compat.*.py*
%endif
%files %{python_files testdata}
%license LICENSE/
%doc lib/matplotlib/tests/README
%{python_sitearch}/matplotlib/tests/*.pfb
%{python_sitearch}/matplotlib/tests/*.ttf
%{python_sitearch}/matplotlib/tests/*.ipynb
%{python_sitearch}/matplotlib/tests/baseline_images
%{python_sitearch}/matplotlib/tests/tinypages
%{python_sitearch}/mpl_toolkits/axes_grid1/tests/baseline_images
%{python_sitearch}/mpl_toolkits/axisartist/tests/baseline_images
%{python_sitearch}/mpl_toolkits/mplot3d/tests/baseline_images
%{python_sitearch}/matplotlib/tests/tinypages
%exclude %{python_sitearch}/matplotlib/tests/tinypages/.gitignore
%exclude %{python_sitearch}/matplotlib/tests/tinypages/_static/.gitignore
@@ -511,7 +554,7 @@ $python -m pytest --pyargs matplotlib.tests \
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg.*.py*
%pycache_only %{python_sitearch}/matplotlib/backends/__pycache__/backend_webagg_core.*.py*
%if 0%{?suse_version} > %SLE_VERSION
%if %{with wx}
%files %{python_files wx}
%license LICENSE/
%{python_sitearch}/matplotlib/backends/backend_wx.py*