public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
To: git-commits@fedoraproject.org
Subject: [rpms/python-seaborn] rawhide: Backport patches for Matplotlib 3.11 compatibility
Date: Sat, 30 May 2026 19:33:12 GMT [thread overview]
Message-ID: <178016959248.1.336862435972345759.rpms-python-seaborn-fabb71b127c6@fedoraproject.org> (raw)
A new commit has been pushed.
Repo : rpms/python-seaborn
Branch : rawhide
Commit : fabb71b127c6a9c06b381c36f5943f14f3e39b71
Author : Elliott Sales de Andrade <quantum.analyst@gmail.com>
Date : 2026-05-27T03:20:13-04:00
Stats : +194/-0 in 4 file(s)
URL : https://src.fedoraproject.org/rpms/python-seaborn/c/fabb71b127c6a9c06b381c36f5943f14f3e39b71?branch=rawhide
Log:
Backport patches for Matplotlib 3.11 compatibility
---
diff --git a/3933.patch b/3933.patch
new file mode 100644
index 0000000..f8209d0
--- /dev/null
+++ b/3933.patch
@@ -0,0 +1,36 @@
+From 60e283b158505b2243a9068645ab165819006d2c Mon Sep 17 00:00:00 2001
+From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
+Date: Thu, 30 Apr 2026 03:55:36 -0400
+Subject: [PATCH] TST: Fix theme validation with Matplotlib 3.11
+
+The error message has changed slightly from:
+```
+not.a.key is not a valid rc parameter (see rcParams.keys() for a list of valid parameters)
+```
+to:
+```
+'not.a.key' is not a valid value for rcParam. Did you mean: 'font.family'?
+```
+
+This tweaks the regex to match both before and after.
+---
+ tests/_core/test_plot.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/tests/_core/test_plot.py b/tests/_core/test_plot.py
+index 50851646cf..c034f890dc 100644
+--- a/tests/_core/test_plot.py
++++ b/tests/_core/test_plot.py
+@@ -941,10 +941,10 @@ def test_theme_validation(self):
+
+ p = Plot()
+ # You'd think matplotlib would raise a TypeError here, but it doesn't
+- with pytest.raises(ValueError, match="Key axes.linewidth:"):
++ with pytest.raises(ValueError, match=r"Key axes\.linewidth:"):
+ p.theme({"axes.linewidth": "thick"})
+
+- with pytest.raises(KeyError, match="not.a.key is not a valid rc"):
++ with pytest.raises(KeyError, match=r".?not\.a\.key.? is not a valid.+rcParam"):
+ p.theme({"not.a.key": True})
+
+ def test_stat(self, long_df):
diff --git a/3934.patch b/3934.patch
new file mode 100644
index 0000000..3d82b04
--- /dev/null
+++ b/3934.patch
@@ -0,0 +1,78 @@
+From 9c057c13f0568d101e995c97b4befd61bfb0fe16 Mon Sep 17 00:00:00 2001
+From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
+Date: Thu, 30 Apr 2026 04:01:35 -0400
+Subject: [PATCH] Fix Scale initialization
+
+The first parameter to `matplotlib.scale.LinearScale` and
+`matplotlib.scale.FuncScale` is, and always has been, an `Axis`, not a
+name, which has never been used.
+
+Matplotlib 3.11 has made that argument optional internally, but it can
+only do so if the argument is actually an `Axis`.
+
+Firstly, fix that argument so it's actually the `Axis`, and secondly,
+only pass if for older Matplotlib.
+---
+ seaborn/_core/scales.py | 14 +++++++++-----
+ 1 file changed, 9 insertions(+), 5 deletions(-)
+
+diff --git a/seaborn/_core/scales.py b/seaborn/_core/scales.py
+index 1e7bef8a5d..cb962ba155 100644
+--- a/seaborn/_core/scales.py
++++ b/seaborn/_core/scales.py
+@@ -36,6 +36,7 @@
+
+ from seaborn._core.rules import categorical_order
+ from seaborn._core.typing import Default, default
++from seaborn.utils import _version_predates
+
+ from typing import TYPE_CHECKING
+ if TYPE_CHECKING:
+@@ -81,7 +82,7 @@ def _get_locators(self):
+ def _get_formatter(self, locator: Locator | None = None):
+ raise NotImplementedError()
+
+- def _get_scale(self, name: str, forward: Callable, inverse: Callable):
++ def _get_scale(self, axis: Axis | None, forward: Callable, inverse: Callable):
+
+ major_locator, minor_locator = self._get_locators(**self._tick_params)
+ major_formatter = self._get_formatter(major_locator, **self._label_params)
+@@ -93,7 +94,9 @@ def set_default_locators_and_formatters(self, axis):
+ axis.set_minor_locator(minor_locator)
+ axis.set_major_formatter(major_formatter)
+
+- return InternalScale(name, (forward, inverse))
++ return (InternalScale(axis, (forward, inverse))
++ if _version_predates(mpl, '3.11.0rc1')
++ else InternalScale((forward, inverse)))
+
+ def _spacing(self, x: Series) -> float:
+ space = self._spacer(x)
+@@ -191,7 +194,7 @@ def na_safe_cast(x):
+ new._legend = [True, False], ["True", "False"]
+
+ forward, inverse = _make_identity_transforms()
+- mpl_scale = new._get_scale(str(data.name), forward, inverse)
++ mpl_scale = new._get_scale(axis, forward, inverse)
+
+ axis = PseudoAxis(mpl_scale) if axis is None else axis
+ mpl_scale.set_default_locators_and_formatters(axis)
+@@ -285,7 +288,8 @@ def set_default_locators_and_formatters(self, axis):
+ # axis.set_minor_locator(minor_locator)
+ # axis.set_major_formatter(major_formatter)
+
+- mpl_scale = CatScale(data.name)
++ mpl_scale = (CatScale(axis) if _version_predates(mpl, '3.11.0rc1')
++ else CatScale())
+ if axis is None:
+ axis = PseudoAxis(mpl_scale)
+
+@@ -428,7 +432,7 @@ def _setup(
+
+ forward, inverse = new._get_transform()
+
+- mpl_scale = new._get_scale(str(data.name), forward, inverse)
++ mpl_scale = new._get_scale(axis, forward, inverse)
+
+ if axis is None:
+ axis = PseudoAxis(mpl_scale)
diff --git a/3935.patch b/3935.patch
new file mode 100644
index 0000000..d36c847
--- /dev/null
+++ b/3935.patch
@@ -0,0 +1,76 @@
+From 7f261d0e6e76b57c9de8ed56b623c6fad224c907 Mon Sep 17 00:00:00 2001
+From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
+Date: Fri, 1 May 2026 04:11:18 -0400
+Subject: [PATCH] TST: Adjust results for Matplotlib 3.11
+
+Log scaling underwent some optimization, which produces slightly
+different results, but still within some small floating-point tolerance.
+---
+ tests/test_categorical.py | 4 ++--
+ tests/test_distributions.py | 2 +-
+ tests/test_relational.py | 8 ++++----
+ 3 files changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/tests/test_categorical.py b/tests/test_categorical.py
+index 21db60beb7..50b660c7bc 100644
+--- a/tests/test_categorical.py
++++ b/tests/test_categorical.py
+@@ -664,7 +664,7 @@ def test_log_scale(self):
+ ax.set_xscale("log")
+ self.func(x=x)
+ vals = ax.collections[0].get_offsets()[:, 0]
+- assert_array_equal(x, vals)
++ assert_array_almost_equal(x, vals)
+
+ y = [1, 2, 3, 4]
+
+@@ -681,7 +681,7 @@ def test_log_scale(self):
+ ax.set_yscale("log")
+ self.func(x=x, y=y, orient="h", native_scale=True)
+ cat_points = ax.collections[0].get_offsets().copy()[:, 1]
+- assert np.ptp(np.log10(cat_points)) <= .8
++ assert np.ptp(np.log10(cat_points)) <= 0.8 + 1e-14
+
+ @pytest.mark.parametrize(
+ "kwargs",
+diff --git a/tests/test_distributions.py b/tests/test_distributions.py
+index fd2f333fbc..a031fe73e7 100644
+--- a/tests/test_distributions.py
++++ b/tests/test_distributions.py
+@@ -1017,7 +1017,7 @@ def test_log_scale(self, rng):
+ for c1, c2 in zip(ax1.collections, ax2.collections):
+ assert len(get_contour_coords(c1)) == len(get_contour_coords(c2))
+ for arr1, arr2 in zip(get_contour_coords(c1), get_contour_coords(c2)):
+- assert_array_equal(arr1, arr2)
++ assert_array_almost_equal(arr1, arr2)
+
+ def test_bandwidth(self, rng):
+
+diff --git a/tests/test_relational.py b/tests/test_relational.py
+index f4f97068a9..66b7e8548c 100644
+--- a/tests/test_relational.py
++++ b/tests/test_relational.py
+@@ -1121,7 +1121,7 @@ def test_log_scale(self):
+
+ lineplot(x=x, y=y)
+ line = ax.lines[0]
+- assert_array_equal(line.get_xdata(), x)
++ assert_array_almost_equal(line.get_xdata(), x)
+ assert_array_equal(line.get_ydata(), y)
+
+ f, ax = plt.subplots()
+@@ -1133,11 +1133,11 @@ def test_log_scale(self):
+
+ lineplot(x=x, y=y, err_style="bars", errorbar=("pi", 100))
+ line = ax.lines[0]
+- assert line.get_ydata()[1] == 10
++ assert line.get_ydata()[1] == pytest.approx(10)
+
+ ebars = ax.collections[0].get_segments()
+- assert_array_equal(ebars[0][:, 1], y[:2])
+- assert_array_equal(ebars[1][:, 1], y[2:])
++ assert_array_almost_equal(ebars[0][:, 1], y[:2])
++ assert_array_almost_equal(ebars[1][:, 1], y[2:])
+
+ def test_axis_labels(self, long_df):
+
diff --git a/python-seaborn.spec b/python-seaborn.spec
index 517c02e..9865e34 100644
--- a/python-seaborn.spec
+++ b/python-seaborn.spec
@@ -16,6 +16,10 @@ Patch2: seaborn-numpy-removals.patch
# pytest 9 compatibility
# Upstream commit: https://github.com/mwaskom/seaborn/commit/5023f2e.patch (rebased)
Patch3: pytest9.patch
+# Fix test compatibility with Matplotlib 3.11
+Patch4: https://github.com/mwaskom/seaborn/pull/3933.patch
+Patch5: https://github.com/mwaskom/seaborn/pull/3934.patch
+Patch6: https://github.com/mwaskom/seaborn/pull/3935.patch
BuildArch: noarch
BuildRequires: python3-devel
reply other threads:[~2026-05-30 19:33 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=178016959248.1.336862435972345759.rpms-python-seaborn-fabb71b127c6@fedoraproject.org \
--to=quantum.analyst@gmail.com \
--cc=git-commits@fedoraproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox