- Update to 3.10.5

* Bugfix release. No notable changes beyond the GitHub
    statistics of merged PRs.
    (https://matplotlib.org/stable/users/github_stats.html#github-stats)
- Remove "%python-numpy-devel < 2.3" BuildRequires upper limit
- Drop not needed patch Pillow-13-compat.patch

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:numeric/python-matplotlib?expand=0&rev=124
This commit is contained in:
2025-08-18 13:05:02 +00:00
committed by Git OBS Bridge
parent f31ad4cfda
commit 5353714320
5 changed files with 16 additions and 44 deletions

View File

@@ -1,36 +0,0 @@
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:

Binary file not shown.

3
matplotlib-3.10.5.tar.gz Normal file
View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:352ed6ccfb7998a00881692f38b4ca083c691d3e275b4145423704c34c909076
size 34804044

View File

@@ -1,3 +1,13 @@
-------------------------------------------------------------------
Mon Aug 18 11:18:14 UTC 2025 - Daniel Garcia <daniel.garcia@suse.com>
- Update to 3.10.5
* Bugfix release. No notable changes beyond the GitHub
statistics of merged PRs.
(https://matplotlib.org/stable/users/github_stats.html#github-stats)
- Remove "%python-numpy-devel < 2.3" BuildRequires upper limit
- Drop not needed patch Pillow-13-compat.patch
-------------------------------------------------------------------
Thu Jul 3 07:36:25 UTC 2025 - Nico Krapp <nico.krapp@suse.com>

View File

@@ -1,7 +1,7 @@
#
# spec file for package python-matplotlib
#
# Copyright (c) 2025 SUSE LLC
# Copyright (c) 2025 SUSE LLC and contributors
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -46,7 +46,7 @@ ExclusiveArch: x86_64 aarch64
%{?sle15_python_module_pythons}
Name: python-matplotlib%{psuffix}
Version: 3.10.3
Version: 3.10.5
Release: 0
Summary: Plotting Library for Python
License: SUSE-Matplotlib
@@ -59,8 +59,6 @@ Source99: https://downloads.sourceforge.net/project/freetype/freetype2/2.6
Source100: python-matplotlib.rpmlintrc
# PATCH-FEATURE-OPENSUSE matplotlib-meson-options-opensuse.patch code@bnavigator.de -- Custom build options for meson-python
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
@@ -71,7 +69,7 @@ Obsoletes: python-matplotlib-gtk < %{version}
# SECTION build
BuildRequires: %{python_module devel >= 3.9}
BuildRequires: %{python_module meson-python >= 0.13.1}
BuildRequires: %{python_module numpy-devel >= 1.25 with %python-numpy-devel < 2.3}
BuildRequires: %{python_module numpy-devel >= 1.25}
BuildRequires: %{python_module pip}
BuildRequires: %{python_module pybind11-devel >= 2.6}
BuildRequires: %{python_module setuptools_scm >= 7}