Compare commits

...

4 Commits
epel10 ... f41

Author SHA1 Message Date
Elliott Sales de Andrade
a5d9c6fa46 Fix button images in toolmanager
This was reported upstream in https://github.com/matplotlib/matplotlib/issues/30116.
2025-05-28 01:48:05 -04:00
Elliott Sales de Andrade
b7a53bdd09 Update to latest version 2024-12-13 21:37:22 -05:00
Elliott Sales de Andrade
63d95ef5f2 Update to latest version 2024-12-05 15:32:28 -05:00
Elliott Sales de Andrade
db71fa5183 Read the runtime dependencies from pyproject.toml
By switching to `-p` argument of `pyproject_buildrequires`, we don't
have to build the project twice.
2024-11-30 04:30:37 -05:00
8 changed files with 156 additions and 35 deletions

3
.gitignore vendored
View File

@@ -112,3 +112,6 @@ matplotlib-1.0.0-without-gpc.tar.gz
/matplotlib-3.9.0-with-freetype-2.13.1.tar.gz
/matplotlib-3.9.1.tar.gz
/matplotlib-3.9.1-with-freetype-2.13.1.tar.gz
/matplotlib-3.9.3.tar.gz
/matplotlib-3.9.3-with-freetype-2.13.1.tar.gz
/matplotlib-3.9.4.tar.gz

View File

