Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] singular: update to 4.3.2, rebuild sagemath
@ 2023-04-02 23:00 tornaria
  2023-04-03  3:43 ` tornaria
                   ` (41 more replies)
  0 siblings, 42 replies; 43+ messages in thread
From: tornaria @ 2023-04-02 23:00 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1616 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath
https://github.com/void-linux/void-packages/pull/43225

singular: update to 4.3.2, rebuild sagemath
<!-- Uncomment relevant sections and delete options which are not applicable -->

Also fix sagemath doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

After this PR, sagemath testsuite should pass 100% with current versions of dependencies in void. All patches are taken from upstream.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I'm running tests locally as well. Note that I'm doing this on top of #43153 to test the openblas update as well.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43225.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-43225.patch --]
[-- Type: text/x-diff, Size: 20821 bytes --]

From 161572721872137d1219c1e587f39ddf7ca834ef Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 2 Apr 2023 16:34:23 -0300
Subject: [PATCH 1/3] openblas: update to 0.3.23.

---
 srcpkgs/openblas/template | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/openblas/template b/srcpkgs/openblas/template
index c51bd98e2963..61a891a86a30 100644
--- a/srcpkgs/openblas/template
+++ b/srcpkgs/openblas/template
@@ -1,8 +1,7 @@
 # Template file for 'openblas'
 pkgname=openblas
-reverts="0.3.22_1"
-version=0.3.21
-revision=2
+version=0.3.23
+revision=1
 build_style=gnu-makefile
 make_build_args="HOSTCC=gcc USE_OPENMP=1"
 make_install_args="OPENBLAS_INCLUDE_DIR=\$(PREFIX)/include/openblas"
@@ -12,9 +11,9 @@ short_desc="Optimized BLAS (Basic Linear Algebra Subprograms) based on GotoBLAS2
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="BSD-3-Clause"
 homepage="https://www.openblas.net/"
-changelog="https://raw.githubusercontent.com/xianyi/OpenBLAS/v${version}/Changelog.txt"
+changelog="https://raw.githubusercontent.com/xianyi/OpenBLAS/develop/Changelog.txt"
 distfiles="https://github.com/xianyi/OpenBLAS/archive/v${version}.tar.gz"
-checksum=f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca
+checksum=5d9491d07168a5d00116cdc068a40022c3455bf9293c7cb86a65b1054d7e5114
 
 case "$XBPS_TARGET_MACHINE" in
 	ppc64*) ;;

From 6ac8e8d5653ba3e8898e3620f88e803ed5542d4e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 2/3] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index ddd0a3266a36..d0f9c91a5b2f 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4087,11 +4087,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From 66dc72479813e5d944c42b3e4bbc59d2db115b0e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 3/3] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

We add patches from upstream sagemath to fix these.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 srcpkgs/sagemath/patches/get_patches          | 30 +++++-
 srcpkgs/sagemath/template                     |  2 +-
 9 files changed, 300 insertions(+), 13 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..1de5574c6f59 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,33 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# positive review
+#get_pr 35337 "ipython 8.11"
+
+# needs review
+get_pr 35423 "ipython 8.12"						# includes PR 35337
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..e365ed3b507a 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
@ 2023-04-03  3:43 ` tornaria
  2023-04-03 18:37 ` tornaria
                   ` (40 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-03  3:43 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 345 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1493598238

Comment:
In addition to the checks here, I've run the long testsuite locally on x86_64 (CI runs only normal tests since running long tests takes twice the time).

Note this PR includes (a rebase of) PR #43153.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
  2023-04-03  3:43 ` tornaria
