From 2267e8a541284ffc1b50f726aff07de67e3cde06 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Thu, 16 Jul 2026 11:48:23 -0300 Subject: [PATCH] sage: work around ipython and scipy regressions --- .../patches/ipython-9_15-workaround.patch | 24 +++++++++++++++++++ .../sage/patches/scipy-1_18-workaround.patch | 13 ++++++++++ pkgs/by-name/sa/sage/sage-src.nix | 8 +++++++ 3 files changed, 45 insertions(+) create mode 100644 pkgs/by-name/sa/sage/patches/ipython-9_15-workaround.patch create mode 100644 pkgs/by-name/sa/sage/patches/scipy-1_18-workaround.patch diff --git a/pkgs/by-name/sa/sage/patches/ipython-9_15-workaround.patch b/pkgs/by-name/sa/sage/patches/ipython-9_15-workaround.patch new file mode 100644 index 000000000000..ada5974798f7 --- /dev/null +++ b/pkgs/by-name/sa/sage/patches/ipython-9_15-workaround.patch @@ -0,0 +1,24 @@ +diff --git a/src/sage/doctest/test.py b/src/sage/doctest/test.py +index 812f8167c12..38e553ad5bd 100644 +--- a/src/sage/doctest/test.py ++++ b/src/sage/doctest/test.py +@@ -468,6 +468,7 @@ Test the ``--debug`` option:: + s...: b = 5 + s...: a + b + 8 ++ ... + sage: + + Returning to doctests... +diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py +index 56fc16a205c..be2ae2a1b3d 100644 +--- a/src/sage/tests/cmdline.py ++++ b/src/sage/tests/cmdline.py +@@ -327,6 +327,7 @@ be ignored. In Pdb, we run the ``help`` command:: + ********************************************************************** + Previously executed commands: + s...: assert True is False ++ ... + sage: + + Returning to doctests... diff --git a/pkgs/by-name/sa/sage/patches/scipy-1_18-workaround.patch b/pkgs/by-name/sa/sage/patches/scipy-1_18-workaround.patch new file mode 100644 index 000000000000..5c4c4454c54d --- /dev/null +++ b/pkgs/by-name/sa/sage/patches/scipy-1_18-workaround.patch @@ -0,0 +1,13 @@ +diff --git a/src/sage/plot/plot3d/plot3d.py b/src/sage/plot/plot3d/plot3d.py +index bdf15a85e9d..36580eeab6b 100644 +--- a/src/sage/plot/plot3d/plot3d.py ++++ b/src/sage/plot/plot3d/plot3d.py +@@ -316,7 +316,7 @@ class _Coordinates: + ....: [ 0.16763356, 0.19993708, 0.31403568, 0.47359696, 0.55282422], + ....: [ 0.16763356, 0.25683223, 0.16649297, 0.10594339, 0.55282422]]) + sage: import scipy.interpolate +- sage: f=scipy.interpolate.RectBivariateSpline(v_phi,v_theta,m_r).ev ++ sage: f=lambda *x: scipy.interpolate.RectBivariateSpline(v_phi,v_theta,m_r).ev(*x).item() + sage: spherical_plot3d(f,(0,2*pi),(0,pi)) + Graphics3d Object + """ diff --git a/pkgs/by-name/sa/sage/sage-src.nix b/pkgs/by-name/sa/sage/sage-src.nix index a277be1af4bd..035a899d6e6e 100644 --- a/pkgs/by-name/sa/sage/sage-src.nix +++ b/pkgs/by-name/sa/sage/sage-src.nix @@ -130,6 +130,14 @@ stdenv.mkDerivation rec { url = "https://github.com/sagemath/sage/commit/926f32aab22f81ddb9fda874a20fee84c7bfacc3.patch?full_index=1"; hash = "sha256-EMn/fr5WlRQtFj5GHo02kczasmKaiqFfRSVZo2uvOPI="; }) + + # work around https://github.com/ipython/ipython/issues/15207, which + # will likely be properly fixed in IPython 9.16. + ./patches/ipython-9_15-workaround.patch + + # work around https://github.com/scipy/scipy/issues/25471, which is + # fixed as part of SciPy 1.18.1. + ./patches/scipy-1_18-workaround.patch ]; patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;