@@ -1,18 +1,19 @@
From 7aa7b4d240236c0660be400a7a9ef7d5837e6d47 Mon Sep 17 00:00:00 2001
From d6ce8e5420b08b80203391f4172442249012087a Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Wed, 27 Sep 2017 19:35:59 -0400
Subject: [PATCH 1/4] matplotlibrc path search fix
Subject: [PATCH 1/5] matplotlibrc path search fix
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
lib/matplotlib/__init__.py | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
lib/matplotlib/__init__.py | 5 ++++-
lib/matplotlib/backend_tools.py | 16 ++++++++--------
2 files changed, 12 insertions(+), 9 deletions(-)
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index 9e9325a27d..346e3d3454 100644
index ad4676b11a..b925a4a703 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -586,7 +586,8 @@ def get_cachedir():
@@ -589,7 +589,8 @@ def get_cachedir():
@_logged_cached('matplotlib data path: %s')
def get_data_path():
"""Return the path to Matplotlib data."""
@@ -22,7 +23,7 @@ index 9e9325a27d..346e3d3454 100644
def matplotlib_fname():
@@ -606,6 +607,7 @@ def matplotlib_fname():
@@ -609,6 +610,7 @@ def matplotlib_fname():
is not defined)
- On other platforms,
- ``$HOME/.matplotlib/matplotlibrc`` if ``$HOME`` is defined
@@ -30,7 +31,7 @@ index 9e9325a27d..346e3d3454 100644
- Lastly, it looks in ``$MATPLOTLIBDATA/matplotlibrc``, which should always
exist.
"""
@@ -624,6 +626,7 @@ def matplotlib_fname():
@@ -627,6 +629,7 @@ def matplotlib_fname():
yield matplotlibrc
yield os.path.join(matplotlibrc, 'matplotlibrc')
yield os.path.join(get_configdir(), 'matplotlibrc')
@@ -38,6 +39,81 @@ index 9e9325a27d..346e3d3454 100644
yield os.path.join(get_data_path(), 'matplotlibrc')
for fname in gen_candidates():
diff --git a/lib/matplotlib/backend_tools.py b/lib/matplotlib/backend_tools.py
index 5076ae5635..e74c33678c 100644
--- a/lib/matplotlib/backend_tools.py
+++ b/lib/matplotlib/backend_tools.py
@@ -605,7 +605,7 @@ class ToolHome(ViewsPositionsBase):
"""Restore the original view limits."""
description = 'Reset original view'
- image = 'mpl-data/images/home'
+ image = '/usr/share/matplotlib/mpl-data/images/home'
default_keymap = property(lambda self: mpl.rcParams['keymap.home'])
_on_trigger = 'home'
@@ -614,7 +614,7 @@ class ToolBack(ViewsPositionsBase):
"""Move back up the view limits stack."""
description = 'Back to previous view'
- image = 'mpl-data/images/back'
+ image = '/usr/share/matplotlib/mpl-data/images/back'
default_keymap = property(lambda self: mpl.rcParams['keymap.back'])
_on_trigger = 'back'
@@ -623,7 +623,7 @@ class ToolForward(ViewsPositionsBase):
"""Move forward in the view lim stack."""
description = 'Forward to next view'
- image = 'mpl-data/images/forward'
+ image = '/usr/share/matplotlib/mpl-data/images/forward'
default_keymap = property(lambda self: mpl.rcParams['keymap.forward'])
_on_trigger = 'forward'
@@ -632,14 +632,14 @@ class ConfigureSubplotsBase(ToolBase):
"""Base tool for the configuration of subplots."""
description = 'Configure subplots'
- image = 'mpl-data/images/subplots'
+ image = '/usr/share/matplotlib/mpl-data/images/subplots'
class SaveFigureBase(ToolBase):
"""Base tool for figure saving."""
description = 'Save the figure'
- image = 'mpl-data/images/filesave'
+ image = '/usr/share/matplotlib/mpl-data/images/filesave'
default_keymap = property(lambda self: mpl.rcParams['keymap.save'])
@@ -714,7 +714,7 @@ class ToolZoom(ZoomPanBase):
"""A Tool for zooming using a rectangle selector."""
description = 'Zoom to rectangle'
- image = 'mpl-data/images/zoom_to_rect'
+ image = '/usr/share/matplotlib/mpl-data/images/zoom_to_rect'
default_keymap = property(lambda self: mpl.rcParams['keymap.zoom'])
cursor = cursors.SELECT_REGION
radio_group = 'default'
@@ -836,7 +836,7 @@ class ToolPan(ZoomPanBase):
default_keymap = property(lambda self: mpl.rcParams['keymap.pan'])
description = 'Pan axes with left mouse, zoom with right'
- image = 'mpl-data/images/move'
+ image = '/usr/share/matplotlib/mpl-data/images/move'
cursor = cursors.MOVE
radio_group = 'default'
@@ -900,7 +900,7 @@ class ToolPan(ZoomPanBase):
class ToolHelpBase(ToolBase):
description = 'Print tool list, shortcuts and description'
default_keymap = property(lambda self: mpl.rcParams['keymap.help'])
- image = 'mpl-data/images/help'
+ image = '/usr/share/matplotlib/mpl-data/images/help'
@staticmethod
def format_shortcut(key_sequence):
--
2.44.0
2.49.0

View File

@@ -1,7 +1,7 @@
From 6caae8127c121be0ad36e0e7b47518519543dffd Mon Sep 17 00:00:00 2001
From 33d00a269895431919512d203ba3158abf67af08 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 11 Aug 2023 02:36:06 -0400
Subject: [PATCH 2/4] Unpin NumPy build requirement
Subject: [PATCH 2/5] Unpin NumPy build requirement
This is so high simply to take advantage of the new
backwards-compatibility guarantee in NumPy 1.25, but Fedora will never
@@ -13,12 +13,12 @@ Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
1 file changed, 1 insertion(+), 12 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index fe75b325dc..4c34fa395f 100644
index aa6aa23506..1894bbf3cd 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -75,18 +75,7 @@ requires = [
"meson-python>=0.13.1",
"pybind11>=2.6",
@@ -76,18 +76,7 @@ requires = [
"meson-python>=0.13.1,<0.17.0",
"pybind11>=2.6,!=2.13.3",
"setuptools_scm>=7",
-
- # Comments on numpy build requirement range:
@@ -37,5 +37,5 @@ index fe75b325dc..4c34fa395f 100644
[tool.meson-python.args]
--
2.44.0
2.49.0

View File

@@ -1,7 +1,7 @@
From d2ce17b7096e9f83f9ba4ac37052fe5d2e07f223 Mon Sep 17 00:00:00 2001
From a1fea1cd2a25652721553f8dc4c40faf663c76e1 Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 14 Feb 2020 06:05:42 -0500
Subject: [PATCH 3/4] Set FreeType version to 2.13.1 and update tolerances
Subject: [PATCH 3/5] Set FreeType version to 2.13.1 and update tolerances
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -29,10 +29,10 @@ index 662feb7872..df42b908af 100644
freetype_proj = subproject(
f'freetype-@LOCAL_FREETYPE_VERSION@',
diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index 346e3d3454..ebf5818417 100644
index b925a4a703..ec68e4932b 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -1313,7 +1313,7 @@ def _val_or_rc(val, rc_name):
@@ -1316,7 +1316,7 @@ def _val_or_rc(val, rc_name):
def _init_tests():
# The version of FreeType to install locally for running the tests. This must match
# the value in `meson.build`.
@@ -42,10 +42,10 @@ index 346e3d3454..ebf5818417 100644
from matplotlib import ft2font
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
diff --git a/lib/matplotlib/tests/test_axes.py b/lib/matplotlib/tests/test_axes.py
index 0ed5a11c13..ee220f1854 100644
index e99ef129eb..2355c82f62 100644
--- a/lib/matplotlib/tests/test_axes.py
+++ b/lib/matplotlib/tests/test_axes.py
@@ -7714,7 +7714,7 @@ def test_normal_axes():
@@ -7765,7 +7765,7 @@ def test_normal_axes():
]
for nn, b in enumerate(bbaxis):
targetbb = mtransforms.Bbox.from_bounds(*target[nn])
@@ -54,7 +54,7 @@ index 0ed5a11c13..ee220f1854 100644
target = [
[150.0, 119.999, 930.0, 11.111],
@@ -7732,7 +7732,7 @@ def test_normal_axes():
@@ -7783,7 +7783,7 @@ def test_normal_axes():
target = [85.5138, 75.88888, 1021.11, 1017.11]
targetbb = mtransforms.Bbox.from_bounds(*target)
@@ -115,7 +115,7 @@ index 4dc4d9501e..47a4e80bb5 100644
@pytest.mark.parametrize('arg, state', [
diff --git a/lib/matplotlib/tests/test_legend.py b/lib/matplotlib/tests/test_legend.py
index 0353f1408b..f5b341daaa 100644
index 3c2af27564..2b8709f934 100644
--- a/lib/matplotlib/tests/test_legend.py
+++ b/lib/matplotlib/tests/test_legend.py
@@ -520,9 +520,9 @@ def test_figure_legend_outside():
@@ -167,5 +167,5 @@ index 9c654f4d1f..9678e34a80 100644
--
2.44.0
2.49.0

View File

@@ -0,0 +1,38 @@
From 31e6b3d9271e2229c50b587023efaeb78cc2fa1e Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Fri, 13 Dec 2024 02:03:33 -0500
Subject: [PATCH 4/5] Unpin meson-python build requirement
This is pinned to fix sdists, but we already have one and are building a
wheel, which should be fine.
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
pyproject.toml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pyproject.toml b/pyproject.toml
index 1894bbf3cd..bdf2119f1b 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -48,7 +48,7 @@ requires-python = ">=3.9"
[project.optional-dependencies]
# Should be a copy of the build dependencies below.
dev = [
- "meson-python>=0.13.1,<0.17.0",
+ "meson-python>=0.13.1",
"numpy>=1.25",
"pybind11>=2.6,!=2.13.3",
"setuptools_scm>=7",
@@ -73,7 +73,7 @@ dev = [
build-backend = "mesonpy"
# Also keep in sync with optional dependencies above.
requires = [
- "meson-python>=0.13.1,<0.17.0",
+ "meson-python>=0.13.1",
"pybind11>=2.6,!=2.13.3",
"setuptools_scm>=7",
"numpy",
--
2.49.0

View File

@@ -1,7 +1,7 @@
From 0aecbcfd5fd12c79f1f71998be9f86fc4108d91d Mon Sep 17 00:00:00 2001
From 6e8ee8e1b2c6e0207010f8f4078976ef80489cfb Mon Sep 17 00:00:00 2001
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date: Mon, 22 Aug 2022 18:43:28 -0400
Subject: [PATCH 4/4] Use old stride_windows implementation on 32-bit x86
Subject: [PATCH 5/5] Use old stride_windows implementation on 32-bit x86
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
---
@@ -80,5 +80,5 @@ index e1f08c0da5..5c0d56c74d 100644
resultY = resultY * window.reshape((-1, 1))
resultY = np.fft.fft(resultY, n=pad_to, axis=0)[:numFreqs, :]
--
2.44.0
2.49.0

View File

@@ -32,13 +32,13 @@
%global _docdir_fmt %{name}
# Updated test images for new FreeType.
%global mpl_images_version 3.9.1
%global mpl_images_version 3.9.3
# The version of FreeType in this Fedora branch.
%global ftver 2.13.1
Name: python-matplotlib
Version: 3.9.1
Version: 3.9.4
%global Version %{version_no_tilde %{quote:%nil}}
Release: %autorelease
Summary: Python 2D plotting library
@@ -58,9 +58,11 @@ Patch1001: 0001-matplotlibrc-path-search-fix.patch
Patch1002: 0002-Unpin-NumPy-build-requirement.patch
# Increase tolerances for new FreeType everywhere:
Patch1003: 0003-Set-FreeType-version-to-%{ftver}-and-update-tolerances.patch
# We don't need to use older meson-python.
Patch1004: 0004-Unpin-meson-python-build-requirement.patch
# https://github.com/matplotlib/matplotlib/pull/21190#issuecomment-1223271888
Patch0001: 0004-Use-old-stride_windows-implementation-on-32-bit-x86.patch
Patch0001: 0005-Use-old-stride_windows-implementation-on-32-bit-x86.patch
BuildRequires: gcc
BuildRequires: gcc-c++
@@ -158,7 +160,7 @@ Obsoletes: python-matplotlib-data < 3
Summary: Fonts used by python-matplotlib
# Carlogo, STIX and Computer Modern is OFL
# DejaVu is Bitstream Vera and Public Domain
License: OFL-1.1 and Bitstream-Vera and LicenseRef-Fedora-Public-Domain
License: OFL-1.1 AND Bitstream-Vera AND LicenseRef-Fedora-Public-Domain
BuildArch: noarch
Requires: python3-matplotlib-data = %{version}-%{release}
Obsoletes: python-matplotlib-data-fonts < 3
@@ -309,7 +311,7 @@ gzip -dc %SOURCE1000 | tar xf - --transform='s~^mpl-images-%{mpl_images_version}
%generate_buildrequires
%pyproject_buildrequires -w %build_backend_args
%pyproject_buildrequires -p
%build
@@ -371,6 +373,8 @@ k="${k-}${k+ and }not test_form_widget_get_with_datetime_and_date_fields"
k="${k-}${k+ and }not test_cross_Qt_imports"
%endif
# This fixes GTK4 which is missing a dependency for its current default renderer.
GSK_RENDERER=cairo \
MPLCONFIGDIR=$PWD \
%ifnarch %{ix86}
xvfb-run -a -s "-screen 0 640x480x24" \

View File

@@ -1,2 +1,2 @@
SHA512 (matplotlib-3.9.1.tar.gz) = a1d48c42a5f4f04b57e34d25df842917e6380b8d6b6d1018c9b630cbbea4619b1d75729a218a6f52b63d4a61c2204bb26ad8f741566f84e41ca73190e419f672
SHA512 (matplotlib-3.9.1-with-freetype-2.13.1.tar.gz) = 7d7d04d410265e6f3adc95bc103f12432f5c3c2b3788ab11f2326054f1cd116ff795bd2d2999cdb4da997df597bec00bbba61acea6de5eb9d56c686aa47a7bf7
SHA512 (matplotlib-3.9.4.tar.gz) = adfa875cba0b030ee0efaf11ed1be881858dc13391c966a2d9485ae2358fccf0b5356e16966a0c9da9f682e4a9d2f3960551756aca30ddc048632346548b1447
SHA512 (matplotlib-3.9.3-with-freetype-2.13.1.tar.gz) = 53cb50ae711ba5ba38d42b7723bbfbd74d022cad6ab91de6c05fb0e971c0b8212ad33359b2ea7ce5a0365cdb1708cd58773bae2e0bf0d4a37696b28206083eed