@ 2023-04-03 18:37 ` tornaria
  2023-04-03 20:25 ` dkwo
                   ` (39 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-03 18:37 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 149 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1494796809

Comment:
@dkwo 

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
  2023-04-03  3:43 ` tornaria
  2023-04-03 18:37 ` tornaria
@ 2023-04-03 20:25 ` dkwo
  2023-04-03 20:35 ` tornaria
                   ` (38 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-03 20:25 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 188 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1494934380

Comment:
4.3.2p1 is also available, fix a few minor things

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (2 preceding siblings ...)
  2023-04-03 20:25 ` dkwo
@ 2023-04-03 20:35 ` tornaria
  2023-04-03 20:51 ` [PR REVIEW] " dkwo
                   ` (37 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-03 20:35 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 316 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1494946832

Comment:
> 4.3.2p1 is also available, fix a few minor things

But it's not released, or is it? It's not in here: https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/4-3-2/

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR REVIEW] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (3 preceding siblings ...)
  2023-04-03 20:35 ` tornaria
@ 2023-04-03 20:51 ` dkwo
  2023-04-03 20:54 ` dkwo
                   ` (36 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-03 20:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 150 bytes --]

New review comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#discussion_r1156421521

Comment:
typo?

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (4 preceding siblings ...)
  2023-04-03 20:51 ` [PR REVIEW] " dkwo
@ 2023-04-03 20:54 ` dkwo
  2023-04-03 21:51 ` [PR REVIEW] " tornaria
                   ` (35 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-03 20:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 182 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1494967029

Comment:
hmm, it's on github only, forget about that

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR REVIEW] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (5 preceding siblings ...)
  2023-04-03 20:54 ` dkwo
@ 2023-04-03 21:51 ` tornaria
  2023-04-03 23:08 ` dkwo
                   ` (34 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-03 21:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

New review comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#discussion_r1156488793

Comment:
The soname for `libomalloc` has been the same since `4.2.1_1`, while the others seem to change every version. In practice, it's probably irrelevant since there won't be any program that links only to `libomalloc` (only `sagemath` depends on `singular`). It's annoying that they change the soname every release... I wonder if it's really necessary.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR REVIEW] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (6 preceding siblings ...)
  2023-04-03 21:51 ` [PR REVIEW] " tornaria
@ 2023-04-03 23:08 ` dkwo
  2023-04-03 23:09 ` dkwo
                   ` (33 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-03 23:08 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 175 bytes --]

New review comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#discussion_r1156531561

Comment:
I see, sorry for the confusion

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (7 preceding siblings ...)
  2023-04-03 23:08 ` dkwo
@ 2023-04-03 23:09 ` dkwo
  2023-04-03 23:20 ` tornaria
                   ` (32 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-03 23:09 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 200 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1495104333

Comment:
then it looks good to me.
do you want me to test on aarch64?

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (8 preceding siblings ...)
  2023-04-03 23:09 ` dkwo
@ 2023-04-03 23:20 ` tornaria
  2023-04-03 23:20 ` tornaria
                   ` (31 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-03 23:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 467 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1495113088

Comment:
> do you want me to test on aarch64?

That would be great, and let me know anything weird. We could fix it.

Can you make a list of packages that are nocross? I know of ntl, fflas-ffpack, givaro, linbox, cysignals, sympow. It would be useful to fix those so they can be built and are available oob on void linux aarch64.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (9 preceding siblings ...)
  2023-04-03 23:20 ` tornaria
@ 2023-04-03 23:20 ` tornaria
  2023-04-03 23:20 ` tornaria
                   ` (30 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-03 23:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 478 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1495113088

Comment:
> do you want me to test on aarch64?

That would be great, and let me know anything weird. We could fix it in this PR.

Can you make a list of packages that are nocross? I know of ntl, fflas-ffpack, givaro, linbox, cysignals, sympow. It would be useful to fix those so they can be built and are available oob on void linux aarch64.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (10 preceding siblings ...)
  2023-04-03 23:20 ` tornaria
@ 2023-04-03 23:20 ` tornaria
  2023-04-05 19:23 ` dkwo
                   ` (29 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-03 23:20 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 486 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1495113088

Comment:
> do you want me to test on aarch64?

That would be great, and let me know anything weird. We could try to  fix it in this PR.

Can you make a list of packages that are nocross? I know of ntl, fflas-ffpack, givaro, linbox, cysignals, sympow. It would be useful to fix those so they can be built and are available oob on void linux aarch64.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (11 preceding siblings ...)
  2023-04-03 23:20 ` tornaria
@ 2023-04-05 19:23 ` dkwo
  2023-04-05 19:26 ` dkwo
                   ` (28 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-05 19:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 699 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1498001158

Comment:
Besides the ones you mentioned, the list printed by xbps-src at the beginning includes
```
boost-devel
openblas-devel *
singular *
eclib-devel
maxima-ecl
python3-Cython
python3-cypari
python3-fpyllll
python3-pplpy
python3-primecountpy
```
(* means they are in this pr).
Moreover some of their dependants, like `python-Cython,` are being built.
I did not see `givaro`, as it is probably an indirect dependency that will be built by one of these.
For the tests, I have to wait until there's a big build in progress, otherwise it builds `icu` etc.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (12 preceding siblings ...)
  2023-04-05 19:23 ` dkwo
@ 2023-04-05 19:26 ` dkwo
  2023-04-05 19:27 ` dkwo
                   ` (27 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-05 19:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 739 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1498001158

Comment:
Besides the ones you mentioned, the list printed by xbps-src at the beginning includes
```
boost-devel *
openblas-devel *
singular *
eclib-devel
maxima-ecl
python3-Cython
python3-cypari
python3-fpyllll
python3-pplpy
python3-primecountpy
```
(* means they are in this pr, or affected by big build in progress).
Moreover some of their dependants, like `python-Cython,` are being built.
I did not see `givaro`, as it is probably an indirect dependency that will be built by one of these.
For the tests, I have to wait until there's a big build in progress, otherwise it builds `icu` etc.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (13 preceding siblings ...)
  2023-04-05 19:26 ` dkwo
@ 2023-04-05 19:27 ` dkwo
  2023-04-05 19:27 ` dkwo
                   ` (26 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-05 19:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1498001158

Comment:
Besides the ones you mentioned, the list printed by xbps-src at the beginning includes
```
boost-devel *
openblas-devel *
singular *
eclib-devel
maxima-ecl
python3-Cython *
python3-cypari
python3-fpyllll
python3-pplpy
python3-primecountpy
```
(* means they are in this pr, or affected by big build in progress).
Moreover some of their dependants, like `python-Cython,` are being built.
I did not see `givaro`, as it is probably an indirect dependency that will be built by one of these.
For the tests, I have to wait until there's a big build in progress, otherwise it builds `icu` etc.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (14 preceding siblings ...)
  2023-04-05 19:27 ` dkwo
@ 2023-04-05 19:27 ` dkwo
  2023-04-05 19:28 ` dkwo
                   ` (25 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-05 19:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 742 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1498001158

Comment:
Besides the ones you mentioned, the list printed by xbps-src at the beginning includes
```
boost-devel *
openblas-devel *
singular *
eclib-devel
maxima-ecl
python3-Cython *
python3-cypari2
python3-fpyllll
python3-pplpy
python3-primecountpy
```
(* means they are in this pr, or affected by big build in progress).
Moreover some of their dependants, like `python-Cython,` are being built.
I did not see `givaro`, as it is probably an indirect dependency that will be built by one of these.
For the tests, I have to wait until there's a big build in progress, otherwise it builds `icu` etc.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (15 preceding siblings ...)
  2023-04-05 19:27 ` dkwo
@ 2023-04-05 19:28 ` dkwo
  2023-04-05 19:34 ` dkwo
                   ` (24 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-05 19:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 741 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1498001158

Comment:
Besides the ones you mentioned, the list printed by xbps-src at the beginning includes
```
boost-devel *
openblas-devel *
singular *
eclib-devel
maxima-ecl
python3-Cython *
python3-cypari2
python3-fpylll
python3-pplpy
python3-primecountpy
```
(* means they are in this pr, or affected by big build in progress).
Moreover some of their dependants, like `python-Cython,` are being built.
I did not see `givaro`, as it is probably an indirect dependency that will be built by one of these.
For the tests, I have to wait until there's a big build in progress, otherwise it builds `icu` etc.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (16 preceding siblings ...)
  2023-04-05 19:28 ` dkwo
@ 2023-04-05 19:34 ` dkwo
  2023-04-06 17:30 ` dkwo
                   ` (23 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-05 19:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 203 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1498014284

Comment:
so basically fixing the ones you listed should fix everything :)

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (17 preceding siblings ...)
  2023-04-05 19:34 ` dkwo
@ 2023-04-06 17:30 ` dkwo
  2023-04-06 17:34 ` dkwo
                   ` (22 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-06 17:30 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1499397487

Comment:
aarch64:
- ntl, fflas-ffpack, givaro, linbox, cysignals, sympow, singular: all build and check fine
- maxima: has emacs both in host and run deps, so it's not in the repo; must build with ~sbcl, otherwise it fails @paper
- sagemath: fails to start tests with `aarch64-linux-gnu.so: undefined_symbol: fmpz_set_ZZ`

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (18 preceding siblings ...)
  2023-04-06 17:30 ` dkwo
@ 2023-04-06 17:34 ` dkwo
  2023-04-06 17:39 ` dkwo
                   ` (21 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-06 17:34 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 457 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1499397487

Comment:
aarch64:
- ntl, fflas-ffpack, givaro, linbox, cysignals, sympow, singular: all build and check fine
- maxima: has emacs both in host and run deps, so it's not in the repo; must build with ~sbcl, otherwise it fails @paper42 
- sagemath: fails to start tests with `aarch64-linux-gnu.so: undefined_symbol: fmpz_set_ZZ`

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (19 preceding siblings ...)
  2023-04-06 17:34 ` dkwo
@ 2023-04-06 17:39 ` dkwo
  2023-04-06 18:03 ` tornaria
                   ` (20 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-06 17:39 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 176 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1499408044

Comment:
(rebuilt and tested flintlib as well)

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (20 preceding siblings ...)
  2023-04-06 17:39 ` dkwo
@ 2023-04-06 18:03 ` tornaria
  2023-04-06 18:23 ` dkwo
                   ` (19 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-06 18:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1726 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1499432522

Comment:
> aarch64:
>     * maxima: has emacs both in host and run deps, so it's not in the repo; must build with ~sbcl, otherwise it fails @paper42

- emacs is cross: we can add an `emacs` option and disable it for cross.
- sbcl is also cross, so it should also be disabled at least for cross.

Do you mean maxima also fails when both sbcl and maxima are built natively?
 
>     * sagemath: fails to start tests with `aarch64-linux-gnu.so: undefined_symbol: fmpz_set_ZZ`

That is coming from flintlib. Are you using the cross built package or the native built one? The difference is that flintlib uses ntl if built natively and not if built cross.

What's the output of
```
$ objdump -T /usr/lib/libflint.so.17 | grep fmpz_set_ZZ
000000000009f8f0 g    DF .text	00000000000001ab  Base        fmpz_set_ZZ
000000000009faa0 g    DF .text	0000000000000005  Base        fmpz_set_ZZ_p
```
What about:
```
$ for p in /usr/lib/python3.11/site-packages/sage/libs/flint/*.so ; do echo $p ; readelf -d $p | grep libflint ; done
/usr/lib/python3.11/site-packages/sage/libs/flint/arith.so
 0x0000000000000001 (NEEDED)             Shared library: [libflint.so.17]
/usr/lib/python3.11/site-packages/sage/libs/flint/flint.so
 0x0000000000000001 (NEEDED)             Shared library: [libflint.so.17]
/usr/lib/python3.11/site-packages/sage/libs/flint/fmpz_poly.so
 0x0000000000000001 (NEEDED)             Shared library: [libflint.so.17]
/usr/lib/python3.11/site-packages/sage/libs/flint/ulong_extras.so
 0x0000000000000001 (NEEDED)             Shared library: [libflint.so.17]
```

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (21 preceding siblings ...)
  2023-04-06 18:03 ` tornaria
@ 2023-04-06 18:23 ` dkwo
  2023-04-06 18:50 ` tornaria
                   ` (18 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-06 18:23 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1499454110

Comment:
yes, it first builds emacs, then sbcl, then gets stuck at some point in gdb.
i agree, we should add option emacs, and disable emacs,sbcl for cross.

i see, that makes sense for flint: my sage test was run before i rebuild flintlib. let me try again and report.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (22 preceding siblings ...)
  2023-04-06 18:23 ` dkwo
@ 2023-04-06 18:50 ` tornaria
  2023-04-06 20:13 ` dkwo
                   ` (17 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-06 18:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 901 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1499480684

Comment:
> yes, it first builds emacs, then sbcl, then gets stuck at some point in gdb. i agree, we should add option emacs, and disable emacs,sbcl for cross.

I tried to cross build maxima with ecl, but it doesn't seem to work. The build finishes if I place `ecl` in hostmakedepends but then the binaries produced are x86_64 and not cross... Maybe it's possible to cross build with clisp, but that won't be enough for sage (we really need maxima-ecl).

What we could do is add the emacs option and set the default for aarch64 to ~emacs,~sbcl so you still have to build natively but at least you are not forced to build emacs and sbcl... 

> 
> i see, that makes sense for flint: my sage test was run before i rebuild flintlib. let me try again and report.



^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (23 preceding siblings ...)
  2023-04-06 18:50 ` tornaria
@ 2023-04-06 20:13 ` dkwo
  2023-04-10 19:10 ` [PR PATCH] [Updated] " tornaria
                   ` (16 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-06 20:13 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 451 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1499563110

Comment:
I agree about maxima. For tests (with check=yes):
```
sage/graphs/generators/classical_geometries.py  # Killed due to segmentation fault
sage/graphs/strongly_regular_db.pyx  # Killed due to segmentation fault
sage/parallel/map_reduce.py  # Timed out
sage/sets/recursively_enumerated_set.pyx  #Timed out
```

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR PATCH] [Updated] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (24 preceding siblings ...)
  2023-04-06 20:13 ` dkwo
@ 2023-04-10 19:10 ` tornaria
  2023-04-25 12:03 ` tornaria
                   ` (15 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-10 19:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath
https://github.com/void-linux/void-packages/pull/43225

singular: update to 4.3.2, rebuild sagemath
<!-- Uncomment relevant sections and delete options which are not applicable -->

Also fix sagemath doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

After this PR, sagemath testsuite should pass 100% with current versions of dependencies in void. All patches are taken from upstream.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I'm running tests locally as well. Note that I'm doing this on top of #43153 to test the openblas update as well.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43225.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-43225.patch --]
[-- Type: text/x-diff, Size: 19379 bytes --]

From 822a4af3d5b2c00f90963eccc9efdbd7ba34b271 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 1/2] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 39fed5ffbcf5..fb07f1009a86 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4090,11 +4090,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From d01aa6228ecfff521f7c253f70f6134c34d2fc07 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 2/2] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

We add patches from upstream sagemath to fix these.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 srcpkgs/sagemath/patches/get_patches          | 28 +++++-
 srcpkgs/sagemath/template                     |  2 +-
 9 files changed, 298 insertions(+), 13 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..7b5fb1879226 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,31 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# merged in 10.0.beta8
+#get_pr 35337 "ipython 8.11"
+get_pr 35423 "ipython 8.12"						# includes PR 35337
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..e365ed3b507a 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR PATCH] [Updated] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (25 preceding siblings ...)
  2023-04-10 19:10 ` [PR PATCH] [Updated] " tornaria
@ 2023-04-25 12:03 ` tornaria
  2023-04-25 12:05 ` tornaria
                   ` (14 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-25 12:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath
https://github.com/void-linux/void-packages/pull/43225

singular: update to 4.3.2, rebuild sagemath
<!-- Uncomment relevant sections and delete options which are not applicable -->

Also fix sagemath doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

After this PR, sagemath testsuite should pass 100% with current versions of dependencies in void. All patches are taken from upstream.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I'm running tests locally as well. Note that I'm doing this on top of #43153 to test the openblas update as well.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43225.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-43225.patch --]
[-- Type: text/x-diff, Size: 25631 bytes --]

From 253d0cc45ef6a064f9f358b80f7f43603f428754 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 17 Apr 2023 14:31:03 -0300
Subject: [PATCH 1/3] python3-Babel: update to 2.12.1.

---
 srcpkgs/python3-Babel/patches/998.patch | 43 +++++++++++++++++++++++++
 srcpkgs/python3-Babel/template          |  6 ++--
 2 files changed, 46 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/python3-Babel/patches/998.patch

diff --git a/srcpkgs/python3-Babel/patches/998.patch b/srcpkgs/python3-Babel/patches/998.patch
new file mode 100644
index 000000000000..4779f907a9dd
--- /dev/null
+++ b/srcpkgs/python3-Babel/patches/998.patch
@@ -0,0 +1,43 @@
+From 641f58c9951d9f5746cd63743dd337f1340d7bff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 7 Apr 2023 14:51:10 +0000
+Subject: [PATCH] Freeze format_time() tests to a specific date to fix test
+ failures
+
+Freeze the date when performing the tests for format_time() with
+a timezone specified.  Since the time object does not specify a date,
+the formatter uses the format string specific to the current date.
+As a result, if the current DST state is different than when the test
+was last updated, it failed.
+
+This fix covers only regular tests.  I have no idea how to do the same
+for doctests.
+
+Issue #988
+---
+ tests/test_dates.py | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_dates.py b/tests/test_dates.py
+index b94c710f..3f1fc3fc 100644
+--- a/tests/test_dates.py
++++ b/tests/test_dates.py
+@@ -601,12 +601,13 @@ def test_format_time(timezone_getter):
+     custom = dates.format_time(t, "hh 'o''clock' a, zzzz", tzinfo=eastern, locale='en')
+     assert custom == "09 o'clock AM, Eastern Daylight Time"
+ 
+-    t = time(15, 30)
+-    paris = dates.format_time(t, format='full', tzinfo=paris, locale='fr_FR')
+-    assert paris == '15:30:00 heure normale d’Europe centrale'
++    with freezegun.freeze_time("2023-01-01"):
++        t = time(15, 30)
++        paris = dates.format_time(t, format='full', tzinfo=paris, locale='fr_FR')
++        assert paris == '15:30:00 heure normale d’Europe centrale'
+ 
+-    us_east = dates.format_time(t, format='full', tzinfo=eastern, locale='en_US')
+-    assert us_east == '3:30:00\u202fPM Eastern Standard Time'
++        us_east = dates.format_time(t, format='full', tzinfo=eastern, locale='en_US')
++        assert us_east == '3:30:00\u202fPM Eastern Standard Time'
+ 
+ 
+ def test_format_skeleton(timezone_getter):
diff --git a/srcpkgs/python3-Babel/template b/srcpkgs/python3-Babel/template
index 4f2dc8425795..46530ba596e3 100644
--- a/srcpkgs/python3-Babel/template
+++ b/srcpkgs/python3-Babel/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-Babel'
 pkgname=python3-Babel
-version=2.10.3
-revision=2
+version=2.12.1
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="python3-pytz"
@@ -12,7 +12,7 @@ license="BSD-3-Clause"
 homepage="https://babel.pocoo.org"
 changelog="https://raw.githubusercontent.com/python-babel/babel/master/CHANGES.rst"
 distfiles="${PYPI_SITE}/B/Babel/Babel-${version}.tar.gz"
-checksum=7614553711ee97490f732126dc077f8d0ae084ebc6a96e23db1482afabdb2c51
+checksum=cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455
 
 post_install() {
 	vlicense LICENSE

From 35ae0d9e635f6823c7a88b99f84e6d4b3dfa7b3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 2/3] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7f91aa2dfccc..11b04a929419 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4099,11 +4099,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From c4789f73170bc8e9bf3bb48de6bc7804e330d0e2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 3/3] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6
 - pythran 0.12.1

We add patches from upstream sagemath to fix these.

Also add pythran and sphinx to checkdepends to make sure doctests pass
when they are installed.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 .../patches/35438-pythran_0.12.1.patch        | 41 ++++++++
 srcpkgs/sagemath/patches/get_patches          | 29 +++++-
 srcpkgs/sagemath/template                     |  4 +-
 10 files changed, 341 insertions(+), 14 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 create mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
new file mode 100644
index 000000000000..2cdc674d4f9e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
@@ -0,0 +1,41 @@
+From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Tue, 4 Apr 2023 12:56:57 -0300
+Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
+
+These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
+When pythran 0.12.1 is installed, I get 24 doctest failures due to
+deprecation warnings; they are all gone with this commit.
+
+[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
+---
+ src/sage/all.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/all.py b/src/sage/all.py
+index 93588df1b93..ee775aad0e9 100644
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+     module='(.*[.]_vendor[.])?packaging')
+ 
+-# Ignore numpy warnings triggered by pythran
++# Ignore a few warnings triggered by pythran 0.12.1
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+-                        module='pythran')
++    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
++    module='pythran.dist')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='pkg_resources is deprecated as an API|'
++            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
++    module='pkg_resources')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='msvccompiler is deprecated and slated to be removed',
++    module='distutils.msvccompiler')
+ 
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+                         message='The distutils(.sysconfig module| package) is deprecated',
+-- 
+2.40.0
+
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..74109ffbbb0d 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,32 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# merged in 10.0.beta8
+#get_pr 35337 "ipython 8.11"
+get_pr 35423 "ipython 8.12"						# includes PR 35337
+get_pr 35438 "pythran 0.12.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..66a543efd21d 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -26,7 +26,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  sage-data-conway_polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends"
+checkdepends="$depends pythran python3-Sphinx"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR PATCH] [Updated] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (26 preceding siblings ...)
  2023-04-25 12:03 ` tornaria
@ 2023-04-25 12:05 ` tornaria
  2023-04-25 12:10 ` tornaria
                   ` (13 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-25 12:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath
https://github.com/void-linux/void-packages/pull/43225

singular: update to 4.3.2, rebuild sagemath
<!-- Uncomment relevant sections and delete options which are not applicable -->

Also fix sagemath doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

After this PR, sagemath testsuite should pass 100% with current versions of dependencies in void. All patches are taken from upstream.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I'm running tests locally as well. Note that I'm doing this on top of #43153 to test the openblas update as well.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43225.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-43225.patch --]
[-- Type: text/x-diff, Size: 25631 bytes --]

From ffe2464f4e6904da74cf6fb653e971311a7f735e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 17 Apr 2023 14:31:03 -0300
Subject: [PATCH 1/3] python3-Babel: update to 2.12.1.

---
 srcpkgs/python3-Babel/patches/998.patch | 43 +++++++++++++++++++++++++
 srcpkgs/python3-Babel/template          |  6 ++--
 2 files changed, 46 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/python3-Babel/patches/998.patch

diff --git a/srcpkgs/python3-Babel/patches/998.patch b/srcpkgs/python3-Babel/patches/998.patch
new file mode 100644
index 000000000000..4779f907a9dd
--- /dev/null
+++ b/srcpkgs/python3-Babel/patches/998.patch
@@ -0,0 +1,43 @@
+From 641f58c9951d9f5746cd63743dd337f1340d7bff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Fri, 7 Apr 2023 14:51:10 +0000
+Subject: [PATCH] Freeze format_time() tests to a specific date to fix test
+ failures
+
+Freeze the date when performing the tests for format_time() with
+a timezone specified.  Since the time object does not specify a date,
+the formatter uses the format string specific to the current date.
+As a result, if the current DST state is different than when the test
+was last updated, it failed.
+
+This fix covers only regular tests.  I have no idea how to do the same
+for doctests.
+
+Issue #988
+---
+ tests/test_dates.py | 11 ++++++-----
+ 1 file changed, 6 insertions(+), 5 deletions(-)
+
+diff --git a/tests/test_dates.py b/tests/test_dates.py
+index b94c710f..3f1fc3fc 100644
+--- a/tests/test_dates.py
++++ b/tests/test_dates.py
+@@ -601,12 +601,13 @@ def test_format_time(timezone_getter):
+     custom = dates.format_time(t, "hh 'o''clock' a, zzzz", tzinfo=eastern, locale='en')
+     assert custom == "09 o'clock AM, Eastern Daylight Time"
+ 
+-    t = time(15, 30)
+-    paris = dates.format_time(t, format='full', tzinfo=paris, locale='fr_FR')
+-    assert paris == '15:30:00 heure normale d’Europe centrale'
++    with freezegun.freeze_time("2023-01-01"):
++        t = time(15, 30)
++        paris = dates.format_time(t, format='full', tzinfo=paris, locale='fr_FR')
++        assert paris == '15:30:00 heure normale d’Europe centrale'
+ 
+-    us_east = dates.format_time(t, format='full', tzinfo=eastern, locale='en_US')
+-    assert us_east == '3:30:00\u202fPM Eastern Standard Time'
++        us_east = dates.format_time(t, format='full', tzinfo=eastern, locale='en_US')
++        assert us_east == '3:30:00\u202fPM Eastern Standard Time'
+ 
+ 
+ def test_format_skeleton(timezone_getter):
diff --git a/srcpkgs/python3-Babel/template b/srcpkgs/python3-Babel/template
index 4f2dc8425795..46530ba596e3 100644
--- a/srcpkgs/python3-Babel/template
+++ b/srcpkgs/python3-Babel/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-Babel'
 pkgname=python3-Babel
-version=2.10.3
-revision=2
+version=2.12.1
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 depends="python3-pytz"
@@ -12,7 +12,7 @@ license="BSD-3-Clause"
 homepage="https://babel.pocoo.org"
 changelog="https://raw.githubusercontent.com/python-babel/babel/master/CHANGES.rst"
 distfiles="${PYPI_SITE}/B/Babel/Babel-${version}.tar.gz"
-checksum=7614553711ee97490f732126dc077f8d0ae084ebc6a96e23db1482afabdb2c51
+checksum=cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455
 
 post_install() {
 	vlicense LICENSE

From 69ee4bc72ca592489bb9f78329abc49a5ca139b7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 2/3] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index 7f91aa2dfccc..11b04a929419 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4099,11 +4099,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From 046c53e596ee239a6092c935753766456b2d58b3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 3/3] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6
 - pythran 0.12.1

We add patches from upstream sagemath to fix these.

Also add pythran and sphinx to checkdepends to make sure doctests pass
when they are installed.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 .../patches/35438-pythran_0.12.1.patch        | 41 ++++++++
 srcpkgs/sagemath/patches/get_patches          | 29 +++++-
 srcpkgs/sagemath/template                     |  4 +-
 10 files changed, 341 insertions(+), 14 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 create mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
new file mode 100644
index 000000000000..2cdc674d4f9e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
@@ -0,0 +1,41 @@
+From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Tue, 4 Apr 2023 12:56:57 -0300
+Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
+
+These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
+When pythran 0.12.1 is installed, I get 24 doctest failures due to
+deprecation warnings; they are all gone with this commit.
+
+[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
+---
+ src/sage/all.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/all.py b/src/sage/all.py
+index 93588df1b93..ee775aad0e9 100644
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+     module='(.*[.]_vendor[.])?packaging')
+ 
+-# Ignore numpy warnings triggered by pythran
++# Ignore a few warnings triggered by pythran 0.12.1
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+-                        module='pythran')
++    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
++    module='pythran.dist')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='pkg_resources is deprecated as an API|'
++            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
++    module='pkg_resources')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='msvccompiler is deprecated and slated to be removed',
++    module='distutils.msvccompiler')
+ 
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+                         message='The distutils(.sysconfig module| package) is deprecated',
+-- 
+2.40.0
+
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..74109ffbbb0d 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,32 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# merged in 10.0.beta8
+#get_pr 35337 "ipython 8.11"
+get_pr 35423 "ipython 8.12"						# includes PR 35337
+get_pr 35438 "pythran 0.12.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..66a543efd21d 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -26,7 +26,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  sage-data-conway_polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends"
+checkdepends="$depends pythran python3-Sphinx"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (27 preceding siblings ...)
  2023-04-25 12:05 ` tornaria
@ 2023-04-25 12:10 ` tornaria
  2023-04-27 14:06 ` [PR PATCH] [Updated] " tornaria
                   ` (12 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-25 12:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 472 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1521682406

Comment:
I did the following modifications to sagemath:
 - added a patch to fix doctests when pythran is installed (optional dependency)
 - rebased on top of #43497 to fix doctests when python3-Sphinx is installed (optional dependency)
 - added `pythran` and `python3-Sphinx` to `checkdepends` so doctests that depend on them are run


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR PATCH] [Updated] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (28 preceding siblings ...)
  2023-04-25 12:10 ` tornaria
@ 2023-04-27 14:06 ` tornaria
  2023-04-27 15:15 ` dkwo
                   ` (11 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-27 14:06 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath
https://github.com/void-linux/void-packages/pull/43225

singular: update to 4.3.2, rebuild sagemath
<!-- Uncomment relevant sections and delete options which are not applicable -->

Also fix sagemath doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

After this PR, sagemath testsuite should pass 100% with current versions of dependencies in void. All patches are taken from upstream.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I'm running tests locally as well. Note that I'm doing this on top of #43153 to test the openblas update as well.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43225.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-43225.patch --]
[-- Type: text/x-diff, Size: 23833 bytes --]

From 16de4e836ff508300b9c8172ec1a9a8a48a551bf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 17 Apr 2023 14:31:03 -0300
Subject: [PATCH 1/3] python3-Babel: update to 2.12.1.

---
 srcpkgs/python3-Babel/template | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-Babel/template b/srcpkgs/python3-Babel/template
index 4f2dc8425795..9255e8537f4e 100644
--- a/srcpkgs/python3-Babel/template
+++ b/srcpkgs/python3-Babel/template
@@ -1,18 +1,25 @@
 # Template file for 'python3-Babel'
 pkgname=python3-Babel
-version=2.10.3
-revision=2
+version=2.12.1
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
-depends="python3-pytz"
-checkdepends="python3-pytest python3-pytz python3-freezegun"
+checkdepends="python3-pytest python3-freezegun faketime"
 short_desc="Tools for internationalizing Python applications (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://babel.pocoo.org"
 changelog="https://raw.githubusercontent.com/python-babel/babel/master/CHANGES.rst"
 distfiles="${PYPI_SITE}/B/Babel/Babel-${version}.tar.gz"
-checksum=7614553711ee97490f732126dc077f8d0ae084ebc6a96e23db1482afabdb2c51
+checksum=cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455
+
+do_check() {
+	# If you see this is hanging, remove faketime
+	# it has problem with python's time.sleep
+	LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 \
+		FAKETIME="@2023-01-01 00:00:00" \
+		python3 -m pytest
+}
 
 post_install() {
 	vlicense LICENSE

From bea31d7c7c17515b5590d8385e6edfdd6db34777 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 2/3] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e9c30f5953bb..287fec781de0 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4098,11 +4098,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From ec9d796598271ab218d1d68ca98889f064391a64 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 3/3] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6
 - pythran 0.12.1

We add patches from upstream sagemath to fix these.

Also add pythran and sphinx to checkdepends to make sure doctests pass
when they are installed.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 .../patches/35438-pythran_0.12.1.patch        | 41 ++++++++
 srcpkgs/sagemath/patches/get_patches          | 29 +++++-
 srcpkgs/sagemath/template                     |  4 +-
 10 files changed, 341 insertions(+), 14 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 create mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
new file mode 100644
index 000000000000..2cdc674d4f9e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
@@ -0,0 +1,41 @@
+From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Tue, 4 Apr 2023 12:56:57 -0300
+Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
+
+These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
+When pythran 0.12.1 is installed, I get 24 doctest failures due to
+deprecation warnings; they are all gone with this commit.
+
+[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
+---
+ src/sage/all.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/all.py b/src/sage/all.py
+index 93588df1b93..ee775aad0e9 100644
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+     module='(.*[.]_vendor[.])?packaging')
+ 
+-# Ignore numpy warnings triggered by pythran
++# Ignore a few warnings triggered by pythran 0.12.1
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+-                        module='pythran')
++    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
++    module='pythran.dist')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='pkg_resources is deprecated as an API|'
++            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
++    module='pkg_resources')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='msvccompiler is deprecated and slated to be removed',
++    module='distutils.msvccompiler')
+ 
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+                         message='The distutils(.sysconfig module| package) is deprecated',
+-- 
+2.40.0
+
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..74109ffbbb0d 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,32 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# merged in 10.0.beta8
+#get_pr 35337 "ipython 8.11"
+get_pr 35423 "ipython 8.12"						# includes PR 35337
+get_pr 35438 "pythran 0.12.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..66a543efd21d 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -26,7 +26,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  sage-data-conway_polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends"
+checkdepends="$depends pythran python3-Sphinx"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (29 preceding siblings ...)
  2023-04-27 14:06 ` [PR PATCH] [Updated] " tornaria
@ 2023-04-27 15:15 ` dkwo
  2023-04-27 16:05 ` tornaria
                   ` (10 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-27 15:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 214 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1525881519

Comment:
looks good to me.
have all our patches been merged upstream at this point?

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (30 preceding siblings ...)
  2023-04-27 15:15 ` dkwo
@ 2023-04-27 16:05 ` tornaria
  2023-04-27 16:11 ` tornaria
                   ` (9 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-27 16:05 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 225 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1525961375

Comment:
Tests fail because `python3-Babel` is not rebuilt, even if I included #43497 here.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (31 preceding siblings ...)
  2023-04-27 16:05 ` tornaria
@ 2023-04-27 16:11 ` tornaria
  2023-04-28 19:21 ` [PR PATCH] [Updated] " tornaria
                   ` (8 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-27 16:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 379 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1525973500

Comment:
> looks good to me. have all our patches been merged upstream at this point?

Yes, everything is included in 10.0.rc0, see: https://github.com/tornaria/void-packages/tree/sagemath-next if you want to try it (should I make a draft PR?)

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR PATCH] [Updated] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (32 preceding siblings ...)
  2023-04-27 16:11 ` tornaria
@ 2023-04-28 19:21 ` tornaria
  2023-04-28 19:40 ` dkwo
                   ` (7 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-28 19:21 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath
https://github.com/void-linux/void-packages/pull/43225

singular: update to 4.3.2, rebuild sagemath
<!-- Uncomment relevant sections and delete options which are not applicable -->

Also fix sagemath doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

After this PR, sagemath testsuite should pass 100% with current versions of dependencies in void. All patches are taken from upstream.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I'm running tests locally as well. Note that I'm doing this on top of #43153 to test the openblas update as well.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43225.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-43225.patch --]
[-- Type: text/x-diff, Size: 23847 bytes --]

From 0db430c0f57e9689dafc3d12004c909722a0f1f2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 17 Apr 2023 14:31:03 -0300
Subject: [PATCH 1/3] python3-Babel: update to 2.12.1.

---
 srcpkgs/python3-Babel/template | 17 ++++++++++++-----
 1 file changed, 12 insertions(+), 5 deletions(-)

diff --git a/srcpkgs/python3-Babel/template b/srcpkgs/python3-Babel/template
index 4f2dc8425795..9255e8537f4e 100644
--- a/srcpkgs/python3-Babel/template
+++ b/srcpkgs/python3-Babel/template
@@ -1,18 +1,25 @@
 # Template file for 'python3-Babel'
 pkgname=python3-Babel
-version=2.10.3
-revision=2
+version=2.12.1
+revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
-depends="python3-pytz"
-checkdepends="python3-pytest python3-pytz python3-freezegun"
+checkdepends="python3-pytest python3-freezegun faketime"
 short_desc="Tools for internationalizing Python applications (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
 homepage="https://babel.pocoo.org"
 changelog="https://raw.githubusercontent.com/python-babel/babel/master/CHANGES.rst"
 distfiles="${PYPI_SITE}/B/Babel/Babel-${version}.tar.gz"
-checksum=7614553711ee97490f732126dc077f8d0ae084ebc6a96e23db1482afabdb2c51
+checksum=cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455
+
+do_check() {
+	# If you see this is hanging, remove faketime
+	# it has problem with python's time.sleep
+	LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 \
+		FAKETIME="@2023-01-01 00:00:00" \
+		python3 -m pytest
+}
 
 post_install() {
 	vlicense LICENSE

From eab3ab61ba58950442dc4914881f29dc5e1404ac Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 2/3] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e282bbd1f588..08dac21a5b3e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4099,11 +4099,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From 4db6f3ddf94a2b476a3f5eed230345470ff44d3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 3/3] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6
 - pythran 0.12.1

We add patches from upstream sagemath to fix these.

Also add pythran and sphinx to checkdepends to make sure doctests pass
when they are installed.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 .../patches/35438-pythran_0.12.1.patch        | 41 ++++++++
 srcpkgs/sagemath/patches/get_patches          | 29 +++++-
 srcpkgs/sagemath/template                     |  4 +-
 10 files changed, 341 insertions(+), 14 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 create mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
new file mode 100644
index 000000000000..2cdc674d4f9e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
@@ -0,0 +1,41 @@
+From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Tue, 4 Apr 2023 12:56:57 -0300
+Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
+
+These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
+When pythran 0.12.1 is installed, I get 24 doctest failures due to
+deprecation warnings; they are all gone with this commit.
+
+[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
+---
+ src/sage/all.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/all.py b/src/sage/all.py
+index 93588df1b93..ee775aad0e9 100644
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+     module='(.*[.]_vendor[.])?packaging')
+ 
+-# Ignore numpy warnings triggered by pythran
++# Ignore a few warnings triggered by pythran 0.12.1
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+-                        module='pythran')
++    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
++    module='pythran.dist')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='pkg_resources is deprecated as an API|'
++            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
++    module='pkg_resources')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='msvccompiler is deprecated and slated to be removed',
++    module='distutils.msvccompiler')
+ 
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+                         message='The distutils(.sysconfig module| package) is deprecated',
+-- 
+2.40.0
+
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..74109ffbbb0d 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,32 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# merged in 10.0.beta8
+#get_pr 35337 "ipython 8.11"
+get_pr 35423 "ipython 8.12"						# includes PR 35337
+get_pr 35438 "pythran 0.12.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..82f97480a10f 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -26,7 +26,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  sage-data-conway_polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends"
+checkdepends="$depends pythran python3-Sphinx python3-Babel"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (33 preceding siblings ...)
  2023-04-28 19:21 ` [PR PATCH] [Updated] " tornaria
@ 2023-04-28 19:40 ` dkwo
  2023-04-29  2:15 ` [PR PATCH] [Updated] " tornaria
                   ` (6 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: dkwo @ 2023-04-28 19:40 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 185 bytes --]

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1528008783

Comment:
> should I make a draft PR?

that'd be great

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR PATCH] [Updated] singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (34 preceding siblings ...)
  2023-04-28 19:40 ` dkwo
@ 2023-04-29  2:15 ` tornaria
  2023-04-29  2:17 ` tornaria
                   ` (5 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-29  2:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1621 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages sagemath
https://github.com/void-linux/void-packages/pull/43225

singular: update to 4.3.2, rebuild sagemath
<!-- Uncomment relevant sections and delete options which are not applicable -->

Also fix sagemath doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6

After this PR, sagemath testsuite should pass 100% with current versions of dependencies in void. All patches are taken from upstream.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I'm running tests locally as well. Note that I'm doing this on top of #43153 to test the openblas update as well.

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/43225.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-sagemath-43225.patch --]
[-- Type: text/x-diff, Size: 27879 bytes --]

From bcd09894152c6db0b95460127cedd256cb88de36 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 27 Mar 2023 00:31:35 -0300
Subject: [PATCH 1/3] singular: update to 4.3.2.

---
 common/shlibs             | 10 +++++-----
 srcpkgs/singular/template |  4 ++--
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/shlibs b/common/shlibs
index e282bbd1f588..08dac21a5b3e 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -4099,11 +4099,11 @@ libumfpack.so.6 SuiteSparse-6.0.1_1
 libecl.so.21.2 ecl-21.2.1_1
 libecm.so.1 ecm-7.0.4_3
 libcliquer.so.1 cliquer-1.22_1
-libSingular-4.3.1.so singular-4.3.1p2_1
-libfactory-4.3.1.so singular-4.3.1p2_1
-libpolys-4.3.1.so singular-4.3.1p2_1
-libomalloc-0.9.6.so singular-4.3.1p2_1
-libsingular_resources-4.3.1.so singular-4.3.1p2_1
+libomalloc-0.9.6.so singular-4.2.1_1
+libSingular-4.3.2.so singular-4.3.2_1
+libfactory-4.3.2.so singular-4.3.2_1
+libpolys-4.3.2.so singular-4.3.2_1
+libsingular_resources-4.3.2.so singular-4.3.2_1
 libbrial.so.3 brial-1.2.10_1
 libbrial_groebner.so.3 brial-1.2.10_1
 libm4ri-0.0.20200125.so m4ri-20200125_1
diff --git a/srcpkgs/singular/template b/srcpkgs/singular/template
index c73a020dcf15..0481f6cb1e11 100644
--- a/srcpkgs/singular/template
+++ b/srcpkgs/singular/template
@@ -1,6 +1,6 @@
 # Template file for 'singular'
 pkgname=singular
-version=4.3.1p3
+version=4.3.2
 revision=1
 _majver=${version%p*}
 build_style=gnu-configure
@@ -20,7 +20,7 @@ maintainer="dkwo <npiazza@disroot.org>"
 license="GPL-2.0-or-later"
 homepage="https://www.singular.uni-kl.de"
 distfiles="https://www.singular.uni-kl.de/ftp/pub/Math/Singular/SOURCES/${_majver//./-}/singular-${version}.tar.gz"
-checksum=66cfaeee7ab909272fd81050a09cae3ec115652a01adde014a5128a54b97397a
+checksum=3fd565d1bd4265fa8ba7cc189137a36d9daf9939b5bb411466c2028d9191f6db
 
 if [ -z "$CROSS_BUILD" ]; then
 	makedepends+=" ntl-devel"

From 3171129c048430254672b4b0828bd37bab9c1e7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 15 Mar 2023 09:27:58 -0300
Subject: [PATCH 2/3] sagemath: rebuild for singular update

Also fix doctests for pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6
 - pythran 0.12.1

And add support for:
 - networkx 3.1

We use patches from upstream sagemath to fix all of these.

We also add pythran and sphinx to checkdepends to make sure doctests
pass when they are installed.
---
 ...support_singular_4.3.1.p3-5e5737a0c.patch} |  0
 .../34980-avoid_factoring_in_is_prime.patch   | 16 ++--
 .../patches/35177-matplotlib_3.7.patch        | 95 +++++++++++++++++++
 .../patches/35195-workaround_ecl_race.patch   | 56 +++++++++++
 .../patches/35204-fix_sage-cleaner.patch      | 28 ++++++
 .../sagemath/patches/35250-nauty_2.8.6.patch  | 35 +++++++
 .../sagemath/patches/35423-ipython_8.12.patch | 51 ++++++++++
 .../patches/35438-pythran_0.12.1.patch        | 41 ++++++++
 .../sagemath/patches/35584-networkx_3.1.patch | 81 ++++++++++++++++
 srcpkgs/sagemath/patches/get_patches          | 32 ++++++-
 srcpkgs/sagemath/template                     |  4 +-
 11 files changed, 425 insertions(+), 14 deletions(-)
 rename srcpkgs/sagemath/patches/{trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch => 34851-support_singular_4.3.1.p3-5e5737a0c.patch} (100%)
 create mode 100644 srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
 create mode 100644 srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
 create mode 100644 srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
 create mode 100644 srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
 create mode 100644 srcpkgs/sagemath/patches/35423-ipython_8.12.patch
 create mode 100644 srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
 create mode 100644 srcpkgs/sagemath/patches/35584-networkx_3.1.patch

diff --git a/srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch b/srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
similarity index 100%
rename from srcpkgs/sagemath/patches/trac-34851-support_singular_4.3.1.p3-5e5737a0c.patch
rename to srcpkgs/sagemath/patches/34851-support_singular_4.3.1.p3-5e5737a0c.patch
diff --git a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
index ca61a2ada4eb..ee0f0e656b28 100644
--- a/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
+++ b/srcpkgs/sagemath/patches/34980-avoid_factoring_in_is_prime.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/rings/number_field/number_field_ideal.py b/src/sage/rings/number_field/number_field_ideal.py
-index d5f7157217f..1a9d11aec68 100644
+index d5f7157217f..8ca1f958039 100644
 --- a/src/sage/rings/number_field/number_field_ideal.py
 +++ b/src/sage/rings/number_field/number_field_ideal.py
-@@ -996,16 +996,36 @@ def is_prime(self):
+@@ -996,16 +996,38 @@ def is_prime(self):
              False
              sage: K.ideal(17).is_prime()  # ramified
              False
@@ -33,13 +33,15 @@ index d5f7157217f..1a9d11aec68 100644
 +        K = self.number_field().pari_nf()
 +        I = self.pari_hnf()
 +
-+        self._pari_prime = K.idealismaximal(I) or None
++        candidate = K.idealismaximal(I) or None
 +
 +        # PARI uses probabilistic primality testing inside idealismaximal().
-+        if self._pari_prime \
-+                and get_flag(None, 'arithmetic') \
-+                and not self._pari_prime[0].isprime():
-+            self._pari_prime = None
++        if get_flag(None, 'arithmetic'):
++            # proof required, check using isprime()
++            if candidate and not candidate[0].isprime():
++                candidate = None
++
++        self._pari_prime = candidate
 +
 +        return self._pari_prime is not None
  
diff --git a/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
new file mode 100644
index 000000000000..007f3324cfe4
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35177-matplotlib_3.7.patch
@@ -0,0 +1,95 @@
+diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
+index b77c69b2f77..0586a96ae55 100644
+--- a/src/sage/plot/complex_plot.pyx
++++ b/src/sage/plot/complex_plot.pyx
+@@ -563,7 +563,7 @@ def complex_to_cmap_rgb(z_values, cmap='turbo', contoured=False, tiled=False,
+     import matplotlib as mpl
+ 
+     if isinstance(cmap, str):
+-        cmap = mpl.cm.get_cmap(cmap)
++        cmap = mpl.colormaps[cmap]
+ 
+     if contour_base is None:
+         if contour_type == "linear":
+@@ -1206,11 +1206,11 @@ def complex_plot(f, x_range, y_range, contoured=False, tiled=False, cmap=None,
+                 domain = np.linspace(0, 1, 256)
+                 shifted_domain = np.roll(domain, 128)
+                 default_cmap = mpl.colors.LinearSegmentedColormap.from_list(
+-                    "sage_default", mpl.cm.get_cmap('hsv')(shifted_domain)
++                    "sage_default", mpl.colormaps['hsv'](shifted_domain)
+                 )
+                 cmap = default_cmap
+             else:
+-                cmap = mpl.cm.get_cmap(cmap)
++                cmap = mpl.colormaps[cmap]
+         rgbs = complex_to_cmap_rgb(
+             z_values, cmap=cmap, contoured=contoured, tiled=tiled,
+             contour_type=contour_type, contour_base=contour_base,
+diff --git a/src/sage/plot/contour_plot.py b/src/sage/plot/contour_plot.py
+index c0cab456686..4accb309580 100644
+--- a/src/sage/plot/contour_plot.py
++++ b/src/sage/plot/contour_plot.py
+@@ -848,9 +848,7 @@ def f(x,y): return cos(x) + sin(y)
+ 
+         sage: contour_plot(lambda x,y: 0, (-1,1), (-1,1),
+         ....:              contours=[0], fill=False, cmap=['blue'])
+-        ...
+-        UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     .. PLOT::
+ 
+@@ -874,8 +872,7 @@ def f(x,y): return cos(x) + sin(y)
+     Check that :trac:`18074` is fixed::
+ 
+         sage: contour_plot(0, (0,1), (0,1))
+-        ... UserWarning: No contour levels were found within the data range.
+-        Graphics object consisting of 1 graphics primitive
++        ...Graphics object consisting of 1 graphics primitive
+ 
+     Domain points in :trac:`11648` with complex output are now skipped::
+ 
+diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
+index 64ea1a7e10f..cdc99ced263 100644
+--- a/src/sage/plot/graphics.py
++++ b/src/sage/plot/graphics.py
+@@ -2341,7 +2341,7 @@ def _matplotlib_tick_formatter(self, subplot, base=(10, 10),
+             sage: subplot = Figure().add_subplot(111)
+             sage: p._objects[0]._render_on_subplot(subplot)
+             sage: p._matplotlib_tick_formatter(subplot, **d)
+-            (<AxesSubplot:...>,
++            (<Axes...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.MaxNLocator object at ...>,
+             <matplotlib.ticker.ScalarFormatter object at ...>,
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 99c817f03a6..ae85183dc93 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -1207,7 +1207,7 @@ def _add_subplot(self, figure, index, **options):
+             sage: fig = Figure()
+             sage: ax1 = G._add_subplot(fig, 0)
+             sage: type(ax1)
+-            <class 'matplotlib.axes._subplots.AxesSubplot'>
++            <class 'matplotlib.axes...'>
+             sage: ax2 = G._add_subplot(fig, 1)
+             sage: fig.get_axes() == [ax1, ax2]
+             True
+diff --git a/src/sage/plot/plot3d/plot_field3d.py b/src/sage/plot/plot3d/plot_field3d.py
+index bdf39391d3e..fe10e27f58f 100644
+--- a/src/sage/plot/plot3d/plot_field3d.py
++++ b/src/sage/plot/plot3d/plot_field3d.py
+@@ -126,9 +126,9 @@ def plot_vector_field3d(functions, xrange, yrange, zrange,
+     vectors = [vector((ff(*point), gg(*point), hh(*point))) for point in points]
+ 
+     try:
+-        from matplotlib.cm import get_cmap
+-        cm = get_cmap(colors)
+-    except (TypeError, ValueError):
++        import matplotlib as mpl
++        cm = mpl.colormaps[colors]
++    except (TypeError, KeyError):
+         cm = None
+     if cm is None:
+         if isinstance(colors, (list, tuple)):
diff --git a/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
new file mode 100644
index 000000000000..1e0a708e8068
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35195-workaround_ecl_race.patch
@@ -0,0 +1,56 @@
+diff --git a/src/sage/interfaces/maxima_lib.py b/src/sage/interfaces/maxima_lib.py
+index c9ca5e30939..9459cb70334 100644
+--- a/src/sage/interfaces/maxima_lib.py
++++ b/src/sage/interfaces/maxima_lib.py
+@@ -77,6 +77,26 @@
+     sage: bar == foo
+     True
+ 
++TESTS:
++
++Check our workaround for a race in ecl works, see :trac:`26968`.
++We use a temporary `MAXIMA_USERDIR` so it's empty; we place it
++in `DOT_SAGE` since we expect it to have more latency than `/tmp`.
++
++    sage: import tempfile, subprocess
++    sage: tmpdir = tempfile.TemporaryDirectory(dir=DOT_SAGE)
++    sage: _ = subprocess.run(['sage', '-c',  # long time
++    ....: f'''
++    ....: import os
++    ....: os.environ["MAXIMA_USERDIR"] = "{tmpdir.name}"
++    ....: if not os.fork():
++    ....:     import sage.interfaces.maxima_lib
++    ....: else:
++    ....:     import sage.interfaces.maxima_lib
++    ....:     os.wait()
++    ....: '''])
++    sage: tmpdir.cleanup()
++
+ """
+ 
+ # ****************************************************************************
+@@ -116,7 +136,23 @@
+ ecl_eval("(setq $nolabels t))")
+ ecl_eval("(defvar *MAXIMA-LANG-SUBDIR* NIL)")
+ ecl_eval("(set-locale-subdir)")
+-ecl_eval("(set-pathnames)")
++
++try:
++    ecl_eval("(set-pathnames)")
++except RuntimeError:
++    # Recover from :trac:`26968` by creating `*maxima-objdir*` here.
++    # This cannot be done before calling `(set-pathnames)` since
++    # `*maxima-objdir*` is computed there.
++    # We use python `os.makedirs()` which is immune to the race.
++    # Using `(ensure-directories-exist ...)` in lisp would be
++    # subject to the same race condition and since `*maxima-objdir*`
++    # has multiple components this is quite plausible to happen.
++    maxima_objdir = ecl_eval("*maxima-objdir*").python()[1:-1]
++    import os
++    os.makedirs(maxima_objdir, exist_ok=True)
++    # Call `(set-pathnames)` again to complete its job.
++    ecl_eval("(set-pathnames)")
++
+ ecl_eval("(defun add-lineinfo (x) x)")
+ ecl_eval('(defun principal nil (cond ($noprincipal (diverg)) ((not pcprntd) (merror "Divergent Integral"))))')
+ ecl_eval("(remprop 'mfactorial 'grind)")  # don't use ! for factorials (#11539)
diff --git a/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
new file mode 100644
index 000000000000..fc3e40da2a88
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35204-fix_sage-cleaner.patch
@@ -0,0 +1,28 @@
+diff --git a/src/bin/sage-cleaner b/src/bin/sage-cleaner
+index e2e578eec60..dc7d8f0482e 100755
+--- a/src/bin/sage-cleaner
++++ b/src/bin/sage-cleaner
+@@ -99,6 +99,15 @@ def cleanup():
+ 
+     return len(pid_list)
+ 
++def cleanup_cruft():
++    """ remove directories leftover from improper shutdown """
++    tmp_dirs = os.listdir(SAGE_TMP_ROOT)
++    for dir_entry in tmp_dirs:
++        baddir = os.path.join(SAGE_TMP_ROOT, dir_entry)
++        if os.path.isdir(baddir):
++            logger.warning('Removing old directory %s from SAGE_TMP_ROOT', baddir)
++            rm_rf(baddir)
++
+ def kill_spawned_jobs(jobfile, parent_pid):
+     logger.info("Killing %s's spawned jobs", parent_pid)
+     killed_them_all = True
+@@ -193,6 +202,7 @@ if __name__ == '__main__':
+     setup_daemon()
+     fix_old_mistakes()
+     logger.info("Starting sage-cleaner with PID %s", os.getpid())
++    cleanup_cruft()
+ 
+     if len(sys.argv) > 1:
+         wait = int(sys.argv[1])
diff --git a/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
new file mode 100644
index 000000000000..ea210e20ae52
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35250-nauty_2.8.6.patch
@@ -0,0 +1,35 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index ec6a5c19e60..9dd7bc1cb1e 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3660,7 +3660,7 @@ def nauty_gentreeg(options="", debug=False):
+ 
+         sage: gen = graphs.nauty_gentreeg("4", debug=True)
+         sage: print(next(gen))
+-        >A ...gentreeg Z=2:3 D=3 n=4
++        >A ...gentreeg ...
+         sage: gen = graphs.nauty_gentreeg("4 -q", debug=True)
+         sage: next(gen)
+         ''
+@@ -3687,7 +3687,7 @@ def nauty_gentreeg(options="", debug=False):
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+         ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+-        ['>A ...gentreeg Z=2:2 D=2 n=3\n', Graph on 3 vertices]
++        ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
+     import shlex
+     from sage.features.nauty import NautyExecutable
+diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generators.py
+index df88bbe2713..1a8016976c2 100644
+--- a/src/sage/graphs/graph_generators.py
++++ b/src/sage/graphs/graph_generators.py
+@@ -966,7 +966,7 @@ def nauty_geng(self, options="", debug=False):
+             ...
+             ValueError: wrong format of parameter option
+             sage: list(graphs.nauty_geng("-c3", debug=True))
+-            ['>E Usage: ...geng [-cCmtfbd#D#] [-uygsnh] [-lvq] ...
++            ['>E Usage: ...geng ...\n']
+             sage: list(graphs.nauty_geng("-c 3", debug=True))
+             ['>A ...geng -cd1D2 n=3 e=2-3\n', Graph on 3 vertices, Graph on 3 vertices]
+         """
diff --git a/srcpkgs/sagemath/patches/35423-ipython_8.12.patch b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
new file mode 100644
index 000000000000..46bda084e48e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35423-ipython_8.12.patch
@@ -0,0 +1,51 @@
+diff --git a/src/sage/repl/inputhook.py b/src/sage/repl/inputhook.py
+index da5df0268c0..7f7894f6dcf 100644
+--- a/src/sage/repl/inputhook.py
++++ b/src/sage/repl/inputhook.py
+@@ -17,6 +17,8 @@
+ 
+ import select
+ import errno
++import contextlib
++import io
+ 
+ from IPython import get_ipython
+ from IPython.terminal.pt_inputhooks import register
+@@ -47,15 +49,27 @@ def install():
+     """
+     Install the Sage input hook
+ 
+-    EXAMPLES::
++    EXAMPLES:
++
++    Make sure ipython is running so we really test this function::
++
++        sage: from sage.repl.interpreter import get_test_shell
++        sage: get_test_shell()
++        <sage.repl.interpreter.SageTestShell object at ...>
++
++    Run the function twice, to check it is idempotent (see :trac:`35235`)::
+ 
+         sage: from sage.repl.inputhook import install
+         sage: install()
++        sage: install()
+     """
+     ip = get_ipython()
+     if not ip:
+         return   # Not running in ipython, e.g. doctests
+-    ip.enable_gui('sage')
++    if ip._inputhook != sage_inputhook:
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui('sage')
+ 
+ 
+ def uninstall():
+@@ -71,4 +85,6 @@ def uninstall():
+     if not ip:
+         return
+     if ip._inputhook == sage_inputhook:
+-        ip.enable_gui(None)
++        # silence `ip.enable_gui()` useless output
++        with contextlib.redirect_stdout(io.StringIO()):
++            ip.enable_gui(None)
diff --git a/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
new file mode 100644
index 000000000000..2cdc674d4f9e
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35438-pythran_0.12.1.patch
@@ -0,0 +1,41 @@
+From 532fbbaf71bb41c73920b584108eb2a09d6deeb1 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
+Date: Tue, 4 Apr 2023 12:56:57 -0300
+Subject: [PATCH] Ignore deprecation warnings triggered by pythran 0.12.1
+
+These happen with python 3.11, setuptools 67.6.1, numpy 1.24.2.
+When pythran 0.12.1 is installed, I get 24 doctest failures due to
+deprecation warnings; they are all gone with this commit.
+
+[backported from 839a6e928c264a9863bd42860c78ae95a6d9f3e0]
+---
+ src/sage/all.py | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/all.py b/src/sage/all.py
+index 93588df1b93..ee775aad0e9 100644
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -96,9 +96,17 @@ warnings.filterwarnings('ignore', category=DeprecationWarning,
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+     module='(.*[.]_vendor[.])?packaging')
+ 
+-# Ignore numpy warnings triggered by pythran
++# Ignore a few warnings triggered by pythran 0.12.1
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+-                        module='pythran')
++    message='\n\n  `numpy.distutils` is deprecated since NumPy 1.23.0',
++    module='pythran.dist')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='pkg_resources is deprecated as an API|'
++            'Deprecated call to `pkg_resources.declare_namespace(.*)`',
++    module='pkg_resources')
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message='msvccompiler is deprecated and slated to be removed',
++    module='distutils.msvccompiler')
+ 
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+                         message='The distutils(.sysconfig module| package) is deprecated',
+-- 
+2.40.0
+
diff --git a/srcpkgs/sagemath/patches/35584-networkx_3.1.patch b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
new file mode 100644
index 000000000000..66eedecff7c6
--- /dev/null
+++ b/srcpkgs/sagemath/patches/35584-networkx_3.1.patch
@@ -0,0 +1,81 @@
+diff --git a/src/sage/graphs/graph.py b/src/sage/graphs/graph.py
+index c2e42bcbd3..b6a10efbf4 100644
+--- a/src/sage/graphs/graph.py
++++ b/src/sage/graphs/graph.py
+@@ -6786,13 +6786,21 @@ def cliques_number_of(self, vertices=None, cliques=None):
+             {(0, 0): 2, (0, 1): 3, (0, 2): 2, (1, 0): 2, (1, 1): 3, (1, 2): 2}
+             sage: F.cliques_number_of(vertices=[(0, 1), (1, 2)])
+             {(0, 1): 3, (1, 2): 2}
++            sage: F.cliques_number_of(vertices=(0, 1))
++            3
+             sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
+             sage: G.show(figsize=[2,2])
+             sage: G.cliques_number_of()
+             {0: 2, 1: 2, 2: 1, 3: 1}
+         """
+-        import networkx
+-        return networkx.number_of_cliques(self.networkx_graph(), vertices, cliques)
++        if cliques is None:
++            cliques = self.cliques_maximal()
++
++        if vertices in self: # single vertex
++            return sum(1 for c in cliques if vertices in c)
++        else:
++            return { v : sum(1 for c in cliques if v in c)
++                     for v in vertices or self }
+ 
+     @doc_index("Clique-related methods")
+     def cliques_get_max_clique_graph(self):
+@@ -7493,17 +7501,32 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+ 
+             sage: C = Graph('DJ{')
+             sage: C.cliques_containing_vertex()
+-            {0: [[4, 0]], 1: [[4, 1, 2, 3]], 2: [[4, 1, 2, 3]], 3: [[4, 1, 2, 3]], 4: [[4, 0], [4, 1, 2, 3]]}
++            {0: [[0, 4]],
++             1: [[1, 2, 3, 4]],
++             2: [[1, 2, 3, 4]],
++             3: [[1, 2, 3, 4]],
++             4: [[0, 4], [1, 2, 3, 4]]}
++            sage: C.cliques_containing_vertex(4)
++            [[0, 4], [1, 2, 3, 4]]
++            sage: C.cliques_containing_vertex([0, 1])
++            {0: [[0, 4]], 1: [[1, 2, 3, 4]]}
+             sage: E = C.cliques_maximal()
+             sage: E
+             [[0, 4], [1, 2, 3, 4]]
+             sage: C.cliques_containing_vertex(cliques=E)
+-            {0: [[0, 4]], 1: [[1, 2, 3, 4]], 2: [[1, 2, 3, 4]], 3: [[1, 2, 3, 4]], 4: [[0, 4], [1, 2, 3, 4]]}
++            {0: [[0, 4]],
++             1: [[1, 2, 3, 4]],
++             2: [[1, 2, 3, 4]],
++             3: [[1, 2, 3, 4]],
++             4: [[0, 4], [1, 2, 3, 4]]}
+ 
+             sage: G = Graph({0:[1,2,3], 1:[2], 3:[0,1]})
+             sage: G.show(figsize=[2,2])
+             sage: G.cliques_containing_vertex()
+-            {0: [[0, 1, 2], [0, 1, 3]], 1: [[0, 1, 2], [0, 1, 3]], 2: [[0, 1, 2]], 3: [[0, 1, 3]]}
++            {0: [[0, 1, 2], [0, 1, 3]],
++             1: [[0, 1, 2], [0, 1, 3]],
++             2: [[0, 1, 2]],
++             3: [[0, 1, 3]]}
+ 
+         Since each clique of a 2 dimensional grid corresponds to an edge, the
+         number of cliques in which a vertex is involved equals its degree::
+@@ -7518,8 +7541,14 @@ def cliques_containing_vertex(self, vertices=None, cliques=None):
+             sage: sorted(sorted(x for x in L) for L in d[(0, 1)])
+             [[(0, 0), (0, 1)], [(0, 1), (0, 2)], [(0, 1), (1, 1)]]
+         """
+-        import networkx
+-        return networkx.cliques_containing_node(self.networkx_graph(), vertices, cliques)
++        if cliques is None:
++            cliques = self.cliques_maximal()
++
++        if vertices in self: # single vertex
++            return [c for c in cliques if vertices in c]
++        else:
++            return { v : [c for c in cliques if v in c]
++                     for v in vertices or self }
+ 
+     @doc_index("Clique-related methods")
+     def clique_complex(self):
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c98da68683cc..871ae38577fd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_trac() {
 	ticket=$1
 	desc=$(echo "$2" | sed -e 's/ /_/g')
 	commit=$3
-	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "trac-$ticket-$desc-$commit.patch"
+	$DO wget "$URL_BASE_COMPARE$commit.diff" -O "$ticket-$desc-$commit.patch"
 }
 
 # run from patches dir
@@ -29,13 +29,35 @@ cd $(dirname "$0")
 get_trac 34851 "support singular 4.3.1.p3" 5e5737a0c
 get_pr 35068 "fix tests giac 1.9.0.35" patch
 
-# positive review
+# merged in 10.0.beta1
+get_pr 35058 "skip unstable tests klyachko"
+
+# merged in 10.0.beta2
 get_pr 34994 "fix tests numpy 1.24"
 get_pr 34997 "fix edge case of integer_check"
-get_pr 35058 "skip unstable tests klyachko"
-get_pr 35094 "support gap 4.12"					# includes PR 35093
 
-# needs review 
+# merged in 10.0.beta3
 get_pr 34995 "support tachyon 0.99.2"
+
+# merged in 10.0.beta4
 get_pr 34980 "avoid factoring in is_prime"
+
+# merged in 10.0.beta5
+get_pr 35094 "support gap 4.12"					# includes PR 35093
+
+# merged in 10.0.beta6
 get_pr 35127 "fix very slow test stream.py"
+get_pr 35177 "matplotlib 3.7"
+get_pr 35195 "workaround ecl race"
+get_pr 35204 "fix sage-cleaner"
+
+# merged in 10.0.beta7
+get_pr 35250 "nauty 2.8.6"
+
+# merged in 10.0.beta8
+#get_pr 35337 "ipython 8.11"
+get_pr 35423 "ipython 8.12"						# includes PR 35337
+get_pr 35438 "pythran 0.12.1"
+
+# needs review
+get_pr 35584 "networkx 3.1"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 75695f0e5f87..66a543efd21d 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
 version=9.8
-revision=1
+revision=2
 build_wrksrc=pkgs/sagemath-standard
 build_style=python3-module
 _bindir=/usr/lib/sagemath/$version/bin
@@ -26,7 +26,7 @@ depends="FlintQS eclib-devel fflas-ffpack flintlib-devel gcc-fortran gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  sage-data-conway_polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends"
+checkdepends="$depends pythran python3-Sphinx"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"

From 09713264ff96b25e7f8e00b02770e7f0bf9891ca Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Fri, 28 Apr 2023 19:38:50 -0300
Subject: [PATCH 3/3] python3-networkx: update to 3.1.

---
 srcpkgs/python3-networkx/template | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-networkx/template b/srcpkgs/python3-networkx/template
index 83e21291feb8..526f4c5e259a 100644
--- a/srcpkgs/python3-networkx/template
+++ b/srcpkgs/python3-networkx/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-networkx'
 pkgname=python3-networkx
-version=2.8.8
+version=3.1
 revision=1
 build_style=python3-module
 # failing in i686
@@ -10,12 +10,12 @@ depends="python3"
 checkdepends="python3-numpy python3-scipy python3-matplotlib python3-pandas
  python3-lxml python3-sympy python3-pytest-xdist"
 short_desc="Python3 package for creating and manipulating graphs and networks"
-maintainer="Orphaned <orphan@voidlinux.org>"
+maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="BSD-3-Clause"
 homepage="https://networkx.org"
-changelog="https://networkx.org/documentation/stable/release/"
+changelog="https://github.com/networkx/networkx/raw/main/doc/release/release_${version}.rst"
 distfiles="${PYPI_SITE}/n/networkx/networkx-${version}.tar.gz"
-checksum=230d388117af870fce5647a3c52401fcf753e94720e6ea6b4197a5355648885e
+checksum=de346335408f84de0eada6ff9fafafff9bcda11f0a0dfaa931133debb146ab61
 
 post_install() {
 	vlicense LICENSE.txt

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (35 preceding siblings ...)
  2023-04-29  2:15 ` [PR PATCH] [Updated] " tornaria
@ 2023-04-29  2:17 ` tornaria
  2023-04-29  4:29 ` icp1994
                   ` (4 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-29  2:17 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 433 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1528496949

Comment:
Here I added support for networkx 3.1 using the patch from https://github.com/sagemath/sage/pull/35584.

For testing, I include a commit to update networkx to 3.1. This one can be merged independently (but only after the patch for sagemath to support networkx 3.1 is merged).

@icp1994 

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (36 preceding siblings ...)
  2023-04-29  2:17 ` tornaria
@ 2023-04-29  4:29 ` icp1994
  2023-04-29 22:28 ` tornaria
                   ` (3 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: icp1994 @ 2023-04-29  4:29 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]

New comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1528647814

Comment:
Nice, thanks!

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (37 preceding siblings ...)
  2023-04-29  4:29 ` icp1994
@ 2023-04-29 22:28 ` tornaria
  2023-04-30  6:27 ` icp1994
                   ` (2 subsequent siblings)
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-29 22:28 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 454 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1528886606

Comment:
> Nice, thanks!

Could you please try this branch and build the update of networkx to 3.1 to see if it's working ok for your purposes?

Maybe we can just merge this PR altogether as it is now. Otherwise I will try to get this merged without the networkx update and move the networkx update to a separate PR.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (38 preceding siblings ...)
  2023-04-29 22:28 ` tornaria
@ 2023-04-30  6:27 ` icp1994
  2023-04-30 20:04 ` singular: update to 4.3.2, rebuild sagemath, networkx: update to 3.1 tornaria
  2023-04-30 22:15 ` [PR PATCH] [Merged]: " leahneukirchen
  41 siblings, 0 replies; 43+ messages in thread
From: icp1994 @ 2023-04-30  6:27 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 262 bytes --]

New comment by icp1994 on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1528950407

Comment:
Yes, I have been already using practically the same patch as this branch for my local use of networkx since v3 came out.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: singular: update to 4.3.2, rebuild sagemath, networkx: update to 3.1
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (39 preceding siblings ...)
  2023-04-30  6:27 ` icp1994
@ 2023-04-30 20:04 ` tornaria
  2023-04-30 22:15 ` [PR PATCH] [Merged]: " leahneukirchen
  41 siblings, 0 replies; 43+ messages in thread
From: tornaria @ 2023-04-30 20:04 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 380 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/43225#issuecomment-1529128147

Comment:
@leahneukirchen could we get this merged please?

This brings sagemath up to date with current versions of packages in void; it also updates networkx which was requested by @icp1994 but cannot be updated without the patch I added here.

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PR PATCH] [Merged]: singular: update to 4.3.2, rebuild sagemath, networkx: update to 3.1
  2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
                   ` (40 preceding siblings ...)
  2023-04-30 20:04 ` singular: update to 4.3.2, rebuild sagemath, networkx: update to 3.1 tornaria
@ 2023-04-30 22:15 ` leahneukirchen
  41 siblings, 0 replies; 43+ messages in thread
From: leahneukirchen @ 2023-04-30 22:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1416 bytes --]

There's a merged pull request on the void-packages repository

singular: update to 4.3.2, rebuild sagemath, networkx: update to 3.1
https://github.com/void-linux/void-packages/pull/43225

Description:
Updates:
 - singular to 4.3.2
 - python3-networkx to 3.1

For these updates we need to rebuild sagemath with patches backported from development sagemath.

In addition we also add patches to sagemath to support the following pkg updates:
 - matplotlib 3.7
 - ipython 8.12
 - nauty 2.8.6
 - pythran 0.12.1

After this PR, sagemath testsuite should pass 100% with current versions of dependencies in void. All patches are taken from upstream.

#### Testing the changes
- I tested the changes in this PR: **briefly**

I've been running this for a while. I'm also running sagemath 10.0.rc1 which includes all of our patches.


<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2023-04-30 22:15 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-02 23:00 [PR PATCH] singular: update to 4.3.2, rebuild sagemath tornaria
2023-04-03  3:43 ` tornaria
2023-04-03 18:37 ` tornaria
2023-04-03 20:25 ` dkwo
2023-04-03 20:35 ` tornaria
2023-04-03 20:51 ` [PR REVIEW] " dkwo
2023-04-03 20:54 ` dkwo
2023-04-03 21:51 ` [PR REVIEW] " tornaria
2023-04-03 23:08 ` dkwo
2023-04-03 23:09 ` dkwo
2023-04-03 23:20 ` tornaria
2023-04-03 23:20 ` tornaria
2023-04-03 23:20 ` tornaria
2023-04-05 19:23 ` dkwo
2023-04-05 19:26 ` dkwo
2023-04-05 19:27 ` dkwo
2023-04-05 19:27 ` dkwo
2023-04-05 19:28 ` dkwo
2023-04-05 19:34 ` dkwo
2023-04-06 17:30 ` dkwo
2023-04-06 17:34 ` dkwo
2023-04-06 17:39 ` dkwo
2023-04-06 18:03 ` tornaria
2023-04-06 18:23 ` dkwo
2023-04-06 18:50 ` tornaria
2023-04-06 20:13 ` dkwo
2023-04-10 19:10 ` [PR PATCH] [Updated] " tornaria
2023-04-25 12:03 ` tornaria
2023-04-25 12:05 ` tornaria
2023-04-25 12:10 ` tornaria
2023-04-27 14:06 ` [PR PATCH] [Updated] " tornaria
2023-04-27 15:15 ` dkwo
2023-04-27 16:05 ` tornaria
2023-04-27 16:11 ` tornaria
2023-04-28 19:21 ` [PR PATCH] [Updated] " tornaria
2023-04-28 19:40 ` dkwo
2023-04-29  2:15 ` [PR PATCH] [Updated] " tornaria
2023-04-29  2:17 ` tornaria
2023-04-29  4:29 ` icp1994
2023-04-29 22:28 ` tornaria
2023-04-30  6:27 ` icp1994
2023-04-30 20:04 ` singular: update to 4.3.2, rebuild sagemath, networkx: update to 3.1 tornaria
2023-04-30 22:15 ` [PR PATCH] [Merged]: " leahneukirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).