Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] [BETA] sagemath: update to 10.5.beta2
@ 2024-08-18 17:54 tornaria
  2024-08-20 20:57 ` [PR PATCH] [Updated] " tornaria
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: tornaria @ 2024-08-18 17:54 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1460 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/51902

[BETA] sagemath: update to 10.5.beta2
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - python3-gmpy2: update to 2.2.1.
 - python3-cypari2: update to 2.2.0.
 - python3-sympy: update to 1.13.2.
 - sagemath: enable all cython warnings

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From e958571efef0400689590747a0c00b3b2d8fe4d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 1/6] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From d38b90940269d0bb79a258f1e33f93a9963a7136 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 17 Aug 2024 19:56:10 -0300
Subject: [PATCH 2/6] python3-gmpy2: update to 2.2.1.

---
 srcpkgs/python3-gmpy2/template | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-gmpy2/template b/srcpkgs/python3-gmpy2/template
index 307eed419804a2..44de709067551d 100644
--- a/srcpkgs/python3-gmpy2/template
+++ b/srcpkgs/python3-gmpy2/template
@@ -1,7 +1,6 @@
 # Template file for 'python3-gmpy2'
 pkgname=python3-gmpy2
-# need $version > 2.2.0a1 which we shipped before by necessity
-version=2.2.0r
+version=2.2.1
 revision=1
 build_style=python3-pep517
 hostmakedepends="python3-setuptools python3-wheel"
@@ -14,7 +13,7 @@ license="LGPL-3.0-or-later"
 homepage="https://github.com/aleaxit/gmpy"
 changelog="https://github.com/aleaxit/gmpy/releases"
 distfiles="${PYPI_SITE}/g/gmpy2/gmpy2-${version%r}.tar.gz"
-checksum=e19e62dfeb1e4a57079f0bf51c51dec30633d9fe9e89cb9a083e05e4823afa70
+checksum=e83e07567441b78cb87544910cb3cc4fe94e7da987e93ef7622e76fb96650432
 
 if [ "$XBPS_CHECK_PKGS" = full ]; then
 	# this would cause a build-time circular dependency

From b3f34b57321cc4e7db77f066da49677d1259ff48 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 17 Aug 2024 19:58:47 -0300
Subject: [PATCH 3/6] python3-cypari2: update to 2.2.0.

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

diff --git a/srcpkgs/python3-cypari2/template b/srcpkgs/python3-cypari2/template
index 8b7e06abd5aace..2a6b284f2f0ab1 100644
--- a/srcpkgs/python3-cypari2/template
+++ b/srcpkgs/python3-cypari2/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-cypari2'
 pkgname=python3-cypari2
-version=2.1.5
+version=2.2.0
 revision=1
 build_style=python3-pep517
 hostmakedepends="python3-setuptools python3-wheel python3-Cython
@@ -14,7 +14,7 @@ license="GPL-2.0-or-later"
 homepage="https://github.com/sagemath/cypari2"
 changelog="https://github.com/sagemath/cypari2/releases"
 distfiles="https://github.com/sagemath/cypari2/archive/refs/tags/${version}.tar.gz"
-checksum=3cea1051f7cd8832b7907d11c68764e83a430036698a215abae48924a580d7fb
+checksum=08804f8e73859447cd1882d0cdc6d1e62dd813c3f291e8cba4313916e162f7cd
 
 do_check() {
 	# Please do not disable this custom check;

From 4290bd2f3174284fc3a02ccc185d4caec70cee53 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Thu, 15 Aug 2024 12:02:20 -0300
Subject: [PATCH 4/6] python3-sympy: update to 1.13.2.

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

diff --git a/srcpkgs/python3-sympy/template b/srcpkgs/python3-sympy/template
index 07c0547e01b136..64e799d5a2bad3 100644
--- a/srcpkgs/python3-sympy/template
+++ b/srcpkgs/python3-sympy/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-sympy'
 pkgname=python3-sympy
-version=1.13.1
+version=1.13.2
 revision=1
 build_style=python3-pep517
 hostmakedepends="python3-setuptools python3-wheel"
@@ -14,7 +14,7 @@ license="BSD-3-Clause"
 homepage="https://sympy.org/"
 changelog="https://github.com/sympy/sympy/wiki/Release-Notes"
 distfiles="${PYPI_SITE}/s/sympy/sympy-${version}.tar.gz"
-checksum=9cebf7e04ff162015ce31c9c6c9144daa34a93bd082f54fd8f12deca4f47515f
+checksum=401449d84d07be9d0c7a46a64bd54fe097667d5e7181bfe67ec777be9e01cb13
 
 post_install() {
 	vman doc/man/isympy.1

From 88056e2ebc746fc3e522b8cec762f5ee29e608b2 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 5/6] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   8 +-
 6 files changed, 22 insertions(+), 670 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index befe33a0188687..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=2
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -25,14 +25,14 @@ depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran meson gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  python3-conway-polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends pythran python3-Sphinx gdb"
+checkdepends="$depends python3-pytest pythran python3-Sphinx gdb"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 2b51aeceb934ee0d250e969bbe1d8512a78895fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 6/6] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

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

* Re: [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta2
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
@ 2024-08-20 20:57 ` tornaria
  2024-08-21  1:11 ` tornaria
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-08-20 20:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1465 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/51902

[BETA] sagemath: update to 10.5.beta2
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - python3-gmpy2: update to 2.2.1.
 - python3-cypari2: update to 2.2.0.
 - python3-sympy: update to 1.13.2.
 - sagemath: enable all cython warnings

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From 416e90f2c36dd4a394daaafb63207dba5203c706 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 1/6] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From 21b3dad478a94fe98ddd4ca793d16eedf424e199 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 2/6] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   8 +-
 6 files changed, 22 insertions(+), 670 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index befe33a0188687..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=2
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -25,14 +25,14 @@ depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran meson gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  python3-conway-polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends pythran python3-Sphinx gdb"
+checkdepends="$depends python3-pytest pythran python3-Sphinx gdb"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From eb7df4a9f682cf046b5c9666b666cb2d7e8d9a3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 3/6] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

From 6831717a594328f0a6efe163da56f2cf7802e040 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 19 Aug 2024 17:35:53 -0300
Subject: [PATCH 4/6] python3-numpy: update to 2.1.0.

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

diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index cab4e3e506df30..7d0e493b32c5bb 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-numpy'
 pkgname=python3-numpy
-version=2.0.1
+version=2.1.0
 revision=1
 build_style=python3-pep517
 build_helper="meson qemu"
@@ -19,7 +19,7 @@ license="BSD-3-Clause"
 homepage="https://www.numpy.org/"
 changelog="https://github.com/numpy/numpy/releases"
 distfiles="${PYPI_SITE}/n/numpy/numpy-${version}.tar.gz"
-checksum=485b87235796410c3519a699cfe1faab097e509e90ebb05dcd098db2ae87e7b3
+checksum=7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
 build_options="openblas"

From 33e6757c9f86da2ddf02a07cfd90ec7eb32f86a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 19 Aug 2024 22:02:54 -0300
Subject: [PATCH 5/6] flintlib: C99 compliance

---
 srcpkgs/flintlib/patches/2027.patch | 322 ++++++++++++++++++++++++++++
 srcpkgs/flintlib/template           |   2 +-
 2 files changed, 323 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/flintlib/patches/2027.patch

diff --git a/srcpkgs/flintlib/patches/2027.patch b/srcpkgs/flintlib/patches/2027.patch
new file mode 100644
index 00000000000000..f17ff31f2754d7
--- /dev/null
+++ b/srcpkgs/flintlib/patches/2027.patch
@@ -0,0 +1,322 @@
+See: https://github.com/flintlib/flint/pull/2027
+
+From 1b93e73d00881be12e04b7f13e070214a3c9e1cc Mon Sep 17 00:00:00 2001
+From: Dima Pasechnik <dima@pasechnik.info>
+Date: Wed, 19 Jun 2024 22:16:34 +0100
+Subject: [PATCH] ensure C99 compliance in headers, as 'I' is reserved
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Note that the following code
+---- cut here: save as t.c
+---- cut here
+
+fails to compile with a suffciently new compiler, e.g. clang 16 or gcc 14.
+
+$ gcc -c t.c
+In file included from t.c:1:
+/usr/include/flint/mpoly.h:1319:43: error: expected ‘)’ before ‘__extension__’
+ 1319 | void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
+      |                                           ^
+In file included from /usr/include/flint/fmpz_types.h:15,
+                 from /usr/include/flint/fmpz_mod_types.h:15,
+                 from /usr/include/flint/mpoly_types.h:15,
+                 from /usr/include/flint/mpoly.h:23,
+                 from t.c:2:
+/usr/include/flint/mpoly.h:1319:46: error: expected ‘;’, ‘,’ or ‘)’ before ‘mp_limb_signed_t’
+ 1319 | void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
+
+...
+---
+ src/fft_small.h             |  6 +++---
+ src/fmpz_mod_mpoly_factor.h |  8 ++++----
+ src/fmpz_mpoly.h            |  2 +-
+ src/fmpz_mpoly_factor.h     | 18 +++++++++---------
+ src/fq_nmod_mpoly_factor.h  |  6 +++---
+ src/fq_zech_mpoly_factor.h  |  6 +++---
+ src/mpoly.h                 | 18 +++++++++---------
+ src/nmod_mpoly.h            |  4 ++--
+ src/nmod_mpoly_factor.h     |  6 +++---
+ 9 files changed, 37 insertions(+), 37 deletions(-)
+
+diff --git a/src/fft_small.h b/src/fft_small.h
+index 3f62f2e988..b7404f196d 100644
+--- a/src/fft_small.h
++++ b/src/fft_small.h
+@@ -242,10 +242,10 @@ FLINT_INLINE double sd_fft_ctx_get_fft_index(double* d, ulong i)
+ }
+ 
+ /* sd_fft.c */
+-void sd_fft_trunc(const sd_fft_lctx_t Q, ulong I, ulong S, ulong k, ulong j, ulong itrunc, ulong otrunc);
++void sd_fft_trunc(const sd_fft_lctx_t Q, ulong Iv, ulong S, ulong k, ulong j, ulong itrunc, ulong otrunc);
+ 
+ /* sd_ifft.c */
+-void sd_ifft_trunc(const sd_fft_lctx_t Q, ulong I, ulong S, ulong k, ulong j, ulong z, ulong n, int f);
++void sd_ifft_trunc(const sd_fft_lctx_t Q, ulong Iv, ulong S, ulong k, ulong j, ulong z, ulong n, int f);
+ 
+ /* sd_fft_ctx.c */
+ void sd_fft_ctx_clear(sd_fft_ctx_t Q);
+@@ -428,7 +428,7 @@ typedef struct {
+ 
+ typedef mpn_ctx_struct mpn_ctx_t[1];
+ 
+-void _convert_block(ulong* Xs, sd_fft_ctx_struct* Rffts, double* d, ulong dstride, ulong np, ulong I);
++void _convert_block(ulong* Xs, sd_fft_ctx_struct* Rffts, double* d, ulong dstride, ulong np, ulong Iv);
+ ulong flint_mpn_nbits(const ulong* a, ulong an);
+ int flint_mpn_cmp_ui_2exp(const ulong* a, ulong an, ulong b, ulong e);
+ unsigned char flint_mpn_add_inplace_c(ulong* z, ulong zn, ulong* a, ulong an, unsigned char cf);
+diff --git a/src/fmpz_mod_mpoly_factor.h b/src/fmpz_mod_mpoly_factor.h
+index 359fdd1e3d..460695dd23 100644
+--- a/src/fmpz_mod_mpoly_factor.h
++++ b/src/fmpz_mod_mpoly_factor.h
+@@ -1203,15 +1203,15 @@ typedef struct {
+ typedef fmpz_mod_mpoly_pfrac_struct fmpz_mod_mpoly_pfrac_t[1];
+ 
+ 
+-int fmpz_mod_mpoly_pfrac_init(fmpz_mod_mpoly_pfrac_t I,
++int fmpz_mod_mpoly_pfrac_init(fmpz_mod_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits, slong l, slong r, const fmpz_mod_mpoly_struct * betas,
+                           const fmpz * alpha, const fmpz_mod_mpoly_ctx_t ctx);
+ 
+-void fmpz_mod_mpoly_pfrac_clear(fmpz_mod_mpoly_pfrac_t I,
++void fmpz_mod_mpoly_pfrac_clear(fmpz_mod_mpoly_pfrac_t Iv,
+                                               const fmpz_mod_mpoly_ctx_t ctx);
+ 
+ int fmpz_mod_mpoly_pfrac(slong r, fmpz_mod_mpoly_t t, const slong * deg,
+-                     fmpz_mod_mpoly_pfrac_t I, const fmpz_mod_mpoly_ctx_t ctx);
++                     fmpz_mod_mpoly_pfrac_t Iv, const fmpz_mod_mpoly_ctx_t ctx);
+ 
+ int fmpz_mod_mpoly_hlift(slong m, fmpz_mod_mpoly_struct * f, slong r,
+             const fmpz * alpha, const fmpz_mod_mpoly_t A, const slong * degs,
+@@ -1290,7 +1290,7 @@ int fmpz_mod_mpolyn_gcd_brown_smprime(
+     fmpz_mod_mpolyn_t B,
+     slong var,
+     const fmpz_mod_mpoly_ctx_t ctx,
+-    const mpoly_gcd_info_t I,
++    const mpoly_gcd_info_t Iv,
+     fmpz_mod_poly_polyun_mpolyn_stack_t St);
+ 
+ int fmpz_mod_mpolyl_gcdp_zippel(
+diff --git a/src/fmpz_mpoly.h b/src/fmpz_mpoly.h
+index b7c9677915..4be3d05c56 100644
+--- a/src/fmpz_mpoly.h
++++ b/src/fmpz_mpoly.h
+@@ -1084,7 +1084,7 @@ void fmpz_mpoly_vec_randtest_not_zero(fmpz_mpoly_vec_t vec, flint_rand_t state,
+ 
+ void fmpz_mpoly_spoly(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_t g, const fmpz_mpoly_ctx_t ctx);
+ void fmpz_mpoly_vec_set_primitive_unique(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+-void fmpz_mpoly_reduction_primitive_part(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_vec_t I, const fmpz_mpoly_ctx_t ctx);
++void fmpz_mpoly_reduction_primitive_part(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_vec_t Iv, const fmpz_mpoly_ctx_t ctx);
+ int fmpz_mpoly_vec_is_groebner(const fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+ void fmpz_mpoly_buchberger_naive(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+ int fmpz_mpoly_buchberger_naive_with_limits(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F,
+diff --git a/src/fmpz_mpoly_factor.h b/src/fmpz_mpoly_factor.h
+index 0da7c1052b..a04ef8021e 100644
+--- a/src/fmpz_mpoly_factor.h
++++ b/src/fmpz_mpoly_factor.h
+@@ -298,11 +298,11 @@ void fmpz_mpoly_from_mpolyl_perm_inflate(fmpz_mpoly_t A,
+ 
+ int fmpz_mpolyl_gcd_brown(fmpz_mpoly_t G,
+         fmpz_mpoly_t Abar, fmpz_mpoly_t Bbar, fmpz_mpoly_t A, fmpz_mpoly_t B,
+-                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t I);
++                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv);
+ 
+ int fmpz_mpolyl_gcd_brown_threaded_pool(fmpz_mpoly_t G,
+         fmpz_mpoly_t Abar, fmpz_mpoly_t Bbar, fmpz_mpoly_t A, fmpz_mpoly_t B,
+-                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                         const thread_pool_handle * handles, slong num_handles);
+ 
+ int fmpz_mpolyl_gcd_zippel(fmpz_mpoly_t G, fmpz_mpoly_t Abar,
+@@ -340,15 +340,15 @@ typedef struct {
+ 
+ typedef fmpz_poly_pfrac_struct fmpz_poly_pfrac_t[1];
+ 
+-void fmpz_poly_pfrac_init(fmpz_poly_pfrac_t I);
++void fmpz_poly_pfrac_init(fmpz_poly_pfrac_t Iv);
+ 
+-void fmpz_poly_pfrac_clear(fmpz_poly_pfrac_t I);
++void fmpz_poly_pfrac_clear(fmpz_poly_pfrac_t Iv);
+ 
+-int fmpz_poly_pfrac_precompute(fmpz_poly_pfrac_t I,
++int fmpz_poly_pfrac_precompute(fmpz_poly_pfrac_t Iv,
+                                           const fmpz_poly_struct * b, slong r);
+ 
+ int fmpz_poly_pfrac_precomp(fmpz_poly_struct * c,
+-                                     const fmpz_poly_t A, fmpz_poly_pfrac_t I);
++                                     const fmpz_poly_t A, fmpz_poly_pfrac_t Iv);
+ 
+ typedef struct {
+     flint_bitcnt_t bits;
+@@ -372,15 +372,15 @@ typedef struct {
+ 
+ typedef fmpz_mpoly_pfrac_struct fmpz_mpoly_pfrac_t[1];
+ 
+-int fmpz_mpoly_pfrac_init(fmpz_mpoly_pfrac_t I, flint_bitcnt_t bits,
++int fmpz_mpoly_pfrac_init(fmpz_mpoly_pfrac_t Iv, flint_bitcnt_t bits,
+                             slong r, slong w, const fmpz_mpoly_struct * betas,
+                                const fmpz * alpha, const fmpz_mpoly_ctx_t ctx);
+ 
+-void fmpz_mpoly_pfrac_clear(fmpz_mpoly_pfrac_t I,
++void fmpz_mpoly_pfrac_clear(fmpz_mpoly_pfrac_t Iv,
+                                                    const fmpz_mpoly_ctx_t ctx);
+ 
+ int fmpz_mpoly_pfrac(slong l, fmpz_mpoly_t t, const slong * degs,
+-                             fmpz_mpoly_pfrac_t I, const fmpz_mpoly_ctx_t ctx);
++                             fmpz_mpoly_pfrac_t Iv, const fmpz_mpoly_ctx_t ctx);
+ 
+ int fmpz_mpoly_hlift(slong m, fmpz_mpoly_struct * f, slong r,
+                 const fmpz * alpha, const fmpz_mpoly_t A, const slong * degs,
+diff --git a/src/fq_nmod_mpoly_factor.h b/src/fq_nmod_mpoly_factor.h
+index 6289d3f1c5..29caa99aa4 100644
+--- a/src/fq_nmod_mpoly_factor.h
++++ b/src/fq_nmod_mpoly_factor.h
+@@ -427,7 +427,7 @@ typedef fq_nmod_mpoly_pfrac_struct fq_nmod_mpoly_pfrac_t[1];
+ 
+ 
+ int fq_nmod_mpoly_pfrac_init(
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits,
+     slong l, slong r,
+     const fq_nmod_mpoly_struct * betas,
+@@ -435,14 +435,14 @@ int fq_nmod_mpoly_pfrac_init(
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ void fq_nmod_mpoly_pfrac_clear(
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ int fq_nmod_mpoly_pfrac(
+     slong r,
+     fq_nmod_mpoly_t t,
+     const slong * deg,
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ int fq_nmod_mpoly_hlift(
+diff --git a/src/fq_zech_mpoly_factor.h b/src/fq_zech_mpoly_factor.h
+index 06f31369f9..3d3c51419f 100644
+--- a/src/fq_zech_mpoly_factor.h
++++ b/src/fq_zech_mpoly_factor.h
+@@ -652,7 +652,7 @@ typedef fq_zech_mpoly_pfrac_struct fq_zech_mpoly_pfrac_t[1];
+ 
+ 
+ int fq_zech_mpoly_pfrac_init(
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits,
+     slong l, slong r,
+     const fq_zech_mpoly_struct * betas,
+@@ -660,14 +660,14 @@ int fq_zech_mpoly_pfrac_init(
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ void fq_zech_mpoly_pfrac_clear(
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ int fq_zech_mpoly_pfrac(
+     slong r,
+     fq_zech_mpoly_t t,
+     const slong * deg,
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ int fq_zech_mpoly_hlift(
+diff --git a/src/mpoly.h b/src/mpoly.h
+index b0950e3a48..fe0ccbe7c4 100644
+--- a/src/mpoly.h
++++ b/src/mpoly.h
+@@ -1363,9 +1363,9 @@ typedef struct
+ 
+ typedef mpoly_gcd_info_struct mpoly_gcd_info_t[1];
+ 
+-void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
++void mpoly_gcd_info_init(mpoly_gcd_info_t Iv, slong nvars);
+ 
+-void mpoly_gcd_info_clear(mpoly_gcd_info_t I);
++void mpoly_gcd_info_clear(mpoly_gcd_info_t Iv);
+ 
+ void mpoly_gcd_info_limits(ulong * Amax_exp, ulong * Amin_exp,
+                        slong * Amax_exp_count, slong * Amin_exp_count,
+@@ -1378,25 +1378,25 @@ void mpoly_gcd_info_stride(ulong * strides,
+                              const ulong * Bmax_exp, const ulong * Bmin_exp,
+                                                        const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_set_perm(mpoly_gcd_info_t I,
++void mpoly_gcd_info_set_perm(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-slong mpoly_gcd_info_get_brown_upper_limit(const mpoly_gcd_info_t I,
++slong mpoly_gcd_info_get_brown_upper_limit(const mpoly_gcd_info_t Iv,
+                                                        slong var, slong bound);
+ 
+-void mpoly_gcd_info_measure_hensel(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_hensel(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_brown(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_brown(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_bma(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_bma(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_zippel(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_zippel(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_zippel2(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_zippel2(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+ int mpoly_monomial_cofactors(fmpz * Abarexps, fmpz * Bbarexps,
+diff --git a/src/nmod_mpoly.h b/src/nmod_mpoly.h
+index 2a8136e6eb..716ac9669a 100644
+--- a/src/nmod_mpoly.h
++++ b/src/nmod_mpoly.h
+@@ -1619,13 +1619,13 @@ int nmod_mpolyn_gcd_brown_smprime_bivar(
+ int nmod_mpolyn_gcd_brown_smprime(nmod_mpolyn_t G,
+                                   nmod_mpolyn_t Abar, nmod_mpolyn_t Bbar,
+                                  nmod_mpolyn_t A, nmod_mpolyn_t B, slong var,
+-                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                                                          nmod_poly_stack_t Sp);
+ 
+ int nmod_mpolyn_gcd_brown_smprime_threaded_pool(nmod_mpolyn_t G,
+                                 nmod_mpolyn_t Abar, nmod_mpolyn_t Bbar,
+                                nmod_mpolyn_t A, nmod_mpolyn_t B, slong var,
+-                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                         const thread_pool_handle * handles, slong num_workers);
+ 
+ int nmod_mpolyn_gcd_brown_lgprime(nmod_mpolyn_t G,
+diff --git a/src/nmod_mpoly_factor.h b/src/nmod_mpoly_factor.h
+index a46afc860f..b16c802b9b 100644
+--- a/src/nmod_mpoly_factor.h
++++ b/src/nmod_mpoly_factor.h
+@@ -362,15 +362,15 @@ typedef struct {
+ typedef nmod_mpoly_pfrac_struct nmod_mpoly_pfrac_t[1];
+ 
+ 
+-int nmod_mpoly_pfrac_init(nmod_mpoly_pfrac_t I, flint_bitcnt_t bits,
++int nmod_mpoly_pfrac_init(nmod_mpoly_pfrac_t Iv, flint_bitcnt_t bits,
+                          slong l, slong r, const nmod_mpoly_struct * betas,
+                           const mp_limb_t * alpha, const nmod_mpoly_ctx_t ctx);
+ 
+-void nmod_mpoly_pfrac_clear(nmod_mpoly_pfrac_t I,
++void nmod_mpoly_pfrac_clear(nmod_mpoly_pfrac_t Iv,
+                                                    const nmod_mpoly_ctx_t ctx);
+ 
+ int nmod_mpoly_pfrac(slong r, nmod_mpoly_t t, const slong * deg,
+-                             nmod_mpoly_pfrac_t I, const nmod_mpoly_ctx_t ctx);
++                             nmod_mpoly_pfrac_t Iv, const nmod_mpoly_ctx_t ctx);
+ 
+ int nmod_mpoly_hlift(slong m, nmod_mpoly_struct * f, slong r,
+             const mp_limb_t * alpha, const nmod_mpoly_t A, const slong * degs,
diff --git a/srcpkgs/flintlib/template b/srcpkgs/flintlib/template
index 613391a9a0ae1b..465cdf1d0d3f71 100644
--- a/srcpkgs/flintlib/template
+++ b/srcpkgs/flintlib/template
@@ -1,7 +1,7 @@
 # Template file for 'flintlib'
 pkgname=flintlib
 version=3.1.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--prefix=/usr --disable-arch $(vopt_with ntl)
  $(vopt_if openblas --with-blas-include=${XBPS_CROSS_BASE}/usr/include/openblas)"

From 86dd81ae8b6540ff0ff27c9d3b0686578a802cf3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 20 Aug 2024 17:56:06 -0300
Subject: [PATCH 6/6] sagemath: patch for numpy 2.1

---
 srcpkgs/sagemath/patches/numpy_2.1a.patch |  20 ++
 srcpkgs/sagemath/patches/numpy_2.1b.patch | 223 ++++++++++++++++++++++
 2 files changed, 243 insertions(+)
 create mode 100644 srcpkgs/sagemath/patches/numpy_2.1a.patch
 create mode 100644 srcpkgs/sagemath/patches/numpy_2.1b.patch

diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
new file mode 100644
index 00000000000000..a2b77d61168bf9
--- /dev/null
+++ b/srcpkgs/sagemath/patches/numpy_2.1a.patch
@@ -0,0 +1,20 @@
+--- a/src/sage/matrix/matrix1.pyx
++++ b/src/sage/matrix/matrix1.pyx
+@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
+             entries = [[sib(v, 2) for v in row] for row in self.rows()]
+             return sib.name('matrix')(self.base_ring(), entries)
+ 
+-    def numpy(self, dtype=None):
++    def numpy(self, dtype=None, copy=True):
+         """
+         Return the Numpy matrix associated to this matrix.
+ 
+@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
+             (3, 4)
+         """
+         import numpy
+-        A = numpy.matrix(self.list(), dtype=dtype)
++        A = numpy.matrix(self.list(), dtype=dtype, copy=copy)
+         return numpy.resize(A,(self.nrows(), self.ncols()))
+ 
+     # Define the magic "__array__" function so that numpy.array(m) can convert
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
new file mode 100644
index 00000000000000..e59b8940e9d9a2
--- /dev/null
+++ b/srcpkgs/sagemath/patches/numpy_2.1b.patch
@@ -0,0 +1,223 @@
+diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
+index b3ebd206cd2..d61242928dc 100644
+--- a/src/sage/combinat/fully_packed_loop.py
++++ b/src/sage/combinat/fully_packed_loop.py
+@@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
+ 
+         sage: import numpy as np
+         sage: if int(np.version.short_version[0]) > 1:
+-        ....:     np.set_printoptions(legacy="1.25")
++        ....:     np.set_printoptions(legacy="1.25") and None
+         sage: from sage.combinat.fully_packed_loop import _make_color_list
+         sage: _make_color_list(5)
+         sage: _make_color_list(5, ['blue', 'red'])
+diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
+index 2a03bb68f67..fbde392f954 100644
+--- a/src/sage/functions/special.py
++++ b/src/sage/functions/special.py
+@@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
+         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
+         sage: import numpy as np                                                        # needs scipy
+         sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
+-        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
++        ....:     np.set_printoptions(legacy="1.25") and None                           # needs scipy
+         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
+         (0.3454941494713355-4.231083042742082e-17j)
+ 
+diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
+index 7ae8ca4966f..e3633c6c423 100644
+--- a/src/sage/numerical/optimize.py
++++ b/src/sage/numerical/optimize.py
+@@ -385,7 +385,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
+         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
+         sage: import numpy
+         sage: if int(numpy.version.short_version[0]) > 1:
+-        ....:     numpy.set_printoptions(legacy="1.25")
++        ....:     numpy.set_printoptions(legacy="1.25") and None
+         sage: from numpy import zeros
+         sage: def rosen_der(x):
+         ....:    xm = x[1r:-1r]
+diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
+index 23e2517ca56..96f85a4d944 100644
+--- a/src/sage/plot/arrow.py
++++ b/src/sage/plot/arrow.py
+@@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
+ 
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     numpy.set_printoptions(legacy="1.25") and None
+             sage: from sage.plot.arrow import CurveArrow
+             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
+             ....:                options={})
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index 6be448f1e04..3b44fdd90b1 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -786,7 +786,7 @@ class MultiGraphics(WithEqualityById, SageObject):
+             (0.2, 0.3, 0.4, 0.1)
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     numpy.set_printoptions(legacy="1.25") and None
+             sage: ax1.get_position().bounds  # tol 1.0e-13
+             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
+ 
+@@ -1300,7 +1300,7 @@ class GraphicsArray(MultiGraphics):
+             sage: G = graphics_array([g1, g2])
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     numpy.set_printoptions(legacy="1.25") and None
+             sage: G.position(0)  # tol 5.0e-3
+             (0.025045451349937315,
+              0.03415488992713045,
+diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
+index d2cb11088c7..b05c21692fb 100644
+--- a/src/sage/plot/streamline_plot.py
++++ b/src/sage/plot/streamline_plot.py
+@@ -73,7 +73,7 @@ class StreamlinePlot(GraphicPrimitive):
+             sage: x, y = var('x y')
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     numpy.set_printoptions(legacy="1.25") and None
+             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
+             sage: d['xmin']
+             10.0
+diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
+index 38c30f7627b..c6d31b51747 100644
+--- a/src/sage/rings/integer.pyx
++++ b/src/sage/rings/integer.pyx
+@@ -594,7 +594,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+             sage: # needs numpy 
+             sage: import numpy
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     numpy.set_printoptions(legacy="1.25") and None
+             sage: numpy.int8('12') == 12
+             True
+             sage: 12 == numpy.int8('12')
+diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
+index 76fbfedab95..62aa3e60821 100644
+--- a/src/sage/rings/real_mpfi.pyx
++++ b/src/sage/rings/real_mpfi.pyx
+@@ -232,7 +232,7 @@ TESTS::
+ 
+     sage: import numpy                                                                  # needs numpy
+     sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
+-    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
++    ....:     numpy.set_printoptions(legacy="1.25") and None                            # needs numpy
+     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
+     True
+     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
+diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
+index 70ce616f92f..f6db3703307 100644
+--- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
++++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
+@@ -78,7 +78,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     np.set_printoptions(legacy="1.25") and None
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
+@@ -298,7 +298,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     np.set_printoptions(legacy="1.25") and None
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((10, 10))
+             sage: data[1:4,1:4] = True
+@@ -322,7 +322,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     np.set_printoptions(legacy="1.25") and None
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: data[1,1] = True
+@@ -377,7 +377,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     np.set_printoptions(legacy="1.25") and None
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+ 
+             sage: data = np.zeros((20, 20))
+@@ -529,7 +529,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     np.set_printoptions(legacy="1.25") and None
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: data[1, 1] = True
+diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
+index 6937f6cb410..154a897b89b 100644
+--- a/src/sage/stats/basic_stats.py
++++ b/src/sage/stats/basic_stats.py
+@@ -228,7 +228,7 @@ def std(v, bias=False):
+         sage: # needs numpy
+         sage: import numpy
+         sage: if int(numpy.version.short_version[0]) > 1:
+-        ....:     numpy.set_printoptions(legacy="1.25")
++        ....:     numpy.set_printoptions(legacy="1.25") and None
+         sage: x = numpy.array([1,2,3,4,5])
+         sage: std(x, bias=False)
+         1.5811388300841898
+@@ -307,7 +307,7 @@ def variance(v, bias=False):
+         0.4897530450000000?
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     numpy.set_printoptions(legacy="1.25") and None                        # needs numpy
+         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
+         sage: variance(x, bias=False)                                                   # needs numpy
+         2.5
+diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
+index 955a256e9b4..dfa02de288e 100644
+--- a/src/sage/structure/coerce.pyx
++++ b/src/sage/structure/coerce.pyx
+@@ -521,7 +521,7 @@ cdef class CoercionModel:
+ 
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     numpy.set_printoptions(legacy="1.25") and None                        # needs numpy
+ 
+         sage: # needs sage.rings.real_mpfr
+         sage: x = polygen(RR)
+diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
+index cd89ad2a256..28d9acb8de9 100644
+--- a/src/sage/symbolic/function.pyx
++++ b/src/sage/symbolic/function.pyx
+@@ -965,7 +965,7 @@ cdef class BuiltinFunction(Function):
+ 
+             sage: import numpy                                                          # needs numpy
+             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
+-            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
++            ....:     numpy.set_printoptions(legacy="1.25") and None                    # needs numpy
+ 
+             sage: sin(numpy.int32(0))                                                   # needs numpy
+             0.0
+diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
+index 5b007d9e5fd..acf7a0c7003 100644
+--- a/src/sage/symbolic/ring.pyx
++++ b/src/sage/symbolic/ring.pyx
+@@ -1163,7 +1163,7 @@ cdef class NumpyToSRMorphism(Morphism):
+ 
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     numpy.set_printoptions(legacy="1.25") and None                        # needs numpy
+         sage: f(x) = x^2
+         sage: f(numpy.int8('2'))                                                        # needs numpy
+         4

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

* Re: [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta2
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
  2024-08-20 20:57 ` [PR PATCH] [Updated] " tornaria
@ 2024-08-21  1:11 ` tornaria
  2024-08-22  2:10 ` tornaria
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-08-21  1:11 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1465 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/51902

[BETA] sagemath: update to 10.5.beta2
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - python3-gmpy2: update to 2.2.1.
 - python3-cypari2: update to 2.2.0.
 - python3-sympy: update to 1.13.2.
 - sagemath: enable all cython warnings

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From 416e90f2c36dd4a394daaafb63207dba5203c706 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 1/6] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From 21b3dad478a94fe98ddd4ca793d16eedf424e199 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 2/6] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   8 +-
 6 files changed, 22 insertions(+), 670 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index befe33a0188687..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=2
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -25,14 +25,14 @@ depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran meson gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  python3-conway-polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends pythran python3-Sphinx gdb"
+checkdepends="$depends python3-pytest pythran python3-Sphinx gdb"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From eb7df4a9f682cf046b5c9666b666cb2d7e8d9a3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 3/6] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

From 6831717a594328f0a6efe163da56f2cf7802e040 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 19 Aug 2024 17:35:53 -0300
Subject: [PATCH 4/6] python3-numpy: update to 2.1.0.

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

diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index cab4e3e506df30..7d0e493b32c5bb 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-numpy'
 pkgname=python3-numpy
-version=2.0.1
+version=2.1.0
 revision=1
 build_style=python3-pep517
 build_helper="meson qemu"
@@ -19,7 +19,7 @@ license="BSD-3-Clause"
 homepage="https://www.numpy.org/"
 changelog="https://github.com/numpy/numpy/releases"
 distfiles="${PYPI_SITE}/n/numpy/numpy-${version}.tar.gz"
-checksum=485b87235796410c3519a699cfe1faab097e509e90ebb05dcd098db2ae87e7b3
+checksum=7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
 build_options="openblas"

From 33e6757c9f86da2ddf02a07cfd90ec7eb32f86a9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 19 Aug 2024 22:02:54 -0300
Subject: [PATCH 5/6] flintlib: C99 compliance

---
 srcpkgs/flintlib/patches/2027.patch | 322 ++++++++++++++++++++++++++++
 srcpkgs/flintlib/template           |   2 +-
 2 files changed, 323 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/flintlib/patches/2027.patch

diff --git a/srcpkgs/flintlib/patches/2027.patch b/srcpkgs/flintlib/patches/2027.patch
new file mode 100644
index 00000000000000..f17ff31f2754d7
--- /dev/null
+++ b/srcpkgs/flintlib/patches/2027.patch
@@ -0,0 +1,322 @@
+See: https://github.com/flintlib/flint/pull/2027
+
+From 1b93e73d00881be12e04b7f13e070214a3c9e1cc Mon Sep 17 00:00:00 2001
+From: Dima Pasechnik <dima@pasechnik.info>
+Date: Wed, 19 Jun 2024 22:16:34 +0100
+Subject: [PATCH] ensure C99 compliance in headers, as 'I' is reserved
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Note that the following code
+---- cut here: save as t.c
+---- cut here
+
+fails to compile with a suffciently new compiler, e.g. clang 16 or gcc 14.
+
+$ gcc -c t.c
+In file included from t.c:1:
+/usr/include/flint/mpoly.h:1319:43: error: expected ‘)’ before ‘__extension__’
+ 1319 | void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
+      |                                           ^
+In file included from /usr/include/flint/fmpz_types.h:15,
+                 from /usr/include/flint/fmpz_mod_types.h:15,
+                 from /usr/include/flint/mpoly_types.h:15,
+                 from /usr/include/flint/mpoly.h:23,
+                 from t.c:2:
+/usr/include/flint/mpoly.h:1319:46: error: expected ‘;’, ‘,’ or ‘)’ before ‘mp_limb_signed_t’
+ 1319 | void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
+
+...
+---
+ src/fft_small.h             |  6 +++---
+ src/fmpz_mod_mpoly_factor.h |  8 ++++----
+ src/fmpz_mpoly.h            |  2 +-
+ src/fmpz_mpoly_factor.h     | 18 +++++++++---------
+ src/fq_nmod_mpoly_factor.h  |  6 +++---
+ src/fq_zech_mpoly_factor.h  |  6 +++---
+ src/mpoly.h                 | 18 +++++++++---------
+ src/nmod_mpoly.h            |  4 ++--
+ src/nmod_mpoly_factor.h     |  6 +++---
+ 9 files changed, 37 insertions(+), 37 deletions(-)
+
+diff --git a/src/fft_small.h b/src/fft_small.h
+index 3f62f2e988..b7404f196d 100644
+--- a/src/fft_small.h
++++ b/src/fft_small.h
+@@ -242,10 +242,10 @@ FLINT_INLINE double sd_fft_ctx_get_fft_index(double* d, ulong i)
+ }
+ 
+ /* sd_fft.c */
+-void sd_fft_trunc(const sd_fft_lctx_t Q, ulong I, ulong S, ulong k, ulong j, ulong itrunc, ulong otrunc);
++void sd_fft_trunc(const sd_fft_lctx_t Q, ulong Iv, ulong S, ulong k, ulong j, ulong itrunc, ulong otrunc);
+ 
+ /* sd_ifft.c */
+-void sd_ifft_trunc(const sd_fft_lctx_t Q, ulong I, ulong S, ulong k, ulong j, ulong z, ulong n, int f);
++void sd_ifft_trunc(const sd_fft_lctx_t Q, ulong Iv, ulong S, ulong k, ulong j, ulong z, ulong n, int f);
+ 
+ /* sd_fft_ctx.c */
+ void sd_fft_ctx_clear(sd_fft_ctx_t Q);
+@@ -428,7 +428,7 @@ typedef struct {
+ 
+ typedef mpn_ctx_struct mpn_ctx_t[1];
+ 
+-void _convert_block(ulong* Xs, sd_fft_ctx_struct* Rffts, double* d, ulong dstride, ulong np, ulong I);
++void _convert_block(ulong* Xs, sd_fft_ctx_struct* Rffts, double* d, ulong dstride, ulong np, ulong Iv);
+ ulong flint_mpn_nbits(const ulong* a, ulong an);
+ int flint_mpn_cmp_ui_2exp(const ulong* a, ulong an, ulong b, ulong e);
+ unsigned char flint_mpn_add_inplace_c(ulong* z, ulong zn, ulong* a, ulong an, unsigned char cf);
+diff --git a/src/fmpz_mod_mpoly_factor.h b/src/fmpz_mod_mpoly_factor.h
+index 359fdd1e3d..460695dd23 100644
+--- a/src/fmpz_mod_mpoly_factor.h
++++ b/src/fmpz_mod_mpoly_factor.h
+@@ -1203,15 +1203,15 @@ typedef struct {
+ typedef fmpz_mod_mpoly_pfrac_struct fmpz_mod_mpoly_pfrac_t[1];
+ 
+ 
+-int fmpz_mod_mpoly_pfrac_init(fmpz_mod_mpoly_pfrac_t I,
++int fmpz_mod_mpoly_pfrac_init(fmpz_mod_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits, slong l, slong r, const fmpz_mod_mpoly_struct * betas,
+                           const fmpz * alpha, const fmpz_mod_mpoly_ctx_t ctx);
+ 
+-void fmpz_mod_mpoly_pfrac_clear(fmpz_mod_mpoly_pfrac_t I,
++void fmpz_mod_mpoly_pfrac_clear(fmpz_mod_mpoly_pfrac_t Iv,
+                                               const fmpz_mod_mpoly_ctx_t ctx);
+ 
+ int fmpz_mod_mpoly_pfrac(slong r, fmpz_mod_mpoly_t t, const slong * deg,
+-                     fmpz_mod_mpoly_pfrac_t I, const fmpz_mod_mpoly_ctx_t ctx);
++                     fmpz_mod_mpoly_pfrac_t Iv, const fmpz_mod_mpoly_ctx_t ctx);
+ 
+ int fmpz_mod_mpoly_hlift(slong m, fmpz_mod_mpoly_struct * f, slong r,
+             const fmpz * alpha, const fmpz_mod_mpoly_t A, const slong * degs,
+@@ -1290,7 +1290,7 @@ int fmpz_mod_mpolyn_gcd_brown_smprime(
+     fmpz_mod_mpolyn_t B,
+     slong var,
+     const fmpz_mod_mpoly_ctx_t ctx,
+-    const mpoly_gcd_info_t I,
++    const mpoly_gcd_info_t Iv,
+     fmpz_mod_poly_polyun_mpolyn_stack_t St);
+ 
+ int fmpz_mod_mpolyl_gcdp_zippel(
+diff --git a/src/fmpz_mpoly.h b/src/fmpz_mpoly.h
+index b7c9677915..4be3d05c56 100644
+--- a/src/fmpz_mpoly.h
++++ b/src/fmpz_mpoly.h
+@@ -1084,7 +1084,7 @@ void fmpz_mpoly_vec_randtest_not_zero(fmpz_mpoly_vec_t vec, flint_rand_t state,
+ 
+ void fmpz_mpoly_spoly(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_t g, const fmpz_mpoly_ctx_t ctx);
+ void fmpz_mpoly_vec_set_primitive_unique(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+-void fmpz_mpoly_reduction_primitive_part(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_vec_t I, const fmpz_mpoly_ctx_t ctx);
++void fmpz_mpoly_reduction_primitive_part(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_vec_t Iv, const fmpz_mpoly_ctx_t ctx);
+ int fmpz_mpoly_vec_is_groebner(const fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+ void fmpz_mpoly_buchberger_naive(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+ int fmpz_mpoly_buchberger_naive_with_limits(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F,
+diff --git a/src/fmpz_mpoly_factor.h b/src/fmpz_mpoly_factor.h
+index 0da7c1052b..a04ef8021e 100644
+--- a/src/fmpz_mpoly_factor.h
++++ b/src/fmpz_mpoly_factor.h
+@@ -298,11 +298,11 @@ void fmpz_mpoly_from_mpolyl_perm_inflate(fmpz_mpoly_t A,
+ 
+ int fmpz_mpolyl_gcd_brown(fmpz_mpoly_t G,
+         fmpz_mpoly_t Abar, fmpz_mpoly_t Bbar, fmpz_mpoly_t A, fmpz_mpoly_t B,
+-                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t I);
++                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv);
+ 
+ int fmpz_mpolyl_gcd_brown_threaded_pool(fmpz_mpoly_t G,
+         fmpz_mpoly_t Abar, fmpz_mpoly_t Bbar, fmpz_mpoly_t A, fmpz_mpoly_t B,
+-                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                         const thread_pool_handle * handles, slong num_handles);
+ 
+ int fmpz_mpolyl_gcd_zippel(fmpz_mpoly_t G, fmpz_mpoly_t Abar,
+@@ -340,15 +340,15 @@ typedef struct {
+ 
+ typedef fmpz_poly_pfrac_struct fmpz_poly_pfrac_t[1];
+ 
+-void fmpz_poly_pfrac_init(fmpz_poly_pfrac_t I);
++void fmpz_poly_pfrac_init(fmpz_poly_pfrac_t Iv);
+ 
+-void fmpz_poly_pfrac_clear(fmpz_poly_pfrac_t I);
++void fmpz_poly_pfrac_clear(fmpz_poly_pfrac_t Iv);
+ 
+-int fmpz_poly_pfrac_precompute(fmpz_poly_pfrac_t I,
++int fmpz_poly_pfrac_precompute(fmpz_poly_pfrac_t Iv,
+                                           const fmpz_poly_struct * b, slong r);
+ 
+ int fmpz_poly_pfrac_precomp(fmpz_poly_struct * c,
+-                                     const fmpz_poly_t A, fmpz_poly_pfrac_t I);
++                                     const fmpz_poly_t A, fmpz_poly_pfrac_t Iv);
+ 
+ typedef struct {
+     flint_bitcnt_t bits;
+@@ -372,15 +372,15 @@ typedef struct {
+ 
+ typedef fmpz_mpoly_pfrac_struct fmpz_mpoly_pfrac_t[1];
+ 
+-int fmpz_mpoly_pfrac_init(fmpz_mpoly_pfrac_t I, flint_bitcnt_t bits,
++int fmpz_mpoly_pfrac_init(fmpz_mpoly_pfrac_t Iv, flint_bitcnt_t bits,
+                             slong r, slong w, const fmpz_mpoly_struct * betas,
+                                const fmpz * alpha, const fmpz_mpoly_ctx_t ctx);
+ 
+-void fmpz_mpoly_pfrac_clear(fmpz_mpoly_pfrac_t I,
++void fmpz_mpoly_pfrac_clear(fmpz_mpoly_pfrac_t Iv,
+                                                    const fmpz_mpoly_ctx_t ctx);
+ 
+ int fmpz_mpoly_pfrac(slong l, fmpz_mpoly_t t, const slong * degs,
+-                             fmpz_mpoly_pfrac_t I, const fmpz_mpoly_ctx_t ctx);
++                             fmpz_mpoly_pfrac_t Iv, const fmpz_mpoly_ctx_t ctx);
+ 
+ int fmpz_mpoly_hlift(slong m, fmpz_mpoly_struct * f, slong r,
+                 const fmpz * alpha, const fmpz_mpoly_t A, const slong * degs,
+diff --git a/src/fq_nmod_mpoly_factor.h b/src/fq_nmod_mpoly_factor.h
+index 6289d3f1c5..29caa99aa4 100644
+--- a/src/fq_nmod_mpoly_factor.h
++++ b/src/fq_nmod_mpoly_factor.h
+@@ -427,7 +427,7 @@ typedef fq_nmod_mpoly_pfrac_struct fq_nmod_mpoly_pfrac_t[1];
+ 
+ 
+ int fq_nmod_mpoly_pfrac_init(
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits,
+     slong l, slong r,
+     const fq_nmod_mpoly_struct * betas,
+@@ -435,14 +435,14 @@ int fq_nmod_mpoly_pfrac_init(
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ void fq_nmod_mpoly_pfrac_clear(
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ int fq_nmod_mpoly_pfrac(
+     slong r,
+     fq_nmod_mpoly_t t,
+     const slong * deg,
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ int fq_nmod_mpoly_hlift(
+diff --git a/src/fq_zech_mpoly_factor.h b/src/fq_zech_mpoly_factor.h
+index 06f31369f9..3d3c51419f 100644
+--- a/src/fq_zech_mpoly_factor.h
++++ b/src/fq_zech_mpoly_factor.h
+@@ -652,7 +652,7 @@ typedef fq_zech_mpoly_pfrac_struct fq_zech_mpoly_pfrac_t[1];
+ 
+ 
+ int fq_zech_mpoly_pfrac_init(
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits,
+     slong l, slong r,
+     const fq_zech_mpoly_struct * betas,
+@@ -660,14 +660,14 @@ int fq_zech_mpoly_pfrac_init(
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ void fq_zech_mpoly_pfrac_clear(
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ int fq_zech_mpoly_pfrac(
+     slong r,
+     fq_zech_mpoly_t t,
+     const slong * deg,
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ int fq_zech_mpoly_hlift(
+diff --git a/src/mpoly.h b/src/mpoly.h
+index b0950e3a48..fe0ccbe7c4 100644
+--- a/src/mpoly.h
++++ b/src/mpoly.h
+@@ -1363,9 +1363,9 @@ typedef struct
+ 
+ typedef mpoly_gcd_info_struct mpoly_gcd_info_t[1];
+ 
+-void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
++void mpoly_gcd_info_init(mpoly_gcd_info_t Iv, slong nvars);
+ 
+-void mpoly_gcd_info_clear(mpoly_gcd_info_t I);
++void mpoly_gcd_info_clear(mpoly_gcd_info_t Iv);
+ 
+ void mpoly_gcd_info_limits(ulong * Amax_exp, ulong * Amin_exp,
+                        slong * Amax_exp_count, slong * Amin_exp_count,
+@@ -1378,25 +1378,25 @@ void mpoly_gcd_info_stride(ulong * strides,
+                              const ulong * Bmax_exp, const ulong * Bmin_exp,
+                                                        const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_set_perm(mpoly_gcd_info_t I,
++void mpoly_gcd_info_set_perm(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-slong mpoly_gcd_info_get_brown_upper_limit(const mpoly_gcd_info_t I,
++slong mpoly_gcd_info_get_brown_upper_limit(const mpoly_gcd_info_t Iv,
+                                                        slong var, slong bound);
+ 
+-void mpoly_gcd_info_measure_hensel(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_hensel(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_brown(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_brown(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_bma(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_bma(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_zippel(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_zippel(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_zippel2(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_zippel2(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+ int mpoly_monomial_cofactors(fmpz * Abarexps, fmpz * Bbarexps,
+diff --git a/src/nmod_mpoly.h b/src/nmod_mpoly.h
+index 2a8136e6eb..716ac9669a 100644
+--- a/src/nmod_mpoly.h
++++ b/src/nmod_mpoly.h
+@@ -1619,13 +1619,13 @@ int nmod_mpolyn_gcd_brown_smprime_bivar(
+ int nmod_mpolyn_gcd_brown_smprime(nmod_mpolyn_t G,
+                                   nmod_mpolyn_t Abar, nmod_mpolyn_t Bbar,
+                                  nmod_mpolyn_t A, nmod_mpolyn_t B, slong var,
+-                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                                                          nmod_poly_stack_t Sp);
+ 
+ int nmod_mpolyn_gcd_brown_smprime_threaded_pool(nmod_mpolyn_t G,
+                                 nmod_mpolyn_t Abar, nmod_mpolyn_t Bbar,
+                                nmod_mpolyn_t A, nmod_mpolyn_t B, slong var,
+-                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                         const thread_pool_handle * handles, slong num_workers);
+ 
+ int nmod_mpolyn_gcd_brown_lgprime(nmod_mpolyn_t G,
+diff --git a/src/nmod_mpoly_factor.h b/src/nmod_mpoly_factor.h
+index a46afc860f..b16c802b9b 100644
+--- a/src/nmod_mpoly_factor.h
++++ b/src/nmod_mpoly_factor.h
+@@ -362,15 +362,15 @@ typedef struct {
+ typedef nmod_mpoly_pfrac_struct nmod_mpoly_pfrac_t[1];
+ 
+ 
+-int nmod_mpoly_pfrac_init(nmod_mpoly_pfrac_t I, flint_bitcnt_t bits,
++int nmod_mpoly_pfrac_init(nmod_mpoly_pfrac_t Iv, flint_bitcnt_t bits,
+                          slong l, slong r, const nmod_mpoly_struct * betas,
+                           const mp_limb_t * alpha, const nmod_mpoly_ctx_t ctx);
+ 
+-void nmod_mpoly_pfrac_clear(nmod_mpoly_pfrac_t I,
++void nmod_mpoly_pfrac_clear(nmod_mpoly_pfrac_t Iv,
+                                                    const nmod_mpoly_ctx_t ctx);
+ 
+ int nmod_mpoly_pfrac(slong r, nmod_mpoly_t t, const slong * deg,
+-                             nmod_mpoly_pfrac_t I, const nmod_mpoly_ctx_t ctx);
++                             nmod_mpoly_pfrac_t Iv, const nmod_mpoly_ctx_t ctx);
+ 
+ int nmod_mpoly_hlift(slong m, nmod_mpoly_struct * f, slong r,
+             const mp_limb_t * alpha, const nmod_mpoly_t A, const slong * degs,
diff --git a/srcpkgs/flintlib/template b/srcpkgs/flintlib/template
index 613391a9a0ae1b..465cdf1d0d3f71 100644
--- a/srcpkgs/flintlib/template
+++ b/srcpkgs/flintlib/template
@@ -1,7 +1,7 @@
 # Template file for 'flintlib'
 pkgname=flintlib
 version=3.1.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--prefix=/usr --disable-arch $(vopt_with ntl)
  $(vopt_if openblas --with-blas-include=${XBPS_CROSS_BASE}/usr/include/openblas)"

From e78be426bc1268e87433181f2fee4982b7e8dcf3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 20 Aug 2024 17:56:06 -0300
Subject: [PATCH 6/6] sagemath: patch for numpy 2.1

---
 srcpkgs/sagemath/patches/numpy_2.1a.patch |  28 +++
 srcpkgs/sagemath/patches/numpy_2.1b.patch | 229 ++++++++++++++++++++++
 2 files changed, 257 insertions(+)
 create mode 100644 srcpkgs/sagemath/patches/numpy_2.1a.patch
 create mode 100644 srcpkgs/sagemath/patches/numpy_2.1b.patch

diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
new file mode 100644
index 00000000000000..493c75e2f8f8e0
--- /dev/null
+++ b/srcpkgs/sagemath/patches/numpy_2.1a.patch
@@ -0,0 +1,28 @@
+commit d755b32cbed462abf01a1cd782ba57cb92fbf713
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Mon Aug 19 23:25:32 2024 -0300
+
+    add copy parameter to numpy (needed for v2.1)
+
+diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
+index 3edb9ead54d..2c76fd1e557 100644
+--- a/src/sage/matrix/matrix1.pyx
++++ b/src/sage/matrix/matrix1.pyx
+@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
+             entries = [[sib(v, 2) for v in row] for row in self.rows()]
+             return sib.name('matrix')(self.base_ring(), entries)
+ 
+-    def numpy(self, dtype=None):
++    def numpy(self, dtype=None, copy=True):
+         """
+         Return the Numpy matrix associated to this matrix.
+ 
+@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
+             (3, 4)
+         """
+         import numpy
+-        A = numpy.matrix(self.list(), dtype=dtype)
++        A = numpy.matrix(self.list(), dtype=dtype, copy=copy)
+         return numpy.resize(A,(self.nrows(), self.ncols()))
+ 
+     # Define the magic "__array__" function so that numpy.array(m) can convert
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
new file mode 100644
index 00000000000000..8dc0eec2b5a9d8
--- /dev/null
+++ b/srcpkgs/sagemath/patches/numpy_2.1b.patch
@@ -0,0 +1,229 @@
+commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Tue Aug 20 00:05:33 2024 -0300
+
+    silence np.set_printoptions (for numpy 2.1)
+
+diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
+index 74a14fa1ecd..82e6c7eb3c8 100644
+--- a/src/sage/combinat/fully_packed_loop.py
++++ b/src/sage/combinat/fully_packed_loop.py
+@@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
+ 
+         sage: import numpy as np
+         sage: if int(np.version.short_version[0]) > 1:
+-        ....:     np.set_printoptions(legacy="1.25")
++        ....:     _token = np.set_printoptions(legacy="1.25")
+         sage: from sage.combinat.fully_packed_loop import _make_color_list
+         sage: _make_color_list(5)
+         sage: _make_color_list(5, ['blue', 'red'])
+diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
+index 308171af3cd..6f66624ef87 100644
+--- a/src/sage/functions/special.py
++++ b/src/sage/functions/special.py
+@@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
+         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
+         sage: import numpy as np                                                        # needs scipy
+         sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
+-        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
++        ....:     _token = np.set_printoptions(legacy="1.25")                           # needs scipy
+         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
+         (0.3454941494713355-4.231083042742082e-17j)
+ 
+diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
+index b3e42a6a6a2..13ffa4d1789 100644
+--- a/src/sage/numerical/optimize.py
++++ b/src/sage/numerical/optimize.py
+@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
+         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
+         sage: import numpy
+         sage: if int(numpy.version.short_version[0]) > 1:
+-        ....:     numpy.set_printoptions(legacy="1.25")
++        ....:     _token = numpy.set_printoptions(legacy="1.25")
+         sage: from numpy import zeros
+         sage: def rosen_der(x):
+         ....:    xm = x[1r:-1r]
+diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
+index 02442f90ba4..1fe3f0b051a 100644
+--- a/src/sage/plot/arrow.py
++++ b/src/sage/plot/arrow.py
+@@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
+ 
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: from sage.plot.arrow import CurveArrow
+             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
+             ....:                options={})
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index d2f70b44526..2eaacc6879e 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
+             (0.2, 0.3, 0.4, 0.1)
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: ax1.get_position().bounds  # tol 1.0e-13
+             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
+         """
+@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
+             sage: G = graphics_array([g1, g2])
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: G.position(0)  # tol 5.0e-3
+             (0.025045451349937315,
+              0.03415488992713045,
+diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
+index b69a05b37bf..25e404bfc7d 100644
+--- a/src/sage/plot/streamline_plot.py
++++ b/src/sage/plot/streamline_plot.py
+@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
+             sage: x, y = var('x y')
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
+             sage: d['xmin']
+             10.0
+diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
+index 11811b9587f..8ce0f7f2683 100644
+--- a/src/sage/rings/integer.pyx
++++ b/src/sage/rings/integer.pyx
+@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+             sage: # needs numpy
+             sage: import numpy
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: numpy.int8('12') == 12
+             True
+             sage: 12 == numpy.int8('12')
+diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
+index 11953a50ab5..6aafcceed89 100644
+--- a/src/sage/rings/real_mpfi.pyx
++++ b/src/sage/rings/real_mpfi.pyx
+@@ -232,7 +232,7 @@ TESTS::
+ 
+     sage: import numpy                                                                  # needs numpy
+     sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
+-    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
++    ....:     _token = numpy.set_printoptions(legacy="1.25")                            # needs numpy
+     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
+     True
+     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
+diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
+index 40b92ab23eb..3838bcccb8a 100755
+--- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
++++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
+@@ -78,7 +78,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
+@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((10, 10))
+             sage: data[1:4,1:4] = True
+@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: data[1,1] = True
+@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+ 
+             sage: data = np.zeros((20, 20))
+@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: data[1, 1] = True
+diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
+index 47d890cf0ab..ba7f0cdb0f9 100644
+--- a/src/sage/stats/basic_stats.py
++++ b/src/sage/stats/basic_stats.py
+@@ -222,7 +222,7 @@ def std(v, bias=False):
+         sage: # needs numpy
+         sage: import numpy
+         sage: if int(numpy.version.short_version[0]) > 1:
+-        ....:     numpy.set_printoptions(legacy="1.25")
++        ....:     _token = numpy.set_printoptions(legacy="1.25")
+         sage: x = numpy.array([1,2,3,4,5])
+         sage: std(x, bias=False)
+         1.5811388300841898
+@@ -299,7 +299,7 @@ def variance(v, bias=False):
+         0.4897530450000000?
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
+         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
+         sage: variance(x, bias=False)                                                   # needs numpy
+         2.5
+diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
+index cc15eff82e9..e32e7fd28b3 100644
+--- a/src/sage/structure/coerce.pyx
++++ b/src/sage/structure/coerce.pyx
+@@ -521,7 +521,7 @@ cdef class CoercionModel:
+ 
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
+ 
+         sage: # needs sage.rings.real_mpfr
+         sage: x = polygen(RR)
+diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
+index 362d01ea297..92bce28b032 100644
+--- a/src/sage/symbolic/function.pyx
++++ b/src/sage/symbolic/function.pyx
+@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
+ 
+             sage: import numpy                                                          # needs numpy
+             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
+-            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
++            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
+ 
+             sage: sin(numpy.int32(0))                                                   # needs numpy
+             0.0
+diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
+index 32afe8d3a62..63734e68f63 100644
+--- a/src/sage/symbolic/ring.pyx
++++ b/src/sage/symbolic/ring.pyx
+@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
+ 
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
+         sage: f(x) = x^2
+         sage: f(numpy.int8('2'))                                                        # needs numpy
+         4

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

* Re: [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta2
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
  2024-08-20 20:57 ` [PR PATCH] [Updated] " tornaria
  2024-08-21  1:11 ` tornaria
@ 2024-08-22  2:10 ` tornaria
  2024-08-24  4:03 ` tornaria
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-08-22  2:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1465 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/51902

[BETA] sagemath: update to 10.5.beta2
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - python3-gmpy2: update to 2.2.1.
 - python3-cypari2: update to 2.2.0.
 - python3-sympy: update to 1.13.2.
 - sagemath: enable all cython warnings

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From 1825ad833745404dc45dd4a3b82386c30db78513 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 1/7] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From 1f322f47ed3beb3b916289142d680bbe1cb4ea4f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 19 Aug 2024 22:02:54 -0300
Subject: [PATCH 2/7] flintlib: C99 compliance

---
 srcpkgs/flintlib/patches/2027.patch | 322 ++++++++++++++++++++++++++++
 srcpkgs/flintlib/template           |   2 +-
 2 files changed, 323 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/flintlib/patches/2027.patch

diff --git a/srcpkgs/flintlib/patches/2027.patch b/srcpkgs/flintlib/patches/2027.patch
new file mode 100644
index 00000000000000..f17ff31f2754d7
--- /dev/null
+++ b/srcpkgs/flintlib/patches/2027.patch
@@ -0,0 +1,322 @@
+See: https://github.com/flintlib/flint/pull/2027
+
+From 1b93e73d00881be12e04b7f13e070214a3c9e1cc Mon Sep 17 00:00:00 2001
+From: Dima Pasechnik <dima@pasechnik.info>
+Date: Wed, 19 Jun 2024 22:16:34 +0100
+Subject: [PATCH] ensure C99 compliance in headers, as 'I' is reserved
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Note that the following code
+---- cut here: save as t.c
+---- cut here
+
+fails to compile with a suffciently new compiler, e.g. clang 16 or gcc 14.
+
+$ gcc -c t.c
+In file included from t.c:1:
+/usr/include/flint/mpoly.h:1319:43: error: expected ‘)’ before ‘__extension__’
+ 1319 | void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
+      |                                           ^
+In file included from /usr/include/flint/fmpz_types.h:15,
+                 from /usr/include/flint/fmpz_mod_types.h:15,
+                 from /usr/include/flint/mpoly_types.h:15,
+                 from /usr/include/flint/mpoly.h:23,
+                 from t.c:2:
+/usr/include/flint/mpoly.h:1319:46: error: expected ‘;’, ‘,’ or ‘)’ before ‘mp_limb_signed_t’
+ 1319 | void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
+
+...
+---
+ src/fft_small.h             |  6 +++---
+ src/fmpz_mod_mpoly_factor.h |  8 ++++----
+ src/fmpz_mpoly.h            |  2 +-
+ src/fmpz_mpoly_factor.h     | 18 +++++++++---------
+ src/fq_nmod_mpoly_factor.h  |  6 +++---
+ src/fq_zech_mpoly_factor.h  |  6 +++---
+ src/mpoly.h                 | 18 +++++++++---------
+ src/nmod_mpoly.h            |  4 ++--
+ src/nmod_mpoly_factor.h     |  6 +++---
+ 9 files changed, 37 insertions(+), 37 deletions(-)
+
+diff --git a/src/fft_small.h b/src/fft_small.h
+index 3f62f2e988..b7404f196d 100644
+--- a/src/fft_small.h
++++ b/src/fft_small.h
+@@ -242,10 +242,10 @@ FLINT_INLINE double sd_fft_ctx_get_fft_index(double* d, ulong i)
+ }
+ 
+ /* sd_fft.c */
+-void sd_fft_trunc(const sd_fft_lctx_t Q, ulong I, ulong S, ulong k, ulong j, ulong itrunc, ulong otrunc);
++void sd_fft_trunc(const sd_fft_lctx_t Q, ulong Iv, ulong S, ulong k, ulong j, ulong itrunc, ulong otrunc);
+ 
+ /* sd_ifft.c */
+-void sd_ifft_trunc(const sd_fft_lctx_t Q, ulong I, ulong S, ulong k, ulong j, ulong z, ulong n, int f);
++void sd_ifft_trunc(const sd_fft_lctx_t Q, ulong Iv, ulong S, ulong k, ulong j, ulong z, ulong n, int f);
+ 
+ /* sd_fft_ctx.c */
+ void sd_fft_ctx_clear(sd_fft_ctx_t Q);
+@@ -428,7 +428,7 @@ typedef struct {
+ 
+ typedef mpn_ctx_struct mpn_ctx_t[1];
+ 
+-void _convert_block(ulong* Xs, sd_fft_ctx_struct* Rffts, double* d, ulong dstride, ulong np, ulong I);
++void _convert_block(ulong* Xs, sd_fft_ctx_struct* Rffts, double* d, ulong dstride, ulong np, ulong Iv);
+ ulong flint_mpn_nbits(const ulong* a, ulong an);
+ int flint_mpn_cmp_ui_2exp(const ulong* a, ulong an, ulong b, ulong e);
+ unsigned char flint_mpn_add_inplace_c(ulong* z, ulong zn, ulong* a, ulong an, unsigned char cf);
+diff --git a/src/fmpz_mod_mpoly_factor.h b/src/fmpz_mod_mpoly_factor.h
+index 359fdd1e3d..460695dd23 100644
+--- a/src/fmpz_mod_mpoly_factor.h
++++ b/src/fmpz_mod_mpoly_factor.h
+@@ -1203,15 +1203,15 @@ typedef struct {
+ typedef fmpz_mod_mpoly_pfrac_struct fmpz_mod_mpoly_pfrac_t[1];
+ 
+ 
+-int fmpz_mod_mpoly_pfrac_init(fmpz_mod_mpoly_pfrac_t I,
++int fmpz_mod_mpoly_pfrac_init(fmpz_mod_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits, slong l, slong r, const fmpz_mod_mpoly_struct * betas,
+                           const fmpz * alpha, const fmpz_mod_mpoly_ctx_t ctx);
+ 
+-void fmpz_mod_mpoly_pfrac_clear(fmpz_mod_mpoly_pfrac_t I,
++void fmpz_mod_mpoly_pfrac_clear(fmpz_mod_mpoly_pfrac_t Iv,
+                                               const fmpz_mod_mpoly_ctx_t ctx);
+ 
+ int fmpz_mod_mpoly_pfrac(slong r, fmpz_mod_mpoly_t t, const slong * deg,
+-                     fmpz_mod_mpoly_pfrac_t I, const fmpz_mod_mpoly_ctx_t ctx);
++                     fmpz_mod_mpoly_pfrac_t Iv, const fmpz_mod_mpoly_ctx_t ctx);
+ 
+ int fmpz_mod_mpoly_hlift(slong m, fmpz_mod_mpoly_struct * f, slong r,
+             const fmpz * alpha, const fmpz_mod_mpoly_t A, const slong * degs,
+@@ -1290,7 +1290,7 @@ int fmpz_mod_mpolyn_gcd_brown_smprime(
+     fmpz_mod_mpolyn_t B,
+     slong var,
+     const fmpz_mod_mpoly_ctx_t ctx,
+-    const mpoly_gcd_info_t I,
++    const mpoly_gcd_info_t Iv,
+     fmpz_mod_poly_polyun_mpolyn_stack_t St);
+ 
+ int fmpz_mod_mpolyl_gcdp_zippel(
+diff --git a/src/fmpz_mpoly.h b/src/fmpz_mpoly.h
+index b7c9677915..4be3d05c56 100644
+--- a/src/fmpz_mpoly.h
++++ b/src/fmpz_mpoly.h
+@@ -1084,7 +1084,7 @@ void fmpz_mpoly_vec_randtest_not_zero(fmpz_mpoly_vec_t vec, flint_rand_t state,
+ 
+ void fmpz_mpoly_spoly(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_t g, const fmpz_mpoly_ctx_t ctx);
+ void fmpz_mpoly_vec_set_primitive_unique(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+-void fmpz_mpoly_reduction_primitive_part(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_vec_t I, const fmpz_mpoly_ctx_t ctx);
++void fmpz_mpoly_reduction_primitive_part(fmpz_mpoly_t res, const fmpz_mpoly_t f, const fmpz_mpoly_vec_t Iv, const fmpz_mpoly_ctx_t ctx);
+ int fmpz_mpoly_vec_is_groebner(const fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+ void fmpz_mpoly_buchberger_naive(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F, const fmpz_mpoly_ctx_t ctx);
+ int fmpz_mpoly_buchberger_naive_with_limits(fmpz_mpoly_vec_t G, const fmpz_mpoly_vec_t F,
+diff --git a/src/fmpz_mpoly_factor.h b/src/fmpz_mpoly_factor.h
+index 0da7c1052b..a04ef8021e 100644
+--- a/src/fmpz_mpoly_factor.h
++++ b/src/fmpz_mpoly_factor.h
+@@ -298,11 +298,11 @@ void fmpz_mpoly_from_mpolyl_perm_inflate(fmpz_mpoly_t A,
+ 
+ int fmpz_mpolyl_gcd_brown(fmpz_mpoly_t G,
+         fmpz_mpoly_t Abar, fmpz_mpoly_t Bbar, fmpz_mpoly_t A, fmpz_mpoly_t B,
+-                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t I);
++                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv);
+ 
+ int fmpz_mpolyl_gcd_brown_threaded_pool(fmpz_mpoly_t G,
+         fmpz_mpoly_t Abar, fmpz_mpoly_t Bbar, fmpz_mpoly_t A, fmpz_mpoly_t B,
+-                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const fmpz_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                         const thread_pool_handle * handles, slong num_handles);
+ 
+ int fmpz_mpolyl_gcd_zippel(fmpz_mpoly_t G, fmpz_mpoly_t Abar,
+@@ -340,15 +340,15 @@ typedef struct {
+ 
+ typedef fmpz_poly_pfrac_struct fmpz_poly_pfrac_t[1];
+ 
+-void fmpz_poly_pfrac_init(fmpz_poly_pfrac_t I);
++void fmpz_poly_pfrac_init(fmpz_poly_pfrac_t Iv);
+ 
+-void fmpz_poly_pfrac_clear(fmpz_poly_pfrac_t I);
++void fmpz_poly_pfrac_clear(fmpz_poly_pfrac_t Iv);
+ 
+-int fmpz_poly_pfrac_precompute(fmpz_poly_pfrac_t I,
++int fmpz_poly_pfrac_precompute(fmpz_poly_pfrac_t Iv,
+                                           const fmpz_poly_struct * b, slong r);
+ 
+ int fmpz_poly_pfrac_precomp(fmpz_poly_struct * c,
+-                                     const fmpz_poly_t A, fmpz_poly_pfrac_t I);
++                                     const fmpz_poly_t A, fmpz_poly_pfrac_t Iv);
+ 
+ typedef struct {
+     flint_bitcnt_t bits;
+@@ -372,15 +372,15 @@ typedef struct {
+ 
+ typedef fmpz_mpoly_pfrac_struct fmpz_mpoly_pfrac_t[1];
+ 
+-int fmpz_mpoly_pfrac_init(fmpz_mpoly_pfrac_t I, flint_bitcnt_t bits,
++int fmpz_mpoly_pfrac_init(fmpz_mpoly_pfrac_t Iv, flint_bitcnt_t bits,
+                             slong r, slong w, const fmpz_mpoly_struct * betas,
+                                const fmpz * alpha, const fmpz_mpoly_ctx_t ctx);
+ 
+-void fmpz_mpoly_pfrac_clear(fmpz_mpoly_pfrac_t I,
++void fmpz_mpoly_pfrac_clear(fmpz_mpoly_pfrac_t Iv,
+                                                    const fmpz_mpoly_ctx_t ctx);
+ 
+ int fmpz_mpoly_pfrac(slong l, fmpz_mpoly_t t, const slong * degs,
+-                             fmpz_mpoly_pfrac_t I, const fmpz_mpoly_ctx_t ctx);
++                             fmpz_mpoly_pfrac_t Iv, const fmpz_mpoly_ctx_t ctx);
+ 
+ int fmpz_mpoly_hlift(slong m, fmpz_mpoly_struct * f, slong r,
+                 const fmpz * alpha, const fmpz_mpoly_t A, const slong * degs,
+diff --git a/src/fq_nmod_mpoly_factor.h b/src/fq_nmod_mpoly_factor.h
+index 6289d3f1c5..29caa99aa4 100644
+--- a/src/fq_nmod_mpoly_factor.h
++++ b/src/fq_nmod_mpoly_factor.h
+@@ -427,7 +427,7 @@ typedef fq_nmod_mpoly_pfrac_struct fq_nmod_mpoly_pfrac_t[1];
+ 
+ 
+ int fq_nmod_mpoly_pfrac_init(
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits,
+     slong l, slong r,
+     const fq_nmod_mpoly_struct * betas,
+@@ -435,14 +435,14 @@ int fq_nmod_mpoly_pfrac_init(
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ void fq_nmod_mpoly_pfrac_clear(
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ int fq_nmod_mpoly_pfrac(
+     slong r,
+     fq_nmod_mpoly_t t,
+     const slong * deg,
+-    fq_nmod_mpoly_pfrac_t I,
++    fq_nmod_mpoly_pfrac_t Iv,
+     const fq_nmod_mpoly_ctx_t ctx);
+ 
+ int fq_nmod_mpoly_hlift(
+diff --git a/src/fq_zech_mpoly_factor.h b/src/fq_zech_mpoly_factor.h
+index 06f31369f9..3d3c51419f 100644
+--- a/src/fq_zech_mpoly_factor.h
++++ b/src/fq_zech_mpoly_factor.h
+@@ -652,7 +652,7 @@ typedef fq_zech_mpoly_pfrac_struct fq_zech_mpoly_pfrac_t[1];
+ 
+ 
+ int fq_zech_mpoly_pfrac_init(
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     flint_bitcnt_t bits,
+     slong l, slong r,
+     const fq_zech_mpoly_struct * betas,
+@@ -660,14 +660,14 @@ int fq_zech_mpoly_pfrac_init(
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ void fq_zech_mpoly_pfrac_clear(
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ int fq_zech_mpoly_pfrac(
+     slong r,
+     fq_zech_mpoly_t t,
+     const slong * deg,
+-    fq_zech_mpoly_pfrac_t I,
++    fq_zech_mpoly_pfrac_t Iv,
+     const fq_zech_mpoly_ctx_t ctx);
+ 
+ int fq_zech_mpoly_hlift(
+diff --git a/src/mpoly.h b/src/mpoly.h
+index b0950e3a48..fe0ccbe7c4 100644
+--- a/src/mpoly.h
++++ b/src/mpoly.h
+@@ -1363,9 +1363,9 @@ typedef struct
+ 
+ typedef mpoly_gcd_info_struct mpoly_gcd_info_t[1];
+ 
+-void mpoly_gcd_info_init(mpoly_gcd_info_t I, slong nvars);
++void mpoly_gcd_info_init(mpoly_gcd_info_t Iv, slong nvars);
+ 
+-void mpoly_gcd_info_clear(mpoly_gcd_info_t I);
++void mpoly_gcd_info_clear(mpoly_gcd_info_t Iv);
+ 
+ void mpoly_gcd_info_limits(ulong * Amax_exp, ulong * Amin_exp,
+                        slong * Amax_exp_count, slong * Amin_exp_count,
+@@ -1378,25 +1378,25 @@ void mpoly_gcd_info_stride(ulong * strides,
+                              const ulong * Bmax_exp, const ulong * Bmin_exp,
+                                                        const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_set_perm(mpoly_gcd_info_t I,
++void mpoly_gcd_info_set_perm(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-slong mpoly_gcd_info_get_brown_upper_limit(const mpoly_gcd_info_t I,
++slong mpoly_gcd_info_get_brown_upper_limit(const mpoly_gcd_info_t Iv,
+                                                        slong var, slong bound);
+ 
+-void mpoly_gcd_info_measure_hensel(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_hensel(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_brown(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_brown(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_bma(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_bma(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_zippel(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_zippel(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+-void mpoly_gcd_info_measure_zippel2(mpoly_gcd_info_t I,
++void mpoly_gcd_info_measure_zippel2(mpoly_gcd_info_t Iv,
+                          slong Alength, slong Blength, const mpoly_ctx_t mctx);
+ 
+ int mpoly_monomial_cofactors(fmpz * Abarexps, fmpz * Bbarexps,
+diff --git a/src/nmod_mpoly.h b/src/nmod_mpoly.h
+index 2a8136e6eb..716ac9669a 100644
+--- a/src/nmod_mpoly.h
++++ b/src/nmod_mpoly.h
+@@ -1619,13 +1619,13 @@ int nmod_mpolyn_gcd_brown_smprime_bivar(
+ int nmod_mpolyn_gcd_brown_smprime(nmod_mpolyn_t G,
+                                   nmod_mpolyn_t Abar, nmod_mpolyn_t Bbar,
+                                  nmod_mpolyn_t A, nmod_mpolyn_t B, slong var,
+-                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                                                          nmod_poly_stack_t Sp);
+ 
+ int nmod_mpolyn_gcd_brown_smprime_threaded_pool(nmod_mpolyn_t G,
+                                 nmod_mpolyn_t Abar, nmod_mpolyn_t Bbar,
+                                nmod_mpolyn_t A, nmod_mpolyn_t B, slong var,
+-                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t I,
++                         const nmod_mpoly_ctx_t ctx, const mpoly_gcd_info_t Iv,
+                         const thread_pool_handle * handles, slong num_workers);
+ 
+ int nmod_mpolyn_gcd_brown_lgprime(nmod_mpolyn_t G,
+diff --git a/src/nmod_mpoly_factor.h b/src/nmod_mpoly_factor.h
+index a46afc860f..b16c802b9b 100644
+--- a/src/nmod_mpoly_factor.h
++++ b/src/nmod_mpoly_factor.h
+@@ -362,15 +362,15 @@ typedef struct {
+ typedef nmod_mpoly_pfrac_struct nmod_mpoly_pfrac_t[1];
+ 
+ 
+-int nmod_mpoly_pfrac_init(nmod_mpoly_pfrac_t I, flint_bitcnt_t bits,
++int nmod_mpoly_pfrac_init(nmod_mpoly_pfrac_t Iv, flint_bitcnt_t bits,
+                          slong l, slong r, const nmod_mpoly_struct * betas,
+                           const mp_limb_t * alpha, const nmod_mpoly_ctx_t ctx);
+ 
+-void nmod_mpoly_pfrac_clear(nmod_mpoly_pfrac_t I,
++void nmod_mpoly_pfrac_clear(nmod_mpoly_pfrac_t Iv,
+                                                    const nmod_mpoly_ctx_t ctx);
+ 
+ int nmod_mpoly_pfrac(slong r, nmod_mpoly_t t, const slong * deg,
+-                             nmod_mpoly_pfrac_t I, const nmod_mpoly_ctx_t ctx);
++                             nmod_mpoly_pfrac_t Iv, const nmod_mpoly_ctx_t ctx);
+ 
+ int nmod_mpoly_hlift(slong m, nmod_mpoly_struct * f, slong r,
+             const mp_limb_t * alpha, const nmod_mpoly_t A, const slong * degs,
diff --git a/srcpkgs/flintlib/template b/srcpkgs/flintlib/template
index 613391a9a0ae1b..465cdf1d0d3f71 100644
--- a/srcpkgs/flintlib/template
+++ b/srcpkgs/flintlib/template
@@ -1,7 +1,7 @@
 # Template file for 'flintlib'
 pkgname=flintlib
 version=3.1.2
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--prefix=/usr --disable-arch $(vopt_with ntl)
  $(vopt_if openblas --with-blas-include=${XBPS_CROSS_BASE}/usr/include/openblas)"

From bcd8e6b405a9eb73e52a4273f74b1e445e2dffc6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 19 Aug 2024 17:35:53 -0300
Subject: [PATCH 3/7] python3-numpy: update to 2.1.0.

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

diff --git a/srcpkgs/python3-numpy/template b/srcpkgs/python3-numpy/template
index cab4e3e506df30..7d0e493b32c5bb 100644
--- a/srcpkgs/python3-numpy/template
+++ b/srcpkgs/python3-numpy/template
@@ -1,6 +1,6 @@
 # Template file for 'python3-numpy'
 pkgname=python3-numpy
-version=2.0.1
+version=2.1.0
 revision=1
 build_style=python3-pep517
 build_helper="meson qemu"
@@ -19,7 +19,7 @@ license="BSD-3-Clause"
 homepage="https://www.numpy.org/"
 changelog="https://github.com/numpy/numpy/releases"
 distfiles="${PYPI_SITE}/n/numpy/numpy-${version}.tar.gz"
-checksum=485b87235796410c3519a699cfe1faab097e509e90ebb05dcd098db2ae87e7b3
+checksum=7dc90da0081f7e1da49ec4e398ede6a8e9cc4f5ebe5f9e06b443ed889ee9aaa2
 alternatives="numpy:f2py:/usr/bin/f2py3"
 
 build_options="openblas"

From b4542c50776ceb0a1274d38b7e04697470f81a29 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 21 Aug 2024 00:00:46 -0300
Subject: [PATCH 4/7] python3-scipy: update to 1.14.1.

---
 srcpkgs/python3-scipy/template | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/python3-scipy/template b/srcpkgs/python3-scipy/template
index e35cd25b4595c6..00aa693110b985 100644
--- a/srcpkgs/python3-scipy/template
+++ b/srcpkgs/python3-scipy/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-scipy'
 pkgname=python3-scipy
-version=1.14.0
-revision=2
+version=1.14.1
+revision=1
 build_style=python3-pep517
 build_helper="meson numpy"
 # SciPy imposes strict and unnecessary restrictions on build dependencies
@@ -19,8 +19,9 @@ short_desc="Scientific library for Python3"
 maintainer="Andrew J. Hesford <ajh@sideband.org>"
 license="BSD-3-Clause"
 homepage="https://scipy.org/"
+changelog="https://github.com/scipy/scipy/releases"
 distfiles="${PYPI_SITE}/s/scipy/scipy-${version}.tar.gz"
-checksum=b5923f48cb840380f9854339176ef21763118a7300a88203ccd0bdd26e58527b
+checksum=5a275584e726026a5699459aa72f828a610821006228e841b94275c4a7c08417
 # must be tested from site dir of installed version (see dev.py:739)
 make_check_pre='eval env -C "${testdir}/${py3_sitelib}"'
 

From 4b37959f5e5083977b44f6e598d17cf4b4438784 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 5/7] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   8 +-
 6 files changed, 22 insertions(+), 670 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index befe33a0188687..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=2
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -25,14 +25,14 @@ depends="eclib-devel fflas-ffpack flintlib-devel gcc-fortran meson gd-devel
  python3-sympy python3-traitlets sage-data-combinatorial_designs
  python3-conway-polynomials sage-data-elliptic_curves sage-data-graphs
  sage-data-polytopes_db sympow tachyon threejs-sage"
-checkdepends="$depends pythran python3-Sphinx gdb"
+checkdepends="$depends python3-pytest pythran python3-Sphinx gdb"
 short_desc="Open source mathematics software"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 69c04f99d3fa1bae9c234e3a161e4dba41ec275e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 6/7] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

From 7b24a6d2d50891008f6ffa4e4ca5b1de276e1a7f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 20 Aug 2024 17:56:06 -0300
Subject: [PATCH 7/7] sagemath: patch for numpy 2.1

---
 srcpkgs/sagemath/patches/numpy_2.1a.patch |  28 +++
 srcpkgs/sagemath/patches/numpy_2.1b.patch | 229 ++++++++++++++++++++++
 2 files changed, 257 insertions(+)
 create mode 100644 srcpkgs/sagemath/patches/numpy_2.1a.patch
 create mode 100644 srcpkgs/sagemath/patches/numpy_2.1b.patch

diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
new file mode 100644
index 00000000000000..493c75e2f8f8e0
--- /dev/null
+++ b/srcpkgs/sagemath/patches/numpy_2.1a.patch
@@ -0,0 +1,28 @@
+commit d755b32cbed462abf01a1cd782ba57cb92fbf713
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Mon Aug 19 23:25:32 2024 -0300
+
+    add copy parameter to numpy (needed for v2.1)
+
+diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
+index 3edb9ead54d..2c76fd1e557 100644
+--- a/src/sage/matrix/matrix1.pyx
++++ b/src/sage/matrix/matrix1.pyx
+@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
+             entries = [[sib(v, 2) for v in row] for row in self.rows()]
+             return sib.name('matrix')(self.base_ring(), entries)
+ 
+-    def numpy(self, dtype=None):
++    def numpy(self, dtype=None, copy=True):
+         """
+         Return the Numpy matrix associated to this matrix.
+ 
+@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
+             (3, 4)
+         """
+         import numpy
+-        A = numpy.matrix(self.list(), dtype=dtype)
++        A = numpy.matrix(self.list(), dtype=dtype, copy=copy)
+         return numpy.resize(A,(self.nrows(), self.ncols()))
+ 
+     # Define the magic "__array__" function so that numpy.array(m) can convert
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
new file mode 100644
index 00000000000000..8dc0eec2b5a9d8
--- /dev/null
+++ b/srcpkgs/sagemath/patches/numpy_2.1b.patch
@@ -0,0 +1,229 @@
+commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
+Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
+Date:   Tue Aug 20 00:05:33 2024 -0300
+
+    silence np.set_printoptions (for numpy 2.1)
+
+diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
+index 74a14fa1ecd..82e6c7eb3c8 100644
+--- a/src/sage/combinat/fully_packed_loop.py
++++ b/src/sage/combinat/fully_packed_loop.py
+@@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
+ 
+         sage: import numpy as np
+         sage: if int(np.version.short_version[0]) > 1:
+-        ....:     np.set_printoptions(legacy="1.25")
++        ....:     _token = np.set_printoptions(legacy="1.25")
+         sage: from sage.combinat.fully_packed_loop import _make_color_list
+         sage: _make_color_list(5)
+         sage: _make_color_list(5, ['blue', 'red'])
+diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
+index 308171af3cd..6f66624ef87 100644
+--- a/src/sage/functions/special.py
++++ b/src/sage/functions/special.py
+@@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
+         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
+         sage: import numpy as np                                                        # needs scipy
+         sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
+-        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
++        ....:     _token = np.set_printoptions(legacy="1.25")                           # needs scipy
+         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
+         (0.3454941494713355-4.231083042742082e-17j)
+ 
+diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
+index b3e42a6a6a2..13ffa4d1789 100644
+--- a/src/sage/numerical/optimize.py
++++ b/src/sage/numerical/optimize.py
+@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
+         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
+         sage: import numpy
+         sage: if int(numpy.version.short_version[0]) > 1:
+-        ....:     numpy.set_printoptions(legacy="1.25")
++        ....:     _token = numpy.set_printoptions(legacy="1.25")
+         sage: from numpy import zeros
+         sage: def rosen_der(x):
+         ....:    xm = x[1r:-1r]
+diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
+index 02442f90ba4..1fe3f0b051a 100644
+--- a/src/sage/plot/arrow.py
++++ b/src/sage/plot/arrow.py
+@@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
+ 
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: from sage.plot.arrow import CurveArrow
+             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
+             ....:                options={})
+diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
+index d2f70b44526..2eaacc6879e 100644
+--- a/src/sage/plot/multigraphics.py
++++ b/src/sage/plot/multigraphics.py
+@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
+             (0.2, 0.3, 0.4, 0.1)
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: ax1.get_position().bounds  # tol 1.0e-13
+             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
+         """
+@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
+             sage: G = graphics_array([g1, g2])
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: G.position(0)  # tol 5.0e-3
+             (0.025045451349937315,
+              0.03415488992713045,
+diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
+index b69a05b37bf..25e404bfc7d 100644
+--- a/src/sage/plot/streamline_plot.py
++++ b/src/sage/plot/streamline_plot.py
+@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
+             sage: x, y = var('x y')
+             sage: import numpy  # to ensure numpy 2.0 compatibility
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
+             sage: d['xmin']
+             10.0
+diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
+index 11811b9587f..8ce0f7f2683 100644
+--- a/src/sage/rings/integer.pyx
++++ b/src/sage/rings/integer.pyx
+@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+             sage: # needs numpy
+             sage: import numpy
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: numpy.int8('12') == 12
+             True
+             sage: 12 == numpy.int8('12')
+diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
+index 11953a50ab5..6aafcceed89 100644
+--- a/src/sage/rings/real_mpfi.pyx
++++ b/src/sage/rings/real_mpfi.pyx
+@@ -232,7 +232,7 @@ TESTS::
+ 
+     sage: import numpy                                                                  # needs numpy
+     sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
+-    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
++    ....:     _token = numpy.set_printoptions(legacy="1.25")                            # needs numpy
+     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
+     True
+     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
+diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
+index 40b92ab23eb..3838bcccb8a 100755
+--- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
++++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
+@@ -78,7 +78,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
+@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((10, 10))
+             sage: data[1:4,1:4] = True
+@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: data[1,1] = True
+@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+ 
+             sage: data = np.zeros((20, 20))
+@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
+ 
+             sage: import numpy as np
+             sage: if int(np.version.short_version[0]) > 1:
+-            ....:     np.set_printoptions(legacy="1.25")
++            ....:     _token = np.set_printoptions(legacy="1.25")
+             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
+             sage: data = np.zeros((4, 4))
+             sage: data[1, 1] = True
+diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
+index 47d890cf0ab..ba7f0cdb0f9 100644
+--- a/src/sage/stats/basic_stats.py
++++ b/src/sage/stats/basic_stats.py
+@@ -222,7 +222,7 @@ def std(v, bias=False):
+         sage: # needs numpy
+         sage: import numpy
+         sage: if int(numpy.version.short_version[0]) > 1:
+-        ....:     numpy.set_printoptions(legacy="1.25")
++        ....:     _token = numpy.set_printoptions(legacy="1.25")
+         sage: x = numpy.array([1,2,3,4,5])
+         sage: std(x, bias=False)
+         1.5811388300841898
+@@ -299,7 +299,7 @@ def variance(v, bias=False):
+         0.4897530450000000?
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
+         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
+         sage: variance(x, bias=False)                                                   # needs numpy
+         2.5
+diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
+index cc15eff82e9..e32e7fd28b3 100644
+--- a/src/sage/structure/coerce.pyx
++++ b/src/sage/structure/coerce.pyx
+@@ -521,7 +521,7 @@ cdef class CoercionModel:
+ 
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
+ 
+         sage: # needs sage.rings.real_mpfr
+         sage: x = polygen(RR)
+diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
+index 362d01ea297..92bce28b032 100644
+--- a/src/sage/symbolic/function.pyx
++++ b/src/sage/symbolic/function.pyx
+@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
+ 
+             sage: import numpy                                                          # needs numpy
+             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
+-            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
++            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
+ 
+             sage: sin(numpy.int32(0))                                                   # needs numpy
+             0.0
+diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
+index 32afe8d3a62..63734e68f63 100644
+--- a/src/sage/symbolic/ring.pyx
++++ b/src/sage/symbolic/ring.pyx
+@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
+ 
+         sage: import numpy                                                              # needs numpy
+         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
+-        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
++        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
+         sage: f(x) = x^2
+         sage: f(numpy.int8('2'))                                                        # needs numpy
+         4

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

* Re: [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta2
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
                   ` (2 preceding siblings ...)
  2024-08-22  2:10 ` tornaria
@ 2024-08-24  4:03 ` tornaria
  2024-09-08 16:10 ` tornaria
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-08-24  4:03 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1465 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/51902

[BETA] sagemath: update to 10.5.beta2
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - python3-gmpy2: update to 2.2.1.
 - python3-cypari2: update to 2.2.0.
 - python3-sympy: update to 1.13.2.
 - sagemath: enable all cython warnings

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From 5552d7472e2439f30f5150fd6f43a7e7702cfc80 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 1/4] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From 84dfd2776f3b306beaabf613896707ba1886679d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 2/4] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   6 +-
 6 files changed, 21 insertions(+), 669 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index b116e62bc67a5a..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=3
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From de0157b766efbd205f9f0a53294951959bd11015 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 3/4] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

From 377d7d959c52b13b6873c45b7350aecd172fffa1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 20 Aug 2024 17:56:06 -0300
Subject: [PATCH 4/4] sagemath: patch for numpy 2.1

---
 srcpkgs/sagemath/patches/numpy_2.1a.patch |  8 +--
 srcpkgs/sagemath/patches/numpy_2.1b.patch | 70 +++++++++++------------
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
index 30e2de99d84536..493c75e2f8f8e0 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1a.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1a.patch
@@ -1,14 +1,14 @@
-commit 241dc39bd0ba1c056f88bee46a0345d59093eaff
+commit d755b32cbed462abf01a1cd782ba57cb92fbf713
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Mon Aug 19 23:25:32 2024 -0300
 
     add copy parameter to numpy (needed for v2.1)
 
 diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index c38df5412f0..f587cef651a 100644
+index 3edb9ead54d..2c76fd1e557 100644
 --- a/src/sage/matrix/matrix1.pyx
 +++ b/src/sage/matrix/matrix1.pyx
-@@ -671,7 +671,7 @@ cdef class Matrix(Matrix0):
+@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
              entries = [[sib(v, 2) for v in row] for row in self.rows()]
              return sib.name('matrix')(self.base_ring(), entries)
  
@@ -17,7 +17,7 @@ index c38df5412f0..f587cef651a 100644
          """
          Return the Numpy matrix associated to this matrix.
  
-@@ -732,7 +732,7 @@ cdef class Matrix(Matrix0):
+@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
              (3, 4)
          """
          import numpy
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
index b77e28361d2e74..8dc0eec2b5a9d8 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1b.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1b.patch
@@ -1,11 +1,11 @@
-commit 8b32fdb87725c1d67ffb51dadec1c331c7c35f3c
+commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Tue Aug 20 00:05:33 2024 -0300
 
     silence np.set_printoptions (for numpy 2.1)
 
 diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b3ebd206cd2..48866824224 100644
+index 74a14fa1ecd..82e6c7eb3c8 100644
 --- a/src/sage/combinat/fully_packed_loop.py
 +++ b/src/sage/combinat/fully_packed_loop.py
 @@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
@@ -18,7 +18,7 @@ index b3ebd206cd2..48866824224 100644
          sage: _make_color_list(5)
          sage: _make_color_list(5, ['blue', 'red'])
 diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index 2a03bb68f67..30b56722e66 100644
+index 308171af3cd..6f66624ef87 100644
 --- a/src/sage/functions/special.py
 +++ b/src/sage/functions/special.py
 @@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
@@ -31,10 +31,10 @@ index 2a03bb68f67..30b56722e66 100644
          (0.3454941494713355-4.231083042742082e-17j)
  
 diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index 7ae8ca4966f..4cba22efdba 100644
+index b3e42a6a6a2..13ffa4d1789 100644
 --- a/src/sage/numerical/optimize.py
 +++ b/src/sage/numerical/optimize.py
-@@ -385,7 +385,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
+@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
          ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -44,7 +44,7 @@ index 7ae8ca4966f..4cba22efdba 100644
          sage: def rosen_der(x):
          ....:    xm = x[1r:-1r]
 diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index 23e2517ca56..7375dcd5d1c 100644
+index 02442f90ba4..1fe3f0b051a 100644
 --- a/src/sage/plot/arrow.py
 +++ b/src/sage/plot/arrow.py
 @@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
@@ -57,10 +57,10 @@ index 23e2517ca56..7375dcd5d1c 100644
              sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
              ....:                options={})
 diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 6be448f1e04..004594b77c4 100644
+index d2f70b44526..2eaacc6879e 100644
 --- a/src/sage/plot/multigraphics.py
 +++ b/src/sage/plot/multigraphics.py
-@@ -786,7 +786,7 @@ class MultiGraphics(WithEqualityById, SageObject):
+@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
              (0.2, 0.3, 0.4, 0.1)
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -68,8 +68,8 @@ index 6be448f1e04..004594b77c4 100644
 +            ....:     _token = numpy.set_printoptions(legacy="1.25")
              sage: ax1.get_position().bounds  # tol 1.0e-13
              (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1300,7 +1300,7 @@ class GraphicsArray(MultiGraphics):
+         """
+@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
              sage: G = graphics_array([g1, g2])
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -79,10 +79,10 @@ index 6be448f1e04..004594b77c4 100644
              (0.025045451349937315,
               0.03415488992713045,
 diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index d2cb11088c7..6d88517cc15 100644
+index b69a05b37bf..25e404bfc7d 100644
 --- a/src/sage/plot/streamline_plot.py
 +++ b/src/sage/plot/streamline_plot.py
-@@ -73,7 +73,7 @@ class StreamlinePlot(GraphicPrimitive):
+@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
              sage: x, y = var('x y')
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -92,20 +92,20 @@ index d2cb11088c7..6d88517cc15 100644
              sage: d['xmin']
              10.0
 diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 38c30f7627b..cfb8a5ff5f7 100644
+index 11811b9587f..8ce0f7f2683 100644
 --- a/src/sage/rings/integer.pyx
 +++ b/src/sage/rings/integer.pyx
-@@ -594,7 +594,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
- 
-             sage: import numpy                                                          # needs numpy
-             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
--            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
+@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+             sage: # needs numpy
+             sage: import numpy
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: numpy.int8('12') == 12
              True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
+             sage: 12 == numpy.int8('12')
 diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 76fbfedab95..57de30c9d18 100644
+index 11953a50ab5..6aafcceed89 100644
 --- a/src/sage/rings/real_mpfi.pyx
 +++ b/src/sage/rings/real_mpfi.pyx
 @@ -232,7 +232,7 @@ TESTS::
@@ -118,7 +118,7 @@ index 76fbfedab95..57de30c9d18 100644
      True
      sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
 diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 70ce616f92f..f604c6d3785 100644
+index 40b92ab23eb..3838bcccb8a 100755
 --- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 +++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 @@ -78,7 +78,7 @@ cdef class PeriodicRegion:
@@ -130,7 +130,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -298,7 +298,7 @@ cdef class PeriodicRegion:
+@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -139,7 +139,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((10, 10))
              sage: data[1:4,1:4] = True
-@@ -322,7 +322,7 @@ cdef class PeriodicRegion:
+@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -148,7 +148,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: data[1,1] = True
-@@ -377,7 +377,7 @@ cdef class PeriodicRegion:
+@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -157,7 +157,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
  
              sage: data = np.zeros((20, 20))
-@@ -529,7 +529,7 @@ cdef class PeriodicRegion:
+@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -167,10 +167,10 @@ index 70ce616f92f..f604c6d3785 100644
              sage: data = np.zeros((4, 4))
              sage: data[1, 1] = True
 diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index 6937f6cb410..fb296e00fb6 100644
+index 47d890cf0ab..ba7f0cdb0f9 100644
 --- a/src/sage/stats/basic_stats.py
 +++ b/src/sage/stats/basic_stats.py
-@@ -228,7 +228,7 @@ def std(v, bias=False):
+@@ -222,7 +222,7 @@ def std(v, bias=False):
          sage: # needs numpy
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -179,7 +179,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: x = numpy.array([1,2,3,4,5])
          sage: std(x, bias=False)
          1.5811388300841898
-@@ -307,7 +307,7 @@ def variance(v, bias=False):
+@@ -299,7 +299,7 @@ def variance(v, bias=False):
          0.4897530450000000?
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
@@ -189,7 +189,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: variance(x, bias=False)                                                   # needs numpy
          2.5
 diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index 955a256e9b4..e5ed6160b79 100644
+index cc15eff82e9..e32e7fd28b3 100644
 --- a/src/sage/structure/coerce.pyx
 +++ b/src/sage/structure/coerce.pyx
 @@ -521,7 +521,7 @@ cdef class CoercionModel:
@@ -202,10 +202,10 @@ index 955a256e9b4..e5ed6160b79 100644
          sage: # needs sage.rings.real_mpfr
          sage: x = polygen(RR)
 diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index cd89ad2a256..6fdf6d8ef23 100644
+index 362d01ea297..92bce28b032 100644
 --- a/src/sage/symbolic/function.pyx
 +++ b/src/sage/symbolic/function.pyx
-@@ -965,7 +965,7 @@ cdef class BuiltinFunction(Function):
+@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
  
              sage: import numpy                                                          # needs numpy
              sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
@@ -215,10 +215,10 @@ index cd89ad2a256..6fdf6d8ef23 100644
              sage: sin(numpy.int32(0))                                                   # needs numpy
              0.0
 diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 5b007d9e5fd..4a096d317e7 100644
+index 32afe8d3a62..63734e68f63 100644
 --- a/src/sage/symbolic/ring.pyx
 +++ b/src/sage/symbolic/ring.pyx
-@@ -1163,7 +1163,7 @@ cdef class NumpyToSRMorphism(Morphism):
+@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
  
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy

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

* Re: [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta2
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
                   ` (3 preceding siblings ...)
  2024-08-24  4:03 ` tornaria
@ 2024-09-08 16:10 ` tornaria
  2024-09-09  1:13 ` [BETA] sagemath: update to 10.5.beta3 dkwo
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-09-08 16:10 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1465 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/51902

[BETA] sagemath: update to 10.5.beta2
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - python3-gmpy2: update to 2.2.1.
 - python3-cypari2: update to 2.2.0.
 - python3-sympy: update to 1.13.2.
 - sagemath: enable all cython warnings

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From 026f7e0ddb57ddb60467a26e256ab961f5e49c96 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 1/6] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From 05ecf46ead5f27871a9b1ac7afbd972c93589e93 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 2/6] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   6 +-
 6 files changed, 21 insertions(+), 669 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index b116e62bc67a5a..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=3
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 9652567cec7902789934a0749377271355c1027c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 3/6] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

From 61f8cb5b9f6605b6c48ec6ddfca82eab809f3ced Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 20 Aug 2024 17:56:06 -0300
Subject: [PATCH 4/6] sagemath: patch for numpy 2.1

---
 srcpkgs/sagemath/patches/numpy_2.1a.patch |  8 +--
 srcpkgs/sagemath/patches/numpy_2.1b.patch | 70 +++++++++++------------
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
index 30e2de99d84536..493c75e2f8f8e0 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1a.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1a.patch
@@ -1,14 +1,14 @@
-commit 241dc39bd0ba1c056f88bee46a0345d59093eaff
+commit d755b32cbed462abf01a1cd782ba57cb92fbf713
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Mon Aug 19 23:25:32 2024 -0300
 
     add copy parameter to numpy (needed for v2.1)
 
 diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index c38df5412f0..f587cef651a 100644
+index 3edb9ead54d..2c76fd1e557 100644
 --- a/src/sage/matrix/matrix1.pyx
 +++ b/src/sage/matrix/matrix1.pyx
-@@ -671,7 +671,7 @@ cdef class Matrix(Matrix0):
+@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
              entries = [[sib(v, 2) for v in row] for row in self.rows()]
              return sib.name('matrix')(self.base_ring(), entries)
  
@@ -17,7 +17,7 @@ index c38df5412f0..f587cef651a 100644
          """
          Return the Numpy matrix associated to this matrix.
  
-@@ -732,7 +732,7 @@ cdef class Matrix(Matrix0):
+@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
              (3, 4)
          """
          import numpy
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
index b77e28361d2e74..8dc0eec2b5a9d8 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1b.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1b.patch
@@ -1,11 +1,11 @@
-commit 8b32fdb87725c1d67ffb51dadec1c331c7c35f3c
+commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Tue Aug 20 00:05:33 2024 -0300
 
     silence np.set_printoptions (for numpy 2.1)
 
 diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b3ebd206cd2..48866824224 100644
+index 74a14fa1ecd..82e6c7eb3c8 100644
 --- a/src/sage/combinat/fully_packed_loop.py
 +++ b/src/sage/combinat/fully_packed_loop.py
 @@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
@@ -18,7 +18,7 @@ index b3ebd206cd2..48866824224 100644
          sage: _make_color_list(5)
          sage: _make_color_list(5, ['blue', 'red'])
 diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index 2a03bb68f67..30b56722e66 100644
+index 308171af3cd..6f66624ef87 100644
 --- a/src/sage/functions/special.py
 +++ b/src/sage/functions/special.py
 @@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
@@ -31,10 +31,10 @@ index 2a03bb68f67..30b56722e66 100644
          (0.3454941494713355-4.231083042742082e-17j)
  
 diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index 7ae8ca4966f..4cba22efdba 100644
+index b3e42a6a6a2..13ffa4d1789 100644
 --- a/src/sage/numerical/optimize.py
 +++ b/src/sage/numerical/optimize.py
-@@ -385,7 +385,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
+@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
          ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -44,7 +44,7 @@ index 7ae8ca4966f..4cba22efdba 100644
          sage: def rosen_der(x):
          ....:    xm = x[1r:-1r]
 diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index 23e2517ca56..7375dcd5d1c 100644
+index 02442f90ba4..1fe3f0b051a 100644
 --- a/src/sage/plot/arrow.py
 +++ b/src/sage/plot/arrow.py
 @@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
@@ -57,10 +57,10 @@ index 23e2517ca56..7375dcd5d1c 100644
              sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
              ....:                options={})
 diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 6be448f1e04..004594b77c4 100644
+index d2f70b44526..2eaacc6879e 100644
 --- a/src/sage/plot/multigraphics.py
 +++ b/src/sage/plot/multigraphics.py
-@@ -786,7 +786,7 @@ class MultiGraphics(WithEqualityById, SageObject):
+@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
              (0.2, 0.3, 0.4, 0.1)
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -68,8 +68,8 @@ index 6be448f1e04..004594b77c4 100644
 +            ....:     _token = numpy.set_printoptions(legacy="1.25")
              sage: ax1.get_position().bounds  # tol 1.0e-13
              (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1300,7 +1300,7 @@ class GraphicsArray(MultiGraphics):
+         """
+@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
              sage: G = graphics_array([g1, g2])
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -79,10 +79,10 @@ index 6be448f1e04..004594b77c4 100644
              (0.025045451349937315,
               0.03415488992713045,
 diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index d2cb11088c7..6d88517cc15 100644
+index b69a05b37bf..25e404bfc7d 100644
 --- a/src/sage/plot/streamline_plot.py
 +++ b/src/sage/plot/streamline_plot.py
-@@ -73,7 +73,7 @@ class StreamlinePlot(GraphicPrimitive):
+@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
              sage: x, y = var('x y')
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -92,20 +92,20 @@ index d2cb11088c7..6d88517cc15 100644
              sage: d['xmin']
              10.0
 diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 38c30f7627b..cfb8a5ff5f7 100644
+index 11811b9587f..8ce0f7f2683 100644
 --- a/src/sage/rings/integer.pyx
 +++ b/src/sage/rings/integer.pyx
-@@ -594,7 +594,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
- 
-             sage: import numpy                                                          # needs numpy
-             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
--            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
+@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+             sage: # needs numpy
+             sage: import numpy
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: numpy.int8('12') == 12
              True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
+             sage: 12 == numpy.int8('12')
 diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 76fbfedab95..57de30c9d18 100644
+index 11953a50ab5..6aafcceed89 100644
 --- a/src/sage/rings/real_mpfi.pyx
 +++ b/src/sage/rings/real_mpfi.pyx
 @@ -232,7 +232,7 @@ TESTS::
@@ -118,7 +118,7 @@ index 76fbfedab95..57de30c9d18 100644
      True
      sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
 diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 70ce616f92f..f604c6d3785 100644
+index 40b92ab23eb..3838bcccb8a 100755
 --- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 +++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 @@ -78,7 +78,7 @@ cdef class PeriodicRegion:
@@ -130,7 +130,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -298,7 +298,7 @@ cdef class PeriodicRegion:
+@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -139,7 +139,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((10, 10))
              sage: data[1:4,1:4] = True
-@@ -322,7 +322,7 @@ cdef class PeriodicRegion:
+@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -148,7 +148,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: data[1,1] = True
-@@ -377,7 +377,7 @@ cdef class PeriodicRegion:
+@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -157,7 +157,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
  
              sage: data = np.zeros((20, 20))
-@@ -529,7 +529,7 @@ cdef class PeriodicRegion:
+@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -167,10 +167,10 @@ index 70ce616f92f..f604c6d3785 100644
              sage: data = np.zeros((4, 4))
              sage: data[1, 1] = True
 diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index 6937f6cb410..fb296e00fb6 100644
+index 47d890cf0ab..ba7f0cdb0f9 100644
 --- a/src/sage/stats/basic_stats.py
 +++ b/src/sage/stats/basic_stats.py
-@@ -228,7 +228,7 @@ def std(v, bias=False):
+@@ -222,7 +222,7 @@ def std(v, bias=False):
          sage: # needs numpy
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -179,7 +179,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: x = numpy.array([1,2,3,4,5])
          sage: std(x, bias=False)
          1.5811388300841898
-@@ -307,7 +307,7 @@ def variance(v, bias=False):
+@@ -299,7 +299,7 @@ def variance(v, bias=False):
          0.4897530450000000?
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
@@ -189,7 +189,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: variance(x, bias=False)                                                   # needs numpy
          2.5
 diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index 955a256e9b4..e5ed6160b79 100644
+index cc15eff82e9..e32e7fd28b3 100644
 --- a/src/sage/structure/coerce.pyx
 +++ b/src/sage/structure/coerce.pyx
 @@ -521,7 +521,7 @@ cdef class CoercionModel:
@@ -202,10 +202,10 @@ index 955a256e9b4..e5ed6160b79 100644
          sage: # needs sage.rings.real_mpfr
          sage: x = polygen(RR)
 diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index cd89ad2a256..6fdf6d8ef23 100644
+index 362d01ea297..92bce28b032 100644
 --- a/src/sage/symbolic/function.pyx
 +++ b/src/sage/symbolic/function.pyx
-@@ -965,7 +965,7 @@ cdef class BuiltinFunction(Function):
+@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
  
              sage: import numpy                                                          # needs numpy
              sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
@@ -215,10 +215,10 @@ index cd89ad2a256..6fdf6d8ef23 100644
              sage: sin(numpy.int32(0))                                                   # needs numpy
              0.0
 diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 5b007d9e5fd..4a096d317e7 100644
+index 32afe8d3a62..63734e68f63 100644
 --- a/src/sage/symbolic/ring.pyx
 +++ b/src/sage/symbolic/ring.pyx
-@@ -1163,7 +1163,7 @@ cdef class NumpyToSRMorphism(Morphism):
+@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
  
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy

From 684281e3c47dd422cd38271872a639ace5f4cc7c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 8 Sep 2024 09:35:16 -0300
Subject: [PATCH 5/6] nauty: update to 2.8.9.

---
 srcpkgs/nauty/patches/fix-runalltests.patch | 11 +++++++++++
 srcpkgs/nauty/template                      |  7 ++++---
 2 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/nauty/patches/fix-runalltests.patch

diff --git a/srcpkgs/nauty/patches/fix-runalltests.patch b/srcpkgs/nauty/patches/fix-runalltests.patch
new file mode 100644
index 00000000000000..34e1692cf6e6e3
--- /dev/null
+++ b/srcpkgs/nauty/patches/fix-runalltests.patch
@@ -0,0 +1,11 @@
+--- a/runalltests.in	2024-08-26 00:55:55.000000000 -0300
++++ b/runalltests.in	2024-09-08 09:30:04.032719770 -0300
+@@ -121,7 +121,7 @@
+ runonetest "./geng -q -TD6 10 | ./ransubg -qS765 -P9/10 | ./countg --NN,A,G,GG" "" nautestv.ans
+ runonetest "./genrang -q -P3 -S1234 70 1000 | ./countg --G,GG" "" nautestw.ans
+ runonetest "./genrang -q -P4 -z -S1234 70 500 | ./countg --G,GG" "" nautestx.ans
+-runonetest "./geng -q -bT 12 | ./ranlabg -qS7654 -m5 | uniqg -u" "" nautesty.ans
++runonetest "./geng -q -bT 12 | ./ranlabg -qS7654 -m5 | ./uniqg -u" "" nautesty.ans
+ 
+ echo " "
+ 
diff --git a/srcpkgs/nauty/template b/srcpkgs/nauty/template
index 6f85b1d064d4e5..aea4e4a6eb0294 100644
--- a/srcpkgs/nauty/template
+++ b/srcpkgs/nauty/template
@@ -1,18 +1,18 @@
 # Template file for 'nauty'
 pkgname=nauty
-version=2.8.8
+version=2.8.9
 revision=1
 build_style=gnu-configure
 make_install_args="includedir=/usr/include/nauty
  pkgconfigexecdir=/usr/lib/pkgconfig"
-hostmakedepends="automake"
+hostmakedepends="automake libtool"
 short_desc="Compute the automorphism groups of graphs and digraphs"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="Apache-2.0"
 homepage="https://pallini.di.uniroma1.it/"
 changelog="https://pallini.di.uniroma1.it/changes24-28.txt"
 distfiles="https://pallini.di.uniroma1.it/nauty${version//./_}.tar.gz"
-checksum=159d2156810a6bb240410cd61eb641add85088d9f15c888cdaa37b8681f929ce
+checksum=c97ab42bf48796a86a598bce3e9269047ca2b32c14fc23e07208a244fe52c4ee
 
 build_options="native_build"
 
@@ -21,6 +21,7 @@ if [ -z "$build_option_native_build" ]; then
 fi
 
 pre_configure() {
+	aclocal
 	autoreconf -fi
 }
 

From 2a81fcf283a9514c99342ed1ca93e8bbdc2a8b3d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 7 Sep 2024 14:32:41 -0300
Subject: [PATCH 6/6] sagemath: update to 10.5.beta3.

---
 .../sagemath/patches/36641-sympy_1.13.patch   | 60 -------------------
 .../sagemath/patches/38572-nauty_2.8.9.patch  | 13 ++++
 srcpkgs/sagemath/patches/get_patches          |  4 +-
 srcpkgs/sagemath/template                     |  4 +-
 4 files changed, 17 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/36641-sympy_1.13.patch
 create mode 100644 srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
deleted file mode 100644
index 01e859ad023f4d..00000000000000
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 823a0d14a41..de1c8531814 100644
---- a/src/sage/doctest/forker.py
-+++ b/src/sage/doctest/forker.py
-@@ -150,14 +150,15 @@ def init_sage(controller=None):
-         sage: from sympy.printing.pretty.pretty import PrettyPrinter
-         sage: s = sympify('+x^'.join(str(i) for i in range(30)))
-         sage: print(PrettyPrinter(settings={'wrap_line': True}).doprint(s))
--         29    28    27    26    25    24    23    22    21    20    19    18    17
--        x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   +
-+         29    28    27    26    25    24    23    22    21    20    19    18    17    ↪
-+        x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   +  ↪
-         <BLANKLINE>
--         16    15    14    13    12    11    10    9    8    7    6    5    4    3
--        x   + x   + x   + x   + x   + x   + x   + x  + x  + x  + x  + x  + x  + x  + x
-+        ↪  16    15    14    13    12    11    10    9    8    7    6    5    4    3   ↪
-+        ↪ x   + x   + x   + x   + x   + x   + x   + x  + x  + x  + x  + x  + x  + x  + ↪
-         <BLANKLINE>
--        2
--          + x
-+        ↪   2
-+        ↪  x  + x
-+
- 
-     The displayhook sorts dictionary keys to simplify doctesting of
-     dictionary output::
-diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index ade7836b310..eb5c6665c0d 100644
---- a/src/sage/functions/hypergeometric.py
-+++ b/src/sage/functions/hypergeometric.py
-@@ -124,7 +124,7 @@
-     sage: maxima(hypergeometric([1, 1, 1], [3, 3, 3], x))                               # needs sage.symbolic
-     hypergeometric([1,1,1],[3,3,3],_SAGE_VAR_x)
-     sage: hypergeometric((5, 4), (4, 4), 3)._sympy_()                                   # needs sympy sage.symbolic
--    hyper((5, 4), (4, 4), 3)
-+    hyper((5,), (4,), 3)
-     sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
-     'HypergeometricPFQ[{5,4},{4,4},3]'
- 
-diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 83d92af8959..e470e2bd88d 100644
---- a/src/sage/typeset/ascii_art.py
-+++ b/src/sage/typeset/ascii_art.py
-@@ -44,11 +44,12 @@
-     sage: shell.run_cell('%display ascii_art')
-     sage: shell.run_cell("i = var('i')")                                                # needs sage.symbolic
-     sage: shell.run_cell('sum(factorial(i)*x^i, i, 0, 10)')                             # needs sage.symbolic
--             10           9          8         7        6        5       4      3
--    3628800*x   + 362880*x  + 40320*x  + 5040*x  + 720*x  + 120*x  + 24*x  + 6*x
-+             10           9          8         7        6        5       4      3  >
-+    3628800*x   + 362880*x  + 40320*x  + 5040*x  + 720*x  + 120*x  + 24*x  + 6*x   >
-     <BLANKLINE>
--         2
--    + 2*x  + x + 1
-+    >      2
-+    > + 2*x  + x + 1
-+
-     sage: shell.run_cell('3/(7*x)')                                                     # needs sage.symbolic
-      3
-     ---
diff --git a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
new file mode 100644
index 00000000000000..5f75a8bef5556a
--- /dev/null
+++ b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
@@ -0,0 +1,13 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index e6e5312b8a8..aa10d15d4d8 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3710,7 +3710,7 @@ def nauty_gentreeg(options='', debug=False):
+         ...
+         ValueError: wrong format of parameter options
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+-        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
++        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n... [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+         ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c182576ea553cd..8f540dad14bfd1 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-version=10.4
+version=10.5
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
 URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/${version}..."
@@ -27,8 +27,8 @@ get_pr() {
 # run from patches dir
 cd $(dirname "$0")
 
-get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
+get_pr 38572 "nauty 2.8.9"
 
 #get_pr 37645 "fix doctest"
 get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index f5e1d8c68cfcbe..709a3ea4262101 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta2
+version=10.5.beta3
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
+checksum=cbf3614c1b9be5f0a0756b0a5480c2ebfa663bd87bd66eefd162a755979bcb3d
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

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

* Re: [BETA] sagemath: update to 10.5.beta3
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
                   ` (4 preceding siblings ...)
  2024-09-08 16:10 ` tornaria
@ 2024-09-09  1:13 ` dkwo
  2024-09-10  0:07 ` tornaria
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dkwo @ 2024-09-09  1:13 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/51902#issuecomment-2336920228

Comment:
I tried to crosscompile sagemath from aarch64 to x86_64: it looks like we should add to hostmakedepends "python3-gmpy2 python3-memory_allocator python3-numpy ecl python3-cypari2 python3-cysignals python3-devel". Makes sense?

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

* Re: [BETA] sagemath: update to 10.5.beta3
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
                   ` (5 preceding siblings ...)
  2024-09-09  1:13 ` [BETA] sagemath: update to 10.5.beta3 dkwo
@ 2024-09-10  0:07 ` tornaria
  2024-09-10 20:23 ` dkwo
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-09-10  0:07 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/51902#issuecomment-2339362703

Comment:
> I tried to crosscompile sagemath from aarch64 to x86_64: it looks like we should add to hostmakedepends "python3-gmpy2 python3-memory_allocator python3-numpy ecl python3-cypari2 python3-cysignals python3-devel". Makes sense?

Sure, but we still don't have cross for ntl and others, does it make sense to bother with this?

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

* Re: [BETA] sagemath: update to 10.5.beta3
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
                   ` (6 preceding siblings ...)
  2024-09-10  0:07 ` tornaria
@ 2024-09-10 20:23 ` dkwo
  2024-09-22 12:01 ` [PR PATCH] [Updated] " tornaria
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: dkwo @ 2024-09-10 20:23 UTC (permalink / raw)
  To: ml

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

New comment by dkwo on void-packages repository

https://github.com/void-linux/void-packages/pull/51902#issuecomment-2341944247

Comment:
True. It's still useful to know in general, and it could be useful later, if we decide e.g. to use qemu to build ntl etc.

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

* Re: [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta3
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
                   ` (7 preceding siblings ...)
  2024-09-10 20:23 ` dkwo
@ 2024-09-22 12:01 ` tornaria
  2024-10-15 19:18 ` [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta5 tornaria
  2024-10-29  0:41 ` [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta7 tornaria
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-09-22 12:01 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1465 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/51902

[BETA] sagemath: update to 10.5.beta3
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - python3-gmpy2: update to 2.2.1.
 - python3-cypari2: update to 2.2.0.
 - python3-sympy: update to 1.13.2.
 - sagemath: enable all cython warnings

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From ecfba27920ba6beeb1e7b95162087cfdf899bc2f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 1/7] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From 0f1b17f2a82bd8d725d3958c0d6f5428a5715e65 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 2/7] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   6 +-
 6 files changed, 21 insertions(+), 669 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index b116e62bc67a5a..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=3
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 994c1355b7fac7403f8eb2e2d26609e8df3f879f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 3/7] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

From e085459b89cb1758450884986d08d01ab83d2b11 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 20 Aug 2024 17:56:06 -0300
Subject: [PATCH 4/7] sagemath: patch for numpy 2.1

---
 srcpkgs/sagemath/patches/numpy_2.1a.patch |  8 +--
 srcpkgs/sagemath/patches/numpy_2.1b.patch | 70 +++++++++++------------
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
index 30e2de99d84536..493c75e2f8f8e0 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1a.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1a.patch
@@ -1,14 +1,14 @@
-commit 241dc39bd0ba1c056f88bee46a0345d59093eaff
+commit d755b32cbed462abf01a1cd782ba57cb92fbf713
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Mon Aug 19 23:25:32 2024 -0300
 
     add copy parameter to numpy (needed for v2.1)
 
 diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index c38df5412f0..f587cef651a 100644
+index 3edb9ead54d..2c76fd1e557 100644
 --- a/src/sage/matrix/matrix1.pyx
 +++ b/src/sage/matrix/matrix1.pyx
-@@ -671,7 +671,7 @@ cdef class Matrix(Matrix0):
+@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
              entries = [[sib(v, 2) for v in row] for row in self.rows()]
              return sib.name('matrix')(self.base_ring(), entries)
  
@@ -17,7 +17,7 @@ index c38df5412f0..f587cef651a 100644
          """
          Return the Numpy matrix associated to this matrix.
  
-@@ -732,7 +732,7 @@ cdef class Matrix(Matrix0):
+@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
              (3, 4)
          """
          import numpy
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
index b77e28361d2e74..8dc0eec2b5a9d8 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1b.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1b.patch
@@ -1,11 +1,11 @@
-commit 8b32fdb87725c1d67ffb51dadec1c331c7c35f3c
+commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Tue Aug 20 00:05:33 2024 -0300
 
     silence np.set_printoptions (for numpy 2.1)
 
 diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b3ebd206cd2..48866824224 100644
+index 74a14fa1ecd..82e6c7eb3c8 100644
 --- a/src/sage/combinat/fully_packed_loop.py
 +++ b/src/sage/combinat/fully_packed_loop.py
 @@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
@@ -18,7 +18,7 @@ index b3ebd206cd2..48866824224 100644
          sage: _make_color_list(5)
          sage: _make_color_list(5, ['blue', 'red'])
 diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index 2a03bb68f67..30b56722e66 100644
+index 308171af3cd..6f66624ef87 100644
 --- a/src/sage/functions/special.py
 +++ b/src/sage/functions/special.py
 @@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
@@ -31,10 +31,10 @@ index 2a03bb68f67..30b56722e66 100644
          (0.3454941494713355-4.231083042742082e-17j)
  
 diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index 7ae8ca4966f..4cba22efdba 100644
+index b3e42a6a6a2..13ffa4d1789 100644
 --- a/src/sage/numerical/optimize.py
 +++ b/src/sage/numerical/optimize.py
-@@ -385,7 +385,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
+@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
          ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -44,7 +44,7 @@ index 7ae8ca4966f..4cba22efdba 100644
          sage: def rosen_der(x):
          ....:    xm = x[1r:-1r]
 diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index 23e2517ca56..7375dcd5d1c 100644
+index 02442f90ba4..1fe3f0b051a 100644
 --- a/src/sage/plot/arrow.py
 +++ b/src/sage/plot/arrow.py
 @@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
@@ -57,10 +57,10 @@ index 23e2517ca56..7375dcd5d1c 100644
              sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
              ....:                options={})
 diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 6be448f1e04..004594b77c4 100644
+index d2f70b44526..2eaacc6879e 100644
 --- a/src/sage/plot/multigraphics.py
 +++ b/src/sage/plot/multigraphics.py
-@@ -786,7 +786,7 @@ class MultiGraphics(WithEqualityById, SageObject):
+@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
              (0.2, 0.3, 0.4, 0.1)
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -68,8 +68,8 @@ index 6be448f1e04..004594b77c4 100644
 +            ....:     _token = numpy.set_printoptions(legacy="1.25")
              sage: ax1.get_position().bounds  # tol 1.0e-13
              (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1300,7 +1300,7 @@ class GraphicsArray(MultiGraphics):
+         """
+@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
              sage: G = graphics_array([g1, g2])
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -79,10 +79,10 @@ index 6be448f1e04..004594b77c4 100644
              (0.025045451349937315,
               0.03415488992713045,
 diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index d2cb11088c7..6d88517cc15 100644
+index b69a05b37bf..25e404bfc7d 100644
 --- a/src/sage/plot/streamline_plot.py
 +++ b/src/sage/plot/streamline_plot.py
-@@ -73,7 +73,7 @@ class StreamlinePlot(GraphicPrimitive):
+@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
              sage: x, y = var('x y')
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -92,20 +92,20 @@ index d2cb11088c7..6d88517cc15 100644
              sage: d['xmin']
              10.0
 diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 38c30f7627b..cfb8a5ff5f7 100644
+index 11811b9587f..8ce0f7f2683 100644
 --- a/src/sage/rings/integer.pyx
 +++ b/src/sage/rings/integer.pyx
-@@ -594,7 +594,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
- 
-             sage: import numpy                                                          # needs numpy
-             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
--            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
+@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+             sage: # needs numpy
+             sage: import numpy
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: numpy.int8('12') == 12
              True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
+             sage: 12 == numpy.int8('12')
 diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 76fbfedab95..57de30c9d18 100644
+index 11953a50ab5..6aafcceed89 100644
 --- a/src/sage/rings/real_mpfi.pyx
 +++ b/src/sage/rings/real_mpfi.pyx
 @@ -232,7 +232,7 @@ TESTS::
@@ -118,7 +118,7 @@ index 76fbfedab95..57de30c9d18 100644
      True
      sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
 diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 70ce616f92f..f604c6d3785 100644
+index 40b92ab23eb..3838bcccb8a 100755
 --- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 +++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 @@ -78,7 +78,7 @@ cdef class PeriodicRegion:
@@ -130,7 +130,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -298,7 +298,7 @@ cdef class PeriodicRegion:
+@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -139,7 +139,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((10, 10))
              sage: data[1:4,1:4] = True
-@@ -322,7 +322,7 @@ cdef class PeriodicRegion:
+@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -148,7 +148,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: data[1,1] = True
-@@ -377,7 +377,7 @@ cdef class PeriodicRegion:
+@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -157,7 +157,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
  
              sage: data = np.zeros((20, 20))
-@@ -529,7 +529,7 @@ cdef class PeriodicRegion:
+@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -167,10 +167,10 @@ index 70ce616f92f..f604c6d3785 100644
              sage: data = np.zeros((4, 4))
              sage: data[1, 1] = True
 diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index 6937f6cb410..fb296e00fb6 100644
+index 47d890cf0ab..ba7f0cdb0f9 100644
 --- a/src/sage/stats/basic_stats.py
 +++ b/src/sage/stats/basic_stats.py
-@@ -228,7 +228,7 @@ def std(v, bias=False):
+@@ -222,7 +222,7 @@ def std(v, bias=False):
          sage: # needs numpy
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -179,7 +179,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: x = numpy.array([1,2,3,4,5])
          sage: std(x, bias=False)
          1.5811388300841898
-@@ -307,7 +307,7 @@ def variance(v, bias=False):
+@@ -299,7 +299,7 @@ def variance(v, bias=False):
          0.4897530450000000?
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
@@ -189,7 +189,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: variance(x, bias=False)                                                   # needs numpy
          2.5
 diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index 955a256e9b4..e5ed6160b79 100644
+index cc15eff82e9..e32e7fd28b3 100644
 --- a/src/sage/structure/coerce.pyx
 +++ b/src/sage/structure/coerce.pyx
 @@ -521,7 +521,7 @@ cdef class CoercionModel:
@@ -202,10 +202,10 @@ index 955a256e9b4..e5ed6160b79 100644
          sage: # needs sage.rings.real_mpfr
          sage: x = polygen(RR)
 diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index cd89ad2a256..6fdf6d8ef23 100644
+index 362d01ea297..92bce28b032 100644
 --- a/src/sage/symbolic/function.pyx
 +++ b/src/sage/symbolic/function.pyx
-@@ -965,7 +965,7 @@ cdef class BuiltinFunction(Function):
+@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
  
              sage: import numpy                                                          # needs numpy
              sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
@@ -215,10 +215,10 @@ index cd89ad2a256..6fdf6d8ef23 100644
              sage: sin(numpy.int32(0))                                                   # needs numpy
              0.0
 diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 5b007d9e5fd..4a096d317e7 100644
+index 32afe8d3a62..63734e68f63 100644
 --- a/src/sage/symbolic/ring.pyx
 +++ b/src/sage/symbolic/ring.pyx
-@@ -1163,7 +1163,7 @@ cdef class NumpyToSRMorphism(Morphism):
+@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
  
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy

From 2bbc53d3fe97b01a51e86df082736217ad2fd22e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 8 Sep 2024 09:35:16 -0300
Subject: [PATCH 5/7] nauty: update to 2.8.9.

---
 srcpkgs/nauty/patches/fix-runalltests.patch | 11 +++++++++++
 srcpkgs/nauty/template                      |  7 ++++---
 2 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/nauty/patches/fix-runalltests.patch

diff --git a/srcpkgs/nauty/patches/fix-runalltests.patch b/srcpkgs/nauty/patches/fix-runalltests.patch
new file mode 100644
index 00000000000000..34e1692cf6e6e3
--- /dev/null
+++ b/srcpkgs/nauty/patches/fix-runalltests.patch
@@ -0,0 +1,11 @@
+--- a/runalltests.in	2024-08-26 00:55:55.000000000 -0300
++++ b/runalltests.in	2024-09-08 09:30:04.032719770 -0300
+@@ -121,7 +121,7 @@
+ runonetest "./geng -q -TD6 10 | ./ransubg -qS765 -P9/10 | ./countg --NN,A,G,GG" "" nautestv.ans
+ runonetest "./genrang -q -P3 -S1234 70 1000 | ./countg --G,GG" "" nautestw.ans
+ runonetest "./genrang -q -P4 -z -S1234 70 500 | ./countg --G,GG" "" nautestx.ans
+-runonetest "./geng -q -bT 12 | ./ranlabg -qS7654 -m5 | uniqg -u" "" nautesty.ans
++runonetest "./geng -q -bT 12 | ./ranlabg -qS7654 -m5 | ./uniqg -u" "" nautesty.ans
+ 
+ echo " "
+ 
diff --git a/srcpkgs/nauty/template b/srcpkgs/nauty/template
index 6f85b1d064d4e5..aea4e4a6eb0294 100644
--- a/srcpkgs/nauty/template
+++ b/srcpkgs/nauty/template
@@ -1,18 +1,18 @@
 # Template file for 'nauty'
 pkgname=nauty
-version=2.8.8
+version=2.8.9
 revision=1
 build_style=gnu-configure
 make_install_args="includedir=/usr/include/nauty
  pkgconfigexecdir=/usr/lib/pkgconfig"
-hostmakedepends="automake"
+hostmakedepends="automake libtool"
 short_desc="Compute the automorphism groups of graphs and digraphs"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="Apache-2.0"
 homepage="https://pallini.di.uniroma1.it/"
 changelog="https://pallini.di.uniroma1.it/changes24-28.txt"
 distfiles="https://pallini.di.uniroma1.it/nauty${version//./_}.tar.gz"
-checksum=159d2156810a6bb240410cd61eb641add85088d9f15c888cdaa37b8681f929ce
+checksum=c97ab42bf48796a86a598bce3e9269047ca2b32c14fc23e07208a244fe52c4ee
 
 build_options="native_build"
 
@@ -21,6 +21,7 @@ if [ -z "$build_option_native_build" ]; then
 fi
 
 pre_configure() {
+	aclocal
 	autoreconf -fi
 }
 

From c20a4820602587b652b607e3f938062b9e3f551d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 7 Sep 2024 14:32:41 -0300
Subject: [PATCH 6/7] sagemath: update to 10.5.beta3.

---
 .../sagemath/patches/36641-sympy_1.13.patch   | 60 -------------------
 .../sagemath/patches/38572-nauty_2.8.9.patch  | 13 ++++
 srcpkgs/sagemath/patches/get_patches          |  4 +-
 srcpkgs/sagemath/template                     |  4 +-
 4 files changed, 17 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/36641-sympy_1.13.patch
 create mode 100644 srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
deleted file mode 100644
index 01e859ad023f4d..00000000000000
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 823a0d14a41..de1c8531814 100644
---- a/src/sage/doctest/forker.py
-+++ b/src/sage/doctest/forker.py
-@@ -150,14 +150,15 @@ def init_sage(controller=None):
-         sage: from sympy.printing.pretty.pretty import PrettyPrinter
-         sage: s = sympify('+x^'.join(str(i) for i in range(30)))
-         sage: print(PrettyPrinter(settings={'wrap_line': True}).doprint(s))
--         29    28    27    26    25    24    23    22    21    20    19    18    17
--        x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   +
-+         29    28    27    26    25    24    23    22    21    20    19    18    17    ↪
-+        x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   +  ↪
-         <BLANKLINE>
--         16    15    14    13    12    11    10    9    8    7    6    5    4    3
--        x   + x   + x   + x   + x   + x   + x   + x  + x  + x  + x  + x  + x  + x  + x
-+        ↪  16    15    14    13    12    11    10    9    8    7    6    5    4    3   ↪
-+        ↪ x   + x   + x   + x   + x   + x   + x   + x  + x  + x  + x  + x  + x  + x  + ↪
-         <BLANKLINE>
--        2
--          + x
-+        ↪   2
-+        ↪  x  + x
-+
- 
-     The displayhook sorts dictionary keys to simplify doctesting of
-     dictionary output::
-diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index ade7836b310..eb5c6665c0d 100644
---- a/src/sage/functions/hypergeometric.py
-+++ b/src/sage/functions/hypergeometric.py
-@@ -124,7 +124,7 @@
-     sage: maxima(hypergeometric([1, 1, 1], [3, 3, 3], x))                               # needs sage.symbolic
-     hypergeometric([1,1,1],[3,3,3],_SAGE_VAR_x)
-     sage: hypergeometric((5, 4), (4, 4), 3)._sympy_()                                   # needs sympy sage.symbolic
--    hyper((5, 4), (4, 4), 3)
-+    hyper((5,), (4,), 3)
-     sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
-     'HypergeometricPFQ[{5,4},{4,4},3]'
- 
-diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 83d92af8959..e470e2bd88d 100644
---- a/src/sage/typeset/ascii_art.py
-+++ b/src/sage/typeset/ascii_art.py
-@@ -44,11 +44,12 @@
-     sage: shell.run_cell('%display ascii_art')
-     sage: shell.run_cell("i = var('i')")                                                # needs sage.symbolic
-     sage: shell.run_cell('sum(factorial(i)*x^i, i, 0, 10)')                             # needs sage.symbolic
--             10           9          8         7        6        5       4      3
--    3628800*x   + 362880*x  + 40320*x  + 5040*x  + 720*x  + 120*x  + 24*x  + 6*x
-+             10           9          8         7        6        5       4      3  >
-+    3628800*x   + 362880*x  + 40320*x  + 5040*x  + 720*x  + 120*x  + 24*x  + 6*x   >
-     <BLANKLINE>
--         2
--    + 2*x  + x + 1
-+    >      2
-+    > + 2*x  + x + 1
-+
-     sage: shell.run_cell('3/(7*x)')                                                     # needs sage.symbolic
-      3
-     ---
diff --git a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
new file mode 100644
index 00000000000000..5f75a8bef5556a
--- /dev/null
+++ b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
@@ -0,0 +1,13 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index e6e5312b8a8..aa10d15d4d8 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3710,7 +3710,7 @@ def nauty_gentreeg(options='', debug=False):
+         ...
+         ValueError: wrong format of parameter options
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+-        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
++        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n... [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+         ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c182576ea553cd..8f540dad14bfd1 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-version=10.4
+version=10.5
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
 URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/${version}..."
@@ -27,8 +27,8 @@ get_pr() {
 # run from patches dir
 cd $(dirname "$0")
 
-get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
+get_pr 38572 "nauty 2.8.9"
 
 #get_pr 37645 "fix doctest"
 get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index f5e1d8c68cfcbe..709a3ea4262101 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta2
+version=10.5.beta3
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
+checksum=cbf3614c1b9be5f0a0756b0a5480c2ebfa663bd87bd66eefd162a755979bcb3d
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From a1b9d7ea1e4fce08e00593060b08e6eec4c0c641 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 22 Sep 2024 08:19:39 -0300
Subject: [PATCH 7/7] sagemath: update to 10.5.beta5.

---
 .../sagemath/patches/38572-nauty_2.8.9.patch  |  13 -
 srcpkgs/sagemath/patches/numpy_2.1a.patch     |  28 ---
 srcpkgs/sagemath/patches/numpy_2.1b.patch     | 229 ------------------
 srcpkgs/sagemath/template                     |   4 +-
 4 files changed, 2 insertions(+), 272 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
 delete mode 100644 srcpkgs/sagemath/patches/numpy_2.1a.patch
 delete mode 100644 srcpkgs/sagemath/patches/numpy_2.1b.patch

diff --git a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
deleted file mode 100644
index 5f75a8bef5556a..00000000000000
--- a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index e6e5312b8a8..aa10d15d4d8 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3710,7 +3710,7 @@ def nauty_gentreeg(options='', debug=False):
-         ...
-         ValueError: wrong format of parameter options
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
--        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-+        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n... [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
-         ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
deleted file mode 100644
index 493c75e2f8f8e0..00000000000000
--- a/srcpkgs/sagemath/patches/numpy_2.1a.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-commit d755b32cbed462abf01a1cd782ba57cb92fbf713
-Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
-Date:   Mon Aug 19 23:25:32 2024 -0300
-
-    add copy parameter to numpy (needed for v2.1)
-
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index 3edb9ead54d..2c76fd1e557 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
-             entries = [[sib(v, 2) for v in row] for row in self.rows()]
-             return sib.name('matrix')(self.base_ring(), entries)
- 
--    def numpy(self, dtype=None):
-+    def numpy(self, dtype=None, copy=True):
-         """
-         Return the Numpy matrix associated to this matrix.
- 
-@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
-             (3, 4)
-         """
-         import numpy
--        A = numpy.matrix(self.list(), dtype=dtype)
-+        A = numpy.matrix(self.list(), dtype=dtype, copy=copy)
-         return numpy.resize(A,(self.nrows(), self.ncols()))
- 
-     # Define the magic "__array__" function so that numpy.array(m) can convert
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
deleted file mode 100644
index 8dc0eec2b5a9d8..00000000000000
--- a/srcpkgs/sagemath/patches/numpy_2.1b.patch
+++ /dev/null
@@ -1,229 +0,0 @@
-commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
-Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
-Date:   Tue Aug 20 00:05:33 2024 -0300
-
-    silence np.set_printoptions (for numpy 2.1)
-
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index 74a14fa1ecd..82e6c7eb3c8 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
- 
-         sage: import numpy as np
-         sage: if int(np.version.short_version[0]) > 1:
--        ....:     np.set_printoptions(legacy="1.25")
-+        ....:     _token = np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index 308171af3cd..6f66624ef87 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-         sage: import numpy as np                                                        # needs scipy
-         sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
--        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-+        ....:     _token = np.set_printoptions(legacy="1.25")                           # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index b3e42a6a6a2..13ffa4d1789 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-         sage: if int(numpy.version.short_version[0]) > 1:
--        ....:     numpy.set_printoptions(legacy="1.25")
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index 02442f90ba4..1fe3f0b051a 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
- 
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index d2f70b44526..2eaacc6879e 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
-             (0.2, 0.3, 0.4, 0.1)
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
-         """
-@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
-             sage: G = graphics_array([g1, g2])
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index b69a05b37bf..25e404bfc7d 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
-             sage: x, y = var('x y')
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 11811b9587f..8ce0f7f2683 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-             sage: # needs numpy
-             sage: import numpy
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: numpy.int8('12') == 12
-             True
-             sage: 12 == numpy.int8('12')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 11953a50ab5..6aafcceed89 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -232,7 +232,7 @@ TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-     sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
--    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-+    ....:     _token = numpy.set_printoptions(legacy="1.25")                            # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 40b92ab23eb..3838bcccb8a 100755
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -78,7 +78,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index 47d890cf0ab..ba7f0cdb0f9 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -222,7 +222,7 @@ def std(v, bias=False):
-         sage: # needs numpy
-         sage: import numpy
-         sage: if int(numpy.version.short_version[0]) > 1:
--        ....:     numpy.set_printoptions(legacy="1.25")
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -299,7 +299,7 @@ def variance(v, bias=False):
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index cc15eff82e9..e32e7fd28b3 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -521,7 +521,7 @@ cdef class CoercionModel:
- 
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 362d01ea297..92bce28b032 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
- 
-             sage: import numpy                                                          # needs numpy
-             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
--            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
- 
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 32afe8d3a62..63734e68f63 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
- 
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 709a3ea4262101..4face5e8f7ad84 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta3
+version=10.5.beta5
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=cbf3614c1b9be5f0a0756b0a5480c2ebfa663bd87bd66eefd162a755979bcb3d
+checksum=af4e8215043cd5376adea87f37928b94863561e36cba2171dab48ea984f7f259
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

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

* Re: [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta5
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
                   ` (8 preceding siblings ...)
  2024-09-22 12:01 ` [PR PATCH] [Updated] " tornaria
@ 2024-10-15 19:18 ` tornaria
  2024-10-29  0:41 ` [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta7 tornaria
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-10-15 19:18 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1382 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/51902

[BETA] sagemath: update to 10.5.beta5
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - sagemath: enable all cython warnings
 - nauty: update to 2.8.9.

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From 9ebf2e52260c14364e8d567088ca1982eaf0e5b1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 1/9] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From a8eedd114440b0a5b44dd5e4c2af9f967dcb6fc0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 2/9] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   6 +-
 6 files changed, 21 insertions(+), 669 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index b116e62bc67a5a..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=3
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 9b392e0823ef62566a738c29c8f53a10fb8f06a8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 3/9] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

From 8fa5c8f8cfcab5c183ae720645b43227267d73e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 20 Aug 2024 17:56:06 -0300
Subject: [PATCH 4/9] sagemath: patch for numpy 2.1

---
 srcpkgs/sagemath/patches/numpy_2.1a.patch |  8 +--
 srcpkgs/sagemath/patches/numpy_2.1b.patch | 70 +++++++++++------------
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
index 30e2de99d84536..493c75e2f8f8e0 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1a.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1a.patch
@@ -1,14 +1,14 @@
-commit 241dc39bd0ba1c056f88bee46a0345d59093eaff
+commit d755b32cbed462abf01a1cd782ba57cb92fbf713
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Mon Aug 19 23:25:32 2024 -0300
 
     add copy parameter to numpy (needed for v2.1)
 
 diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index c38df5412f0..f587cef651a 100644
+index 3edb9ead54d..2c76fd1e557 100644
 --- a/src/sage/matrix/matrix1.pyx
 +++ b/src/sage/matrix/matrix1.pyx
-@@ -671,7 +671,7 @@ cdef class Matrix(Matrix0):
+@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
              entries = [[sib(v, 2) for v in row] for row in self.rows()]
              return sib.name('matrix')(self.base_ring(), entries)
  
@@ -17,7 +17,7 @@ index c38df5412f0..f587cef651a 100644
          """
          Return the Numpy matrix associated to this matrix.
  
-@@ -732,7 +732,7 @@ cdef class Matrix(Matrix0):
+@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
              (3, 4)
          """
          import numpy
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
index b77e28361d2e74..8dc0eec2b5a9d8 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1b.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1b.patch
@@ -1,11 +1,11 @@
-commit 8b32fdb87725c1d67ffb51dadec1c331c7c35f3c
+commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Tue Aug 20 00:05:33 2024 -0300
 
     silence np.set_printoptions (for numpy 2.1)
 
 diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b3ebd206cd2..48866824224 100644
+index 74a14fa1ecd..82e6c7eb3c8 100644
 --- a/src/sage/combinat/fully_packed_loop.py
 +++ b/src/sage/combinat/fully_packed_loop.py
 @@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
@@ -18,7 +18,7 @@ index b3ebd206cd2..48866824224 100644
          sage: _make_color_list(5)
          sage: _make_color_list(5, ['blue', 'red'])
 diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index 2a03bb68f67..30b56722e66 100644
+index 308171af3cd..6f66624ef87 100644
 --- a/src/sage/functions/special.py
 +++ b/src/sage/functions/special.py
 @@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
@@ -31,10 +31,10 @@ index 2a03bb68f67..30b56722e66 100644
          (0.3454941494713355-4.231083042742082e-17j)
  
 diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index 7ae8ca4966f..4cba22efdba 100644
+index b3e42a6a6a2..13ffa4d1789 100644
 --- a/src/sage/numerical/optimize.py
 +++ b/src/sage/numerical/optimize.py
-@@ -385,7 +385,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
+@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
          ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -44,7 +44,7 @@ index 7ae8ca4966f..4cba22efdba 100644
          sage: def rosen_der(x):
          ....:    xm = x[1r:-1r]
 diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index 23e2517ca56..7375dcd5d1c 100644
+index 02442f90ba4..1fe3f0b051a 100644
 --- a/src/sage/plot/arrow.py
 +++ b/src/sage/plot/arrow.py
 @@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
@@ -57,10 +57,10 @@ index 23e2517ca56..7375dcd5d1c 100644
              sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
              ....:                options={})
 diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 6be448f1e04..004594b77c4 100644
+index d2f70b44526..2eaacc6879e 100644
 --- a/src/sage/plot/multigraphics.py
 +++ b/src/sage/plot/multigraphics.py
-@@ -786,7 +786,7 @@ class MultiGraphics(WithEqualityById, SageObject):
+@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
              (0.2, 0.3, 0.4, 0.1)
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -68,8 +68,8 @@ index 6be448f1e04..004594b77c4 100644
 +            ....:     _token = numpy.set_printoptions(legacy="1.25")
              sage: ax1.get_position().bounds  # tol 1.0e-13
              (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1300,7 +1300,7 @@ class GraphicsArray(MultiGraphics):
+         """
+@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
              sage: G = graphics_array([g1, g2])
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -79,10 +79,10 @@ index 6be448f1e04..004594b77c4 100644
              (0.025045451349937315,
               0.03415488992713045,
 diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index d2cb11088c7..6d88517cc15 100644
+index b69a05b37bf..25e404bfc7d 100644
 --- a/src/sage/plot/streamline_plot.py
 +++ b/src/sage/plot/streamline_plot.py
-@@ -73,7 +73,7 @@ class StreamlinePlot(GraphicPrimitive):
+@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
              sage: x, y = var('x y')
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -92,20 +92,20 @@ index d2cb11088c7..6d88517cc15 100644
              sage: d['xmin']
              10.0
 diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 38c30f7627b..cfb8a5ff5f7 100644
+index 11811b9587f..8ce0f7f2683 100644
 --- a/src/sage/rings/integer.pyx
 +++ b/src/sage/rings/integer.pyx
-@@ -594,7 +594,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
- 
-             sage: import numpy                                                          # needs numpy
-             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
--            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
+@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+             sage: # needs numpy
+             sage: import numpy
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: numpy.int8('12') == 12
              True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
+             sage: 12 == numpy.int8('12')
 diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 76fbfedab95..57de30c9d18 100644
+index 11953a50ab5..6aafcceed89 100644
 --- a/src/sage/rings/real_mpfi.pyx
 +++ b/src/sage/rings/real_mpfi.pyx
 @@ -232,7 +232,7 @@ TESTS::
@@ -118,7 +118,7 @@ index 76fbfedab95..57de30c9d18 100644
      True
      sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
 diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 70ce616f92f..f604c6d3785 100644
+index 40b92ab23eb..3838bcccb8a 100755
 --- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 +++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 @@ -78,7 +78,7 @@ cdef class PeriodicRegion:
@@ -130,7 +130,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -298,7 +298,7 @@ cdef class PeriodicRegion:
+@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -139,7 +139,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((10, 10))
              sage: data[1:4,1:4] = True
-@@ -322,7 +322,7 @@ cdef class PeriodicRegion:
+@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -148,7 +148,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: data[1,1] = True
-@@ -377,7 +377,7 @@ cdef class PeriodicRegion:
+@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -157,7 +157,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
  
              sage: data = np.zeros((20, 20))
-@@ -529,7 +529,7 @@ cdef class PeriodicRegion:
+@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -167,10 +167,10 @@ index 70ce616f92f..f604c6d3785 100644
              sage: data = np.zeros((4, 4))
              sage: data[1, 1] = True
 diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index 6937f6cb410..fb296e00fb6 100644
+index 47d890cf0ab..ba7f0cdb0f9 100644
 --- a/src/sage/stats/basic_stats.py
 +++ b/src/sage/stats/basic_stats.py
-@@ -228,7 +228,7 @@ def std(v, bias=False):
+@@ -222,7 +222,7 @@ def std(v, bias=False):
          sage: # needs numpy
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -179,7 +179,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: x = numpy.array([1,2,3,4,5])
          sage: std(x, bias=False)
          1.5811388300841898
-@@ -307,7 +307,7 @@ def variance(v, bias=False):
+@@ -299,7 +299,7 @@ def variance(v, bias=False):
          0.4897530450000000?
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
@@ -189,7 +189,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: variance(x, bias=False)                                                   # needs numpy
          2.5
 diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index 955a256e9b4..e5ed6160b79 100644
+index cc15eff82e9..e32e7fd28b3 100644
 --- a/src/sage/structure/coerce.pyx
 +++ b/src/sage/structure/coerce.pyx
 @@ -521,7 +521,7 @@ cdef class CoercionModel:
@@ -202,10 +202,10 @@ index 955a256e9b4..e5ed6160b79 100644
          sage: # needs sage.rings.real_mpfr
          sage: x = polygen(RR)
 diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index cd89ad2a256..6fdf6d8ef23 100644
+index 362d01ea297..92bce28b032 100644
 --- a/src/sage/symbolic/function.pyx
 +++ b/src/sage/symbolic/function.pyx
-@@ -965,7 +965,7 @@ cdef class BuiltinFunction(Function):
+@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
  
              sage: import numpy                                                          # needs numpy
              sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
@@ -215,10 +215,10 @@ index cd89ad2a256..6fdf6d8ef23 100644
              sage: sin(numpy.int32(0))                                                   # needs numpy
              0.0
 diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 5b007d9e5fd..4a096d317e7 100644
+index 32afe8d3a62..63734e68f63 100644
 --- a/src/sage/symbolic/ring.pyx
 +++ b/src/sage/symbolic/ring.pyx
-@@ -1163,7 +1163,7 @@ cdef class NumpyToSRMorphism(Morphism):
+@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
  
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy

From bc0e48c8fc9bb7cdf3555fc36930f4035d7288f3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 8 Sep 2024 09:35:16 -0300
Subject: [PATCH 5/9] nauty: update to 2.8.9.

---
 srcpkgs/nauty/patches/fix-runalltests.patch | 11 +++++++++++
 srcpkgs/nauty/template                      |  7 ++++---
 2 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/nauty/patches/fix-runalltests.patch

diff --git a/srcpkgs/nauty/patches/fix-runalltests.patch b/srcpkgs/nauty/patches/fix-runalltests.patch
new file mode 100644
index 00000000000000..34e1692cf6e6e3
--- /dev/null
+++ b/srcpkgs/nauty/patches/fix-runalltests.patch
@@ -0,0 +1,11 @@
+--- a/runalltests.in	2024-08-26 00:55:55.000000000 -0300
++++ b/runalltests.in	2024-09-08 09:30:04.032719770 -0300
+@@ -121,7 +121,7 @@
+ runonetest "./geng -q -TD6 10 | ./ransubg -qS765 -P9/10 | ./countg --NN,A,G,GG" "" nautestv.ans
+ runonetest "./genrang -q -P3 -S1234 70 1000 | ./countg --G,GG" "" nautestw.ans
+ runonetest "./genrang -q -P4 -z -S1234 70 500 | ./countg --G,GG" "" nautestx.ans
+-runonetest "./geng -q -bT 12 | ./ranlabg -qS7654 -m5 | uniqg -u" "" nautesty.ans
++runonetest "./geng -q -bT 12 | ./ranlabg -qS7654 -m5 | ./uniqg -u" "" nautesty.ans
+ 
+ echo " "
+ 
diff --git a/srcpkgs/nauty/template b/srcpkgs/nauty/template
index 6f85b1d064d4e5..aea4e4a6eb0294 100644
--- a/srcpkgs/nauty/template
+++ b/srcpkgs/nauty/template
@@ -1,18 +1,18 @@
 # Template file for 'nauty'
 pkgname=nauty
-version=2.8.8
+version=2.8.9
 revision=1
 build_style=gnu-configure
 make_install_args="includedir=/usr/include/nauty
  pkgconfigexecdir=/usr/lib/pkgconfig"
-hostmakedepends="automake"
+hostmakedepends="automake libtool"
 short_desc="Compute the automorphism groups of graphs and digraphs"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="Apache-2.0"
 homepage="https://pallini.di.uniroma1.it/"
 changelog="https://pallini.di.uniroma1.it/changes24-28.txt"
 distfiles="https://pallini.di.uniroma1.it/nauty${version//./_}.tar.gz"
-checksum=159d2156810a6bb240410cd61eb641add85088d9f15c888cdaa37b8681f929ce
+checksum=c97ab42bf48796a86a598bce3e9269047ca2b32c14fc23e07208a244fe52c4ee
 
 build_options="native_build"
 
@@ -21,6 +21,7 @@ if [ -z "$build_option_native_build" ]; then
 fi
 
 pre_configure() {
+	aclocal
 	autoreconf -fi
 }
 

From b00ea1ef12baaa52cd7405775a67696c33cc8688 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 7 Sep 2024 14:32:41 -0300
Subject: [PATCH 6/9] sagemath: update to 10.5.beta3.

---
 .../sagemath/patches/36641-sympy_1.13.patch   | 60 -------------------
 .../sagemath/patches/38572-nauty_2.8.9.patch  | 13 ++++
 srcpkgs/sagemath/patches/get_patches          |  4 +-
 srcpkgs/sagemath/template                     |  4 +-
 4 files changed, 17 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/36641-sympy_1.13.patch
 create mode 100644 srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
deleted file mode 100644
index 01e859ad023f4d..00000000000000
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 823a0d14a41..de1c8531814 100644
---- a/src/sage/doctest/forker.py
-+++ b/src/sage/doctest/forker.py
-@@ -150,14 +150,15 @@ def init_sage(controller=None):
-         sage: from sympy.printing.pretty.pretty import PrettyPrinter
-         sage: s = sympify('+x^'.join(str(i) for i in range(30)))
-         sage: print(PrettyPrinter(settings={'wrap_line': True}).doprint(s))
--         29    28    27    26    25    24    23    22    21    20    19    18    17
--        x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   +
-+         29    28    27    26    25    24    23    22    21    20    19    18    17    ↪
-+        x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   +  ↪
-         <BLANKLINE>
--         16    15    14    13    12    11    10    9    8    7    6    5    4    3
--        x   + x   + x   + x   + x   + x   + x   + x  + x  + x  + x  + x  + x  + x  + x
-+        ↪  16    15    14    13    12    11    10    9    8    7    6    5    4    3   ↪
-+        ↪ x   + x   + x   + x   + x   + x   + x   + x  + x  + x  + x  + x  + x  + x  + ↪
-         <BLANKLINE>
--        2
--          + x
-+        ↪   2
-+        ↪  x  + x
-+
- 
-     The displayhook sorts dictionary keys to simplify doctesting of
-     dictionary output::
-diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index ade7836b310..eb5c6665c0d 100644
---- a/src/sage/functions/hypergeometric.py
-+++ b/src/sage/functions/hypergeometric.py
-@@ -124,7 +124,7 @@
-     sage: maxima(hypergeometric([1, 1, 1], [3, 3, 3], x))                               # needs sage.symbolic
-     hypergeometric([1,1,1],[3,3,3],_SAGE_VAR_x)
-     sage: hypergeometric((5, 4), (4, 4), 3)._sympy_()                                   # needs sympy sage.symbolic
--    hyper((5, 4), (4, 4), 3)
-+    hyper((5,), (4,), 3)
-     sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
-     'HypergeometricPFQ[{5,4},{4,4},3]'
- 
-diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 83d92af8959..e470e2bd88d 100644
---- a/src/sage/typeset/ascii_art.py
-+++ b/src/sage/typeset/ascii_art.py
-@@ -44,11 +44,12 @@
-     sage: shell.run_cell('%display ascii_art')
-     sage: shell.run_cell("i = var('i')")                                                # needs sage.symbolic
-     sage: shell.run_cell('sum(factorial(i)*x^i, i, 0, 10)')                             # needs sage.symbolic
--             10           9          8         7        6        5       4      3
--    3628800*x   + 362880*x  + 40320*x  + 5040*x  + 720*x  + 120*x  + 24*x  + 6*x
-+             10           9          8         7        6        5       4      3  >
-+    3628800*x   + 362880*x  + 40320*x  + 5040*x  + 720*x  + 120*x  + 24*x  + 6*x   >
-     <BLANKLINE>
--         2
--    + 2*x  + x + 1
-+    >      2
-+    > + 2*x  + x + 1
-+
-     sage: shell.run_cell('3/(7*x)')                                                     # needs sage.symbolic
-      3
-     ---
diff --git a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
new file mode 100644
index 00000000000000..5f75a8bef5556a
--- /dev/null
+++ b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
@@ -0,0 +1,13 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index e6e5312b8a8..aa10d15d4d8 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3710,7 +3710,7 @@ def nauty_gentreeg(options='', debug=False):
+         ...
+         ValueError: wrong format of parameter options
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+-        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
++        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n... [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+         ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c182576ea553cd..8f540dad14bfd1 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-version=10.4
+version=10.5
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
 URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/${version}..."
@@ -27,8 +27,8 @@ get_pr() {
 # run from patches dir
 cd $(dirname "$0")
 
-get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
+get_pr 38572 "nauty 2.8.9"
 
 #get_pr 37645 "fix doctest"
 get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index f5e1d8c68cfcbe..709a3ea4262101 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta2
+version=10.5.beta3
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
+checksum=cbf3614c1b9be5f0a0756b0a5480c2ebfa663bd87bd66eefd162a755979bcb3d
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 2ca21e78126fbd03e10e52452136c5bcc22363b4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 22 Sep 2024 08:19:39 -0300
Subject: [PATCH 7/9] sagemath: update to 10.5.beta5.

---
 .../sagemath/patches/38572-nauty_2.8.9.patch  |  13 -
 srcpkgs/sagemath/patches/numpy_2.1a.patch     |  28 ---
 srcpkgs/sagemath/patches/numpy_2.1b.patch     | 229 ------------------
 srcpkgs/sagemath/template                     |   4 +-
 4 files changed, 2 insertions(+), 272 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
 delete mode 100644 srcpkgs/sagemath/patches/numpy_2.1a.patch
 delete mode 100644 srcpkgs/sagemath/patches/numpy_2.1b.patch

diff --git a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
deleted file mode 100644
index 5f75a8bef5556a..00000000000000
--- a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index e6e5312b8a8..aa10d15d4d8 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3710,7 +3710,7 @@ def nauty_gentreeg(options='', debug=False):
-         ...
-         ValueError: wrong format of parameter options
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
--        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-+        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n... [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
-         ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
deleted file mode 100644
index 493c75e2f8f8e0..00000000000000
--- a/srcpkgs/sagemath/patches/numpy_2.1a.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-commit d755b32cbed462abf01a1cd782ba57cb92fbf713
-Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
-Date:   Mon Aug 19 23:25:32 2024 -0300
-
-    add copy parameter to numpy (needed for v2.1)
-
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index 3edb9ead54d..2c76fd1e557 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
-             entries = [[sib(v, 2) for v in row] for row in self.rows()]
-             return sib.name('matrix')(self.base_ring(), entries)
- 
--    def numpy(self, dtype=None):
-+    def numpy(self, dtype=None, copy=True):
-         """
-         Return the Numpy matrix associated to this matrix.
- 
-@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
-             (3, 4)
-         """
-         import numpy
--        A = numpy.matrix(self.list(), dtype=dtype)
-+        A = numpy.matrix(self.list(), dtype=dtype, copy=copy)
-         return numpy.resize(A,(self.nrows(), self.ncols()))
- 
-     # Define the magic "__array__" function so that numpy.array(m) can convert
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
deleted file mode 100644
index 8dc0eec2b5a9d8..00000000000000
--- a/srcpkgs/sagemath/patches/numpy_2.1b.patch
+++ /dev/null
@@ -1,229 +0,0 @@
-commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
-Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
-Date:   Tue Aug 20 00:05:33 2024 -0300
-
-    silence np.set_printoptions (for numpy 2.1)
-
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index 74a14fa1ecd..82e6c7eb3c8 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
- 
-         sage: import numpy as np
-         sage: if int(np.version.short_version[0]) > 1:
--        ....:     np.set_printoptions(legacy="1.25")
-+        ....:     _token = np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index 308171af3cd..6f66624ef87 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-         sage: import numpy as np                                                        # needs scipy
-         sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
--        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-+        ....:     _token = np.set_printoptions(legacy="1.25")                           # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index b3e42a6a6a2..13ffa4d1789 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-         sage: if int(numpy.version.short_version[0]) > 1:
--        ....:     numpy.set_printoptions(legacy="1.25")
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index 02442f90ba4..1fe3f0b051a 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
- 
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index d2f70b44526..2eaacc6879e 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
-             (0.2, 0.3, 0.4, 0.1)
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
-         """
-@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
-             sage: G = graphics_array([g1, g2])
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index b69a05b37bf..25e404bfc7d 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
-             sage: x, y = var('x y')
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 11811b9587f..8ce0f7f2683 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-             sage: # needs numpy
-             sage: import numpy
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: numpy.int8('12') == 12
-             True
-             sage: 12 == numpy.int8('12')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 11953a50ab5..6aafcceed89 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -232,7 +232,7 @@ TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-     sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
--    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-+    ....:     _token = numpy.set_printoptions(legacy="1.25")                            # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 40b92ab23eb..3838bcccb8a 100755
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -78,7 +78,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index 47d890cf0ab..ba7f0cdb0f9 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -222,7 +222,7 @@ def std(v, bias=False):
-         sage: # needs numpy
-         sage: import numpy
-         sage: if int(numpy.version.short_version[0]) > 1:
--        ....:     numpy.set_printoptions(legacy="1.25")
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -299,7 +299,7 @@ def variance(v, bias=False):
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index cc15eff82e9..e32e7fd28b3 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -521,7 +521,7 @@ cdef class CoercionModel:
- 
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 362d01ea297..92bce28b032 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
- 
-             sage: import numpy                                                          # needs numpy
-             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
--            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
- 
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 32afe8d3a62..63734e68f63 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
- 
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 709a3ea4262101..4face5e8f7ad84 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta3
+version=10.5.beta5
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=cbf3614c1b9be5f0a0756b0a5480c2ebfa663bd87bd66eefd162a755979bcb3d
+checksum=af4e8215043cd5376adea87f37928b94863561e36cba2171dab48ea984f7f259
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 68be4598fbb9fbf28755943079c18b59c5507759 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 29 Sep 2024 22:24:40 -0300
Subject: [PATCH 8/9] sagemath: update to 10.5.beta6.

---
 srcpkgs/sagemath/patches/get_patches | 2 +-
 srcpkgs/sagemath/template            | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 8f540dad14bfd1..381c307a3e962a 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -28,7 +28,7 @@ get_pr() {
 cd $(dirname "$0")
 
 get_pr 37884 "gap 4.13.1"
-get_pr 38572 "nauty 2.8.9"
+#get_pr 38572 "nauty 2.8.9"
 
 #get_pr 37645 "fix doctest"
 get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 4face5e8f7ad84..fb806ca641d378 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta5
+version=10.5.beta6
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=af4e8215043cd5376adea87f37928b94863561e36cba2171dab48ea984f7f259
+checksum=f95f196142d7abf091185e31d8023091c5746a9e3d2321d906161c65f944fa40
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 7a6c952594bb82744d992d6f07775fec78804740 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 15 Oct 2024 15:30:11 -0300
Subject: [PATCH 9/9] sagemath: update to 10.5.beta7.

---
 srcpkgs/sagemath/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index fb806ca641d378..d19d4ac007f9ba 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta6
+version=10.5.beta7
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f95f196142d7abf091185e31d8023091c5746a9e3d2321d906161c65f944fa40
+checksum=b98a883aab3b6f551243bc3cffb6825c92f6faf86604e9a9cc8f38cfb9af2f32
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

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

* Re: [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta7
  2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
                   ` (9 preceding siblings ...)
  2024-10-15 19:18 ` [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta5 tornaria
@ 2024-10-29  0:41 ` tornaria
  10 siblings, 0 replies; 12+ messages in thread
From: tornaria @ 2024-10-29  0:41 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1382 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/51902

[BETA] sagemath: update to 10.5.beta7
<!-- Uncomment relevant sections and delete options which are not applicable -->

 - python3-Cython: alternative fix for 6122
 - sagemath: enable all cython warnings
 - nauty: update to 2.8.9.

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

@dkwo

<!--
#### 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/51902.patch is attached

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

From a872bc6a4cc1dbc4a24fda78b9cac9b9fff1152e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 11 Aug 2024 22:53:42 -0300
Subject: [PATCH 01/11] python3-Cython: alternative fix for 6122

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f2e761608e373b..f5957cfa59c2f5 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -15,3 +15,11 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
+@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+             if scope is None:
+                 scope = cfunc.scope
+             cfunc_type = cfunc.type
++            has_explicit_exc_clause=True
+             if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
+                 error(self.pos, "wrong number of arguments")
+                 error(cfunc.pos, "previous declaration here")

From be48e3a2ac455db986466ef8be8429d8e68f5e0f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Mon, 5 Aug 2024 00:21:23 -0300
Subject: [PATCH 02/11] sagemath: update to 10.5.beta2.

---
 .../sagemath/patches/36641-sympy_1.13.patch   |  22 +-
 .../sagemath/patches/37884-gap_4.13.1.patch   |  28 +-
 .../sagemath/patches/38250-numpy_2.0.patch    | 587 ------------------
 .../sagemath/patches/38344-ecm_7.0.6.patch    |  43 --
 srcpkgs/sagemath/patches/get_patches          |   4 +-
 srcpkgs/sagemath/template                     |   6 +-
 6 files changed, 21 insertions(+), 669 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38250-numpy_2.0.patch
 delete mode 100644 srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
index 625c582cdd41b7..01e859ad023f4d 100644
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
@@ -1,8 +1,5 @@
-diff --git a/build/pkgs/sympy/requirements.txt b/build/pkgs/sympy/requirements.txt
-new file mode 100644
-index 00000000000..3ef8f90b550
 diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 7e9eab2ff2e..43365cd645e 100644
+index 823a0d14a41..de1c8531814 100644
 --- a/src/sage/doctest/forker.py
 +++ b/src/sage/doctest/forker.py
 @@ -150,14 +150,15 @@ def init_sage(controller=None):
@@ -28,7 +25,7 @@ index 7e9eab2ff2e..43365cd645e 100644
      The displayhook sorts dictionary keys to simplify doctesting of
      dictionary output::
 diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index 010c61febe0..bbccbd20032 100644
+index ade7836b310..eb5c6665c0d 100644
 --- a/src/sage/functions/hypergeometric.py
 +++ b/src/sage/functions/hypergeometric.py
 @@ -124,7 +124,7 @@
@@ -40,21 +37,8 @@ index 010c61febe0..bbccbd20032 100644
      sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
      'HypergeometricPFQ[{5,4},{4,4},3]'
  
-diff --git a/src/sage/symbolic/expression.pyx b/src/sage/symbolic/expression.pyx
-index a92fe241355..f62311423be 100644
---- a/src/sage/symbolic/expression.pyx
-+++ b/src/sage/symbolic/expression.pyx
-@@ -1167,7 +1167,7 @@ cdef class Expression(Expression_abc):
-             sage: unicode_art(SR(13 - I))
-             13 - ⅈ
-             sage: unicode_art(SR(1.3 - I))
--            1.3 - ⅈ
-+            1.3 - 1.0⋅ⅈ
-             sage: unicode_art(cos(I))
-             cosh(1)
- 
 diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 28024405d27..458fa8724a3 100644
+index 83d92af8959..e470e2bd88d 100644
 --- a/src/sage/typeset/ascii_art.py
 +++ b/src/sage/typeset/ascii_art.py
 @@ -44,11 +44,12 @@
diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
index 1550d47e2436c6..321e0a94487da3 100644
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
@@ -1,21 +1,21 @@
 diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 7ce086f70d0..954513572c3 100644
+index 71277561331..3b681d75d3b 100644
 --- a/src/sage/algebras/fusion_rings/fusion_double.py
 +++ b/src/sage/algebras/fusion_rings/fusion_double.py
 @@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
          sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix="b",inject_variables=True)
+         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
          sage: b13^2 # long time (4s)
 -        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
 +        b0 + b3 + b4
- 
      """
      @staticmethod
+     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
 diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index e714a4571c4..a2b87a729d1 100644
+index aabd3cdbb4f..14bebdcd080 100644
 --- a/src/sage/categories/simplicial_sets.py
 +++ b/src/sage/categories/simplicial_sets.py
-@@ -593,9 +593,9 @@ def _canonical_twisting_operator(self):
+@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
                      sage: X = simplicial_sets.Torus()
                      sage: d = X._canonical_twisting_operator()
                      sage: d
@@ -27,7 +27,7 @@ index e714a4571c4..a2b87a729d1 100644
                      sage: Y = simplicial_sets.RealProjectiveSpace(2)
                      sage: d2 = Y._canonical_twisting_operator()
                      sage: d2
-@@ -677,10 +677,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
+@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
                      sage: X = simplicial_sets.Torus()
                      sage: C = X.twisted_chain_complex()
                      sage: C.differential(1)
@@ -41,7 +41,7 @@ index e714a4571c4..a2b87a729d1 100644
                      [      -1       -1]
                      sage: C.differential(3)
                      []
-@@ -848,29 +848,29 @@ def twisted_homology(self, n, reduced=False):
+@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
                      sage: # needs sage.graphs
                      sage: Y = simplicial_sets.Torus()
                      sage: Y.twisted_homology(1)
@@ -80,10 +80,10 @@ index e714a4571c4..a2b87a729d1 100644
                      [1 0 0 0 0]
                      [0 1 0 0 0]
 diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index 936edcc6ea4..c06a53d9afd 100644
+index e2d818e9480..84e6c4fcc9b 100644
 --- a/src/sage/combinat/matrices/latin.py
 +++ b/src/sage/combinat/matrices/latin.py
-@@ -2453,7 +2453,7 @@ def p3_group_bitrade_generators(p):
+@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
      EXAMPLES::
  
          sage: from sage.combinat.matrices.latin import *
@@ -93,7 +93,7 @@ index 936edcc6ea4..c06a53d9afd 100644
           (1,2,3)(4,7,8)(5,6,9),
           (1,9,2)(3,7,4)(5,8,6),
 diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 257b400f1c7..36423c756aa 100644
+index 61db70925e1..521289c7578 100644
 --- a/src/sage/groups/cubic_braid.py
 +++ b/src/sage/groups/cubic_braid.py
 @@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
@@ -106,7 +106,7 @@ index 257b400f1c7..36423c756aa 100644
               c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
               c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
 diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4bb52ee4efb..85f572fac6c 100644
+index 4ac2faa783b..7016d08381b 100644
 --- a/src/sage/groups/finitely_presented.py
 +++ b/src/sage/groups/finitely_presented.py
 @@ -1344,8 +1344,8 @@ def abelianization_map(self):
@@ -161,10 +161,10 @@ index 4bb52ee4efb..85f572fac6c 100644
              sage: G.characteristic_varieties(groebner=True)
              {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
 diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index c1f2683907b..d219e104a2c 100644
+index 5c153b93d4c..bd4afad2942 100644
 --- a/src/sage/groups/perm_gps/permgroup_named.py
 +++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3468,16 +3468,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: G = SmallPermutationGroup(12,4); G
          Group of order 12 and GAP Id 4 as a permutation group
          sage: G.gens()
@@ -186,7 +186,7 @@ index c1f2683907b..d219e104a2c 100644
          sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
          sage: all(SmallPermutationGroup(n,k).id() == [n,k]
          ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3486,11 +3484,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
+@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
          sage: H.is_abelian()
          False
          sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
diff --git a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch b/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
deleted file mode 100644
index e28fd857afcb75..00000000000000
--- a/srcpkgs/sagemath/patches/38250-numpy_2.0.patch
+++ /dev/null
@@ -1,587 +0,0 @@
-diff --git a/src/sage/arith/misc.py b/src/sage/arith/misc.py
-index 28f81d7b798..d184c52bf19 100644
---- a/src/sage/arith/misc.py
-+++ b/src/sage/arith/misc.py
-@@ -2277,7 +2277,7 @@ def power_mod(a, n, m):
- 
-         sage: from numpy import int32                                                   # needs numpy
-         sage: power_mod(int32(2), int32(390), int32(391))                               # needs numpy
--        285
-+        ...285...
-         sage: from gmpy2 import mpz
-         sage: power_mod(mpz(2), mpz(390), mpz(391))
-         mpz(285)
-diff --git a/src/sage/calculus/interpolators.pyx b/src/sage/calculus/interpolators.pyx
-index 221b52369e2..bb0be7bab0c 100644
---- a/src/sage/calculus/interpolators.pyx
-+++ b/src/sage/calculus/interpolators.pyx
-@@ -27,6 +27,9 @@ Development supported by NSF award No. 0702939.
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- cdef double TWOPI = 2*pi
- 
-diff --git a/src/sage/calculus/riemann.pyx b/src/sage/calculus/riemann.pyx
-index 6ec80d89aa7..c09d93c4260 100644
---- a/src/sage/calculus/riemann.pyx
-+++ b/src/sage/calculus/riemann.pyx
-@@ -44,6 +44,9 @@ from sage.calculus.integration import numerical_integral
- import numpy as np
- cimport numpy as np
- 
-+if int(np.version.short_version[0]) > 1:
-+    np.set_printoptions(legacy="1.25")
-+
- from math import pi
- from math import sin
- from math import cos
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b198fed0c0d..b3ebd206cd2 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -66,6 +66,9 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
-     r"""
-     TESTS::
- 
-+        sage: import numpy as np
-+        sage: if int(np.version.short_version[0]) > 1:
-+        ....:     np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/env.py b/src/sage/env.py
-index 722649ab3da..abb9b19f9e3 100644
---- a/src/sage/env.py
-+++ b/src/sage/env.py
-@@ -296,7 +296,7 @@ def sage_include_directories(use_sources=False):
-         sage: import sage.env
-         sage: sage.env.sage_include_directories()
-         ['...',
--         '.../numpy/core/include',
-+         '.../numpy/...core/include',
-          '.../include/python...']
- 
-     To check that C/C++ files are correctly found, we verify that we can
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index e100ba3ee23..2a03bb68f67 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -217,6 +217,9 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: spherical_harmonic(1, 1, pi/2, pi).n()  # abs tol 1e-14                   # needs sage.symbolic
-         0.345494149471335
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-+        sage: import numpy as np                                                        # needs scipy
-+        sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
-+        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/graphs/generators/classical_geometries.py b/src/sage/graphs/generators/classical_geometries.py
-index da04362eef3..957f88d2061 100644
---- a/src/sage/graphs/generators/classical_geometries.py
-+++ b/src/sage/graphs/generators/classical_geometries.py
-@@ -1315,7 +1315,7 @@ def CossidentePenttilaGraph(q):
- 
-     from sage.libs.gap.libgap import libgap
-     adj_list = libgap.function_factory("""function(q)
--        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x;
-+        local z, e, so, G, nu, G1, G0, B, T, s, O1, O2, x, sqo;
-         LoadPackage("grape");
-         G0:=SO(3,q^2);
-         so:=GeneratorsOfGroup(G0);
-diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py
-index 063931ae274..0bafbd00564 100644
---- a/src/sage/graphs/generic_graph.py
-+++ b/src/sage/graphs/generic_graph.py
-@@ -18420,6 +18420,9 @@ def shortest_path_all_pairs(self, by_weight=False, algorithm=None,
-                 M = self.adjacency_matrix(vertices=int_to_vertex)
- 
-             # We call the Floyd-Warshall method from SciPy
-+            import numpy  # to ensure numpy 2.0 compatibility
-+            if int(numpy.version.short_version[0]) > 1:
-+                numpy.set_printoptions(legacy="1.25")
-             from numpy import array as np_array
-             from scipy.sparse.csgraph import floyd_warshall
-             dd, pp = floyd_warshall(np_array(M), directed=self.is_directed(),
-diff --git a/src/sage/graphs/graph_generators_pyx.pyx b/src/sage/graphs/graph_generators_pyx.pyx
-index 033e8b22adc..04b20d3229b 100644
---- a/src/sage/graphs/graph_generators_pyx.pyx
-+++ b/src/sage/graphs/graph_generators_pyx.pyx
-@@ -57,7 +57,7 @@ def RandomGNP(n, p, bint directed=False, bint loops=False, seed=None):
- 
-         sage: from numpy import mean                                                    # needs numpy
-         sage: abs(mean([RandomGNP(200, .2).density() for i in range(30)]) - .2) < .001  # needs numpy
--        True
-+        ...True...
-         sage: RandomGNP(150, .2, loops=True)
-         Traceback (most recent call last):
-         ...
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index a810418389c..c38df5412f0 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -705,12 +705,15 @@ cdef class Matrix(Matrix0):
-         Type ``numpy.typecodes`` for a list of the possible
-         typecodes::
- 
--            sage: import numpy                                                          # needs numpy
--            sage: sorted(numpy.typecodes.items())                                       # needs numpy
-+            sage: import numpy                            # needs numpy
-+            sage: numpy.typecodes.items()                 # needs numpy # random
-             [('All', '?bhilqpBHILQPefdgFDGSUVOMm'), ('AllFloat', 'efdgFDG'),
--             ('AllInteger', 'bBhHiIlLqQpP'), ('Character', 'c'), ('Complex', 'FDG'),
--             ('Datetime', 'Mm'), ('Float', 'efdg'), ('Integer', 'bhilqp'),
--             ('UnsignedInteger', 'BHILQP')]
-+            ...
-+
-+        For instance, you can see possibilities for real floating point numbers::
-+
-+            sage: numpy.typecodes['Float']                # needs numpy
-+            'efdg'
- 
-         Alternatively, numpy automatically calls this function (via
-         the magic :meth:`__array__` method) to convert Sage matrices
-diff --git a/src/sage/modules/free_module_element.pyx b/src/sage/modules/free_module_element.pyx
-index d71d22ac1f7..b6f297a3510 100644
---- a/src/sage/modules/free_module_element.pyx
-+++ b/src/sage/modules/free_module_element.pyx
-@@ -555,7 +555,11 @@ def vector(arg0, arg1=None, arg2=None, sparse=None, immutable=False):
-         R = None
- 
-     try:
-+        import numpy
-         from numpy import ndarray
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-     except ImportError:
-         pass
-     else:
-@@ -1188,7 +1192,11 @@ cdef class FreeModuleElement(Vector):   # abstract base class
-             over Rational Field to numpy array of type <... 'float'>:
-             setting an array element with a sequence.
-         """
-+        import numpy
-         from numpy import array
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-+
-         try:
-             return array(self, dtype=dtype)
-         except ValueError as e:
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index e3d94d1746e..7ae8ca4966f 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -155,6 +155,10 @@ def find_root(f, a, b, xtol=10e-13, rtol=2.0**-50, maxiter=100, full_output=Fals
-         b = max(s_1, s_2)
- 
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     g = lambda x: float(f(x))
-     brentqRes = scipy.optimize.brentq(g, a, b,
-                                  full_output=full_output, xtol=xtol, rtol=rtol, maxiter=maxiter)
-@@ -288,6 +292,10 @@ def find_local_minimum(f, a, b, tol=1.48e-08, maxfun=500):
-     a = float(a)
-     b = float(b)
-     import scipy.optimize
-+    import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     xmin, fval, iter, funcalls = scipy.optimize.fminbound(f, a, b, full_output=1, xtol=tol, maxfun=maxfun)
-     return fval, xmin
- 
-@@ -376,6 +384,8 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-         sage: def rosen(x):  # The Rosenbrock function
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-@@ -393,6 +403,9 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-+
-     from scipy import optimize
-     if isinstance(func, Expression):
-         var_list = func.variables()
-@@ -530,6 +543,8 @@ def minimize_constrained(func,cons,x0,gradient=None,algorithm='default', **args)
-     from sage.structure.element import Expression
-     from sage.ext.fast_callable import fast_callable
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
-     from scipy import optimize
-     function_type = type(lambda x,y: x+y)
- 
-@@ -652,6 +667,8 @@ def find_fit(data, model, initial_guess=None, parameters=None, variables=None, s
-     ``lmdif`` and ``lmder`` algorithms.
-     """
-     import numpy
-+    if int(numpy.version.short_version[0]) > 1:
-+        numpy.set_printoptions(legacy="1.25")
- 
-     if not isinstance(data, numpy.ndarray):
-         try:
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index ac1dc79d802..23e2517ca56 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -53,6 +53,9 @@ def get_minmax_data(self):
- 
-         EXAMPLES::
- 
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/complex_plot.pyx b/src/sage/plot/complex_plot.pyx
-index f1f2671a803..4d71414e1c2 100644
---- a/src/sage/plot/complex_plot.pyx
-+++ b/src/sage/plot/complex_plot.pyx
-@@ -1282,15 +1282,13 @@ def rgb_to_hls(rgb):
-         raise ValueError("Last dimension of input array must be 3; "
-                          "shape {} was found.".format(rgb.shape))
-     in_shape = rgb.shape
--    rgb = np.array(
--        rgb, copy=False, dtype=np.dtype(float), ndmin=2
--    )
-+    rgb = np.asarray(rgb, dtype=np.dtype(float))
-     rgb_max = rgb.max(-1)
-     rgb_min = rgb.min(-1)
-     l = (rgb_max + rgb_min)/2.0  # lightness
- 
-     hls = np.zeros_like(rgb)
--    delta = rgb.ptp(-1)
-+    delta = np.ptp(rgb, -1)
-     s = np.zeros_like(delta)
- 
-     ipos = delta > 0
-diff --git a/src/sage/plot/graphics.py b/src/sage/plot/graphics.py
-index a84d162cb56..94f5db09d83 100644
---- a/src/sage/plot/graphics.py
-+++ b/src/sage/plot/graphics.py
-@@ -2754,7 +2754,7 @@ def matplotlib(self, filename=None,
-             sage: xmin, xmax = sub.get_xlim()
-             sage: ymin, ymax = sub.get_ylim()
-             sage: xmin > xmax, ymin > ymax
--            (True, True)
-+            (...True..., ...True...)
-         """
-         if not isinstance(ticks, (list, tuple)):
-             ticks = (ticks, None)
-diff --git a/src/sage/plot/histogram.py b/src/sage/plot/histogram.py
-index fa86a44bd0a..a585cacf9cd 100644
---- a/src/sage/plot/histogram.py
-+++ b/src/sage/plot/histogram.py
-@@ -92,6 +92,8 @@ def get_minmax_data(self):
-             {'xmax': 10.0, 'xmin': 3.0, 'ymax': 0.476190476190..., 'ymin': 0}
-         """
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
- 
-         # Extract these options (if they are not None) and pass them to
-         # histogram()
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index b583be32317..6be448f1e04 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -784,6 +784,9 @@ def _add_subplot(self, figure, index, **options):
-             True
-             sage: G.position(1)
-             (0.2, 0.3, 0.4, 0.1)
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1295,6 +1298,9 @@ def position(self, index):
-             sage: g1 = plot(sin(x), (x, -pi, pi))
-             sage: g2 = circle((0,1), 1.)
-             sage: G = graphics_array([g1, g2])
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/plot3d/implicit_surface.pyx b/src/sage/plot/plot3d/implicit_surface.pyx
-index ce0da48a4e0..f4d5059b620 100644
---- a/src/sage/plot/plot3d/implicit_surface.pyx
-+++ b/src/sage/plot/plot3d/implicit_surface.pyx
-@@ -468,6 +468,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.y_vertices.tolist()
-             [[[<1.0, 0.5, 0.0>, None]], [[None, None]]]
-             sage: cube_marcher.x_vertices.any() # This shouldn't affect the X vertices.
-+            ...
-         """
-         (self.y_vertices, self.y_vertices_swapped) = \
-             (self.y_vertices_swapped, self.y_vertices)
-@@ -574,6 +575,7 @@ cdef class MarchingCubesTriangles(MarchingCubes):
-             sage: cube_marcher.x_vertices.tolist()
-             [[None, None], [None, <1.5, 1.0, 1.0>]]
-             sage: cube_marcher.y_vertices.any() or cube_marcher.z_vertices.any() # This shouldn't affect the Y or Z vertices.
-+            ...
-         """
-         cdef bint has_prev = (_prev is not None)
-         cdef bint has_next = (_next is not None)
-diff --git a/src/sage/plot/scatter_plot.py b/src/sage/plot/scatter_plot.py
-index 4ad418f040b..781854d372c 100644
---- a/src/sage/plot/scatter_plot.py
-+++ b/src/sage/plot/scatter_plot.py
-@@ -63,9 +63,9 @@ def get_minmax_data(self):
-             sage: s = scatter_plot([[0,1],[2,4],[3.2,6]])
-             sage: d = s.get_minmax_data()
-             sage: d['xmin']
--            0.0
-+            ...0.0...
-             sage: d['ymin']
--            1.0
-+            ...1.0...
-         """
-         return {'xmin': self.xdata.min(),
-                 'xmax': self.xdata.max(),
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index 663d3aee70b..d2cb11088c7 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -71,6 +71,9 @@ def get_minmax_data(self):
-         EXAMPLES::
- 
-             sage: x, y = var('x y')
-+            sage: import numpy  # to ensure numpy 2.0 compatibility
-+            sage: if int(numpy.version.short_version[0]) > 1:
-+            ....:     numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/probability/probability_distribution.pyx b/src/sage/probability/probability_distribution.pyx
-index e2c71af9c25..59ba4a95ab6 100644
---- a/src/sage/probability/probability_distribution.pyx
-+++ b/src/sage/probability/probability_distribution.pyx
-@@ -140,6 +140,9 @@ cdef class ProbabilityDistribution:
-              1.8,
-              2.0]
-         """
-+        import numpy as np
-+        if int(np.version.short_version[0]) > 1:
-+            np.set_printoptions(legacy="1.25")
-         import pylab
-         ell = [float(self.get_random_element()) for _ in range(num_samples)]
-         S = pylab.hist(ell, bins, density=True)
-diff --git a/src/sage/rings/complex_double.pyx b/src/sage/rings/complex_double.pyx
-index c59a2b46d6f..b4dddebb4dc 100644
---- a/src/sage/rings/complex_double.pyx
-+++ b/src/sage/rings/complex_double.pyx
-@@ -2558,10 +2558,10 @@ cdef class ComplexToCDF(Morphism):
- 
-         sage: # needs numpy
-         sage: import numpy
--        sage: f = CDF.coerce_map_from(numpy.complex_)
--        sage: f(numpy.complex_(I))
-+        sage: f = CDF.coerce_map_from(numpy.complex128)
-+        sage: f(numpy.complex128(I))
-         1.0*I
--        sage: f(numpy.complex_(I)).parent()
-+        sage: f(numpy.complex128(I)).parent()
-         Complex Double Field
-     """
-     def __init__(self, R):
-@@ -2578,7 +2578,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: CDF(numpy.complex_(I))    # indirect doctest                          # needs numpy
-+            sage: CDF(numpy.complex128(I))    # indirect doctest                          # needs numpy
-             1.0*I
-         """
-         cdef ComplexDoubleElement z = <ComplexDoubleElement>ComplexDoubleElement.__new__(ComplexDoubleElement)
-@@ -2592,7 +2592,7 @@ cdef class ComplexToCDF(Morphism):
-         EXAMPLES::
- 
-             sage: import numpy                                                          # needs numpy
--            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex_)            # needs numpy
-+            sage: f = sage.rings.complex_double.ComplexToCDF(numpy.complex128)          # needs numpy
-             sage: f._repr_type()                                                        # needs numpy
-             'Native'
-         """
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index b4a1fa5039b..38c30f7627b 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -593,6 +593,8 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-         Test comparisons with numpy types (see :issue:`13386` and :issue:`18076`)::
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
-             True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
-diff --git a/src/sage/rings/polynomial/polynomial_element.pyx b/src/sage/rings/polynomial/polynomial_element.pyx
-index dcf2af7cdf2..c87eccd44f1 100644
---- a/src/sage/rings/polynomial/polynomial_element.pyx
-+++ b/src/sage/rings/polynomial/polynomial_element.pyx
-@@ -8851,7 +8851,7 @@ cdef class Polynomial(CommutativePolynomial):
-                          'you expect.')
- 
-                 import numpy
--                from numpy.linalg.linalg import LinAlgError
-+                from numpy.linalg import LinAlgError
-                 from sage.rings.complex_double import CDF
- 
-                 numpy_dtype = ('complex' if input_complex else 'double')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 95b472e912c..76fbfedab95 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -231,6 +231,8 @@ specified if given a non-interval and an interval::
- TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-+    sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
-+    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 8f240627e77..70ce616f92f 100644
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -77,6 +77,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -295,6 +297,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -317,6 +321,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -370,6 +376,8 @@ cdef class PeriodicRegion:
-         EXAMPLES::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -520,6 +528,8 @@ cdef class PeriodicRegion:
-         TESTS::
- 
-             sage: import numpy as np
-+            sage: if int(np.version.short_version[0]) > 1:
-+            ....:     np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index b2e6b301bf7..6937f6cb410 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -227,6 +227,8 @@ def std(v, bias=False):
- 
-         sage: # needs numpy
-         sage: import numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:
-+        ....:     numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -304,6 +306,8 @@ def variance(v, bias=False):
-         sage: variance([RIF(1.0103, 1.0103), RIF(2)])
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/stats/time_series.pyx b/src/sage/stats/time_series.pyx
-index 2e22ec45c69..23adae84fb4 100644
---- a/src/sage/stats/time_series.pyx
-+++ b/src/sage/stats/time_series.pyx
-@@ -1718,6 +1718,8 @@ cdef class TimeSeries:
-         if len(v0) == 1:
-             return v1[0]/v0[0]
-         import numpy
-+        if int(numpy.version.short_version[0]) > 1:
-+            numpy.set_printoptions(legacy="1.25")
-         coeffs = numpy.polyfit(v0,v1,1)
-         return coeffs[0]
- 
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index dfbd5ff82fa..955a256e9b4 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -520,6 +520,8 @@ cdef class CoercionModel:
-     Check that :issue:`8426` is fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 2cb2f09c715..cd89ad2a256 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -964,6 +964,9 @@ cdef class BuiltinFunction(Function):
-             mpc(real='0.83373002513114902', imag='-0.98889770576286506')
- 
-             sage: import numpy                                                          # needs numpy
-+            sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
-+            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-             sage: type(_)                                                               # needs numpy
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 501b0920898..5b007d9e5fd 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1162,6 +1162,8 @@ cdef class NumpyToSRMorphism(Morphism):
-     We check that :issue:`8949` and :issue:`9769` are fixed (see also :issue:`18076`)::
- 
-         sage: import numpy                                                              # needs numpy
-+        sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
-+        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch b/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
deleted file mode 100644
index db0ae9030623b6..00000000000000
--- a/srcpkgs/sagemath/patches/38344-ecm_7.0.6.patch
+++ /dev/null
@@ -1,43 +0,0 @@
-diff --git a/src/sage/interfaces/ecm.py b/src/sage/interfaces/ecm.py
-index 99287dec718..98011970404 100644
---- a/src/sage/interfaces/ecm.py
-+++ b/src/sage/interfaces/ecm.py
-@@ -508,7 +508,6 @@ def _find_factor(self, n, factor_digits, B1, **kwds):
-         """
-         n = self._validate(n)
-         kwds.setdefault('c', 1000000000)
--        kwds.setdefault('I', 1)
-         if factor_digits is not None:
-             B1 = self.recommended_B1(factor_digits)
-         kwds['one'] = True
-diff --git a/src/sage/libs/libecm.pyx b/src/sage/libs/libecm.pyx
-index 886a9b816e4..83fb7adaf8d 100644
---- a/src/sage/libs/libecm.pyx
-+++ b/src/sage/libs/libecm.pyx
-@@ -149,11 +149,13 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     Some special cases::
- 
-         sage: ecmfactor(1, 100)
--        (True, 1, ...)
-+        Traceback (most recent call last):
-+        ...
-+        ValueError: Input number (1) must be greater than 1
-         sage: ecmfactor(0, 100)
-         Traceback (most recent call last):
-         ...
--        ValueError: Input number (0) must be positive
-+        ValueError: Input number (0) must be greater than 1
-     """
-     cdef mpz_t n, f
-     cdef int res
-@@ -164,8 +166,8 @@ def ecmfactor(number, double B1, verbose=False, sigma=0):
-     sage_int_number = Integer(number)
-     sage_int_sigma = Integer(sigma)
- 
--    if number <= 0:
--        raise ValueError("Input number (%s) must be positive"%number)
-+    if number <= 1:
-+        raise ValueError("Input number (%s) must be greater than 1"%number)
- 
-     if verbose:
-         print("Performing one curve with B1=%1.0f" % B1)
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 28162dff8a38e1..5cab228f286365 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -19,7 +19,7 @@ get_pr() {
 	echo "curl -sL \"$url\" | filterdiff ... > \"$pr-$desc.patch\""
 	if [ -z "$dry" ]; then
 		curl -sL "$url" |
-			filterdiff -p1 -x src/setup.py -x build/* -x src/doc/* |
+			filterdiff -p1 -x src/setup.py -x environment* -x src/environment* -x build/* -x src/doc/* |
 			cat > "$pr-$desc.patch"
 	fi
 }
@@ -29,8 +29,6 @@ cd $(dirname "$0")
 
 get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
-get_pr 38250 "numpy 2.0"
-get_pr 38344 "ecm 7.0.6"
 
 #get_pr 37645 "fix doctest"
 #get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index b116e62bc67a5a..f5e1d8c68cfcbe 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,7 +1,7 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.4
-revision=3
+version=10.5.beta2
+revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
 build_style=python3-pep517
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f6579e85f33bd9bb6e9b991bfc4c49dab1e649858ed9ee41c7cec75cb92d4c62
+checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 7d53b5dc0d8be8db96aedf9d34edaba3d540a106 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 14 Aug 2024 00:12:02 -0300
Subject: [PATCH 03/11] sagemath: enable all cython warnings

---
 srcpkgs/sagemath/patches/37885-cython_warnings.patch | 12 ++++++++++++
 srcpkgs/sagemath/patches/get_patches                 |  2 +-
 2 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/sagemath/patches/37885-cython_warnings.patch

diff --git a/srcpkgs/sagemath/patches/37885-cython_warnings.patch b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
new file mode 100644
index 00000000000000..fa4b648cfc1577
--- /dev/null
+++ b/srcpkgs/sagemath/patches/37885-cython_warnings.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage_setup/command/sage_build_cython.py b/src/sage_setup/command/sage_build_cython.py
+index f4b1357c543..3435c196d49 100644
+--- a/src/sage_setup/command/sage_build_cython.py
++++ b/src/sage_setup/command/sage_build_cython.py
+@@ -226,6 +226,7 @@ def run(self):
+                 compiler_directives=self.cython_directives,
+                 compile_time_env=self.compile_time_env,
+                 create_extension=self.create_extension,
++                show_all_warnings=True,
+                 # Debugging
+                 gdb_debug=self.debug,
+                 output_dir=os.path.join(self.build_lib, "sage"),
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 5cab228f286365..c182576ea553cd 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -31,4 +31,4 @@ get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
 
 #get_pr 37645 "fix doctest"
-#get_pr 37885 "cython warnings"
+get_pr 37885 "cython warnings"

From 96d94d062bbc96ffc2110bc7057d27235214f579 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 20 Aug 2024 17:56:06 -0300
Subject: [PATCH 04/11] sagemath: patch for numpy 2.1

---
 srcpkgs/sagemath/patches/numpy_2.1a.patch |  8 +--
 srcpkgs/sagemath/patches/numpy_2.1b.patch | 70 +++++++++++------------
 2 files changed, 39 insertions(+), 39 deletions(-)

diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
index 30e2de99d84536..493c75e2f8f8e0 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1a.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1a.patch
@@ -1,14 +1,14 @@
-commit 241dc39bd0ba1c056f88bee46a0345d59093eaff
+commit d755b32cbed462abf01a1cd782ba57cb92fbf713
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Mon Aug 19 23:25:32 2024 -0300
 
     add copy parameter to numpy (needed for v2.1)
 
 diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index c38df5412f0..f587cef651a 100644
+index 3edb9ead54d..2c76fd1e557 100644
 --- a/src/sage/matrix/matrix1.pyx
 +++ b/src/sage/matrix/matrix1.pyx
-@@ -671,7 +671,7 @@ cdef class Matrix(Matrix0):
+@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
              entries = [[sib(v, 2) for v in row] for row in self.rows()]
              return sib.name('matrix')(self.base_ring(), entries)
  
@@ -17,7 +17,7 @@ index c38df5412f0..f587cef651a 100644
          """
          Return the Numpy matrix associated to this matrix.
  
-@@ -732,7 +732,7 @@ cdef class Matrix(Matrix0):
+@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
              (3, 4)
          """
          import numpy
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
index b77e28361d2e74..8dc0eec2b5a9d8 100644
--- a/srcpkgs/sagemath/patches/numpy_2.1b.patch
+++ b/srcpkgs/sagemath/patches/numpy_2.1b.patch
@@ -1,11 +1,11 @@
-commit 8b32fdb87725c1d67ffb51dadec1c331c7c35f3c
+commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
 Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
 Date:   Tue Aug 20 00:05:33 2024 -0300
 
     silence np.set_printoptions (for numpy 2.1)
 
 diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index b3ebd206cd2..48866824224 100644
+index 74a14fa1ecd..82e6c7eb3c8 100644
 --- a/src/sage/combinat/fully_packed_loop.py
 +++ b/src/sage/combinat/fully_packed_loop.py
 @@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
@@ -18,7 +18,7 @@ index b3ebd206cd2..48866824224 100644
          sage: _make_color_list(5)
          sage: _make_color_list(5, ['blue', 'red'])
 diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index 2a03bb68f67..30b56722e66 100644
+index 308171af3cd..6f66624ef87 100644
 --- a/src/sage/functions/special.py
 +++ b/src/sage/functions/special.py
 @@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
@@ -31,10 +31,10 @@ index 2a03bb68f67..30b56722e66 100644
          (0.3454941494713355-4.231083042742082e-17j)
  
 diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index 7ae8ca4966f..4cba22efdba 100644
+index b3e42a6a6a2..13ffa4d1789 100644
 --- a/src/sage/numerical/optimize.py
 +++ b/src/sage/numerical/optimize.py
-@@ -385,7 +385,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm="default",
+@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
          ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -44,7 +44,7 @@ index 7ae8ca4966f..4cba22efdba 100644
          sage: def rosen_der(x):
          ....:    xm = x[1r:-1r]
 diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index 23e2517ca56..7375dcd5d1c 100644
+index 02442f90ba4..1fe3f0b051a 100644
 --- a/src/sage/plot/arrow.py
 +++ b/src/sage/plot/arrow.py
 @@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
@@ -57,10 +57,10 @@ index 23e2517ca56..7375dcd5d1c 100644
              sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
              ....:                options={})
 diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index 6be448f1e04..004594b77c4 100644
+index d2f70b44526..2eaacc6879e 100644
 --- a/src/sage/plot/multigraphics.py
 +++ b/src/sage/plot/multigraphics.py
-@@ -786,7 +786,7 @@ class MultiGraphics(WithEqualityById, SageObject):
+@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
              (0.2, 0.3, 0.4, 0.1)
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -68,8 +68,8 @@ index 6be448f1e04..004594b77c4 100644
 +            ....:     _token = numpy.set_printoptions(legacy="1.25")
              sage: ax1.get_position().bounds  # tol 1.0e-13
              (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
- 
-@@ -1300,7 +1300,7 @@ class GraphicsArray(MultiGraphics):
+         """
+@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
              sage: G = graphics_array([g1, g2])
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -79,10 +79,10 @@ index 6be448f1e04..004594b77c4 100644
              (0.025045451349937315,
               0.03415488992713045,
 diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index d2cb11088c7..6d88517cc15 100644
+index b69a05b37bf..25e404bfc7d 100644
 --- a/src/sage/plot/streamline_plot.py
 +++ b/src/sage/plot/streamline_plot.py
-@@ -73,7 +73,7 @@ class StreamlinePlot(GraphicPrimitive):
+@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
              sage: x, y = var('x y')
              sage: import numpy  # to ensure numpy 2.0 compatibility
              sage: if int(numpy.version.short_version[0]) > 1:
@@ -92,20 +92,20 @@ index d2cb11088c7..6d88517cc15 100644
              sage: d['xmin']
              10.0
 diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 38c30f7627b..cfb8a5ff5f7 100644
+index 11811b9587f..8ce0f7f2683 100644
 --- a/src/sage/rings/integer.pyx
 +++ b/src/sage/rings/integer.pyx
-@@ -594,7 +594,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
- 
-             sage: import numpy                                                          # needs numpy
-             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
--            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
-             sage: numpy.int8('12') == 12                                                # needs numpy
+@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
+             sage: # needs numpy
+             sage: import numpy
+             sage: if int(numpy.version.short_version[0]) > 1:
+-            ....:     numpy.set_printoptions(legacy="1.25")
++            ....:     _token = numpy.set_printoptions(legacy="1.25")
+             sage: numpy.int8('12') == 12
              True
-             sage: 12 == numpy.int8('12')                                                # needs numpy
+             sage: 12 == numpy.int8('12')
 diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 76fbfedab95..57de30c9d18 100644
+index 11953a50ab5..6aafcceed89 100644
 --- a/src/sage/rings/real_mpfi.pyx
 +++ b/src/sage/rings/real_mpfi.pyx
 @@ -232,7 +232,7 @@ TESTS::
@@ -118,7 +118,7 @@ index 76fbfedab95..57de30c9d18 100644
      True
      sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
 diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 70ce616f92f..f604c6d3785 100644
+index 40b92ab23eb..3838bcccb8a 100755
 --- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 +++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
 @@ -78,7 +78,7 @@ cdef class PeriodicRegion:
@@ -130,7 +130,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -298,7 +298,7 @@ cdef class PeriodicRegion:
+@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -139,7 +139,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((10, 10))
              sage: data[1:4,1:4] = True
-@@ -322,7 +322,7 @@ cdef class PeriodicRegion:
+@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -148,7 +148,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
              sage: data = np.zeros((4, 4))
              sage: data[1,1] = True
-@@ -377,7 +377,7 @@ cdef class PeriodicRegion:
+@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -157,7 +157,7 @@ index 70ce616f92f..f604c6d3785 100644
              sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
  
              sage: data = np.zeros((20, 20))
-@@ -529,7 +529,7 @@ cdef class PeriodicRegion:
+@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
  
              sage: import numpy as np
              sage: if int(np.version.short_version[0]) > 1:
@@ -167,10 +167,10 @@ index 70ce616f92f..f604c6d3785 100644
              sage: data = np.zeros((4, 4))
              sage: data[1, 1] = True
 diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index 6937f6cb410..fb296e00fb6 100644
+index 47d890cf0ab..ba7f0cdb0f9 100644
 --- a/src/sage/stats/basic_stats.py
 +++ b/src/sage/stats/basic_stats.py
-@@ -228,7 +228,7 @@ def std(v, bias=False):
+@@ -222,7 +222,7 @@ def std(v, bias=False):
          sage: # needs numpy
          sage: import numpy
          sage: if int(numpy.version.short_version[0]) > 1:
@@ -179,7 +179,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: x = numpy.array([1,2,3,4,5])
          sage: std(x, bias=False)
          1.5811388300841898
-@@ -307,7 +307,7 @@ def variance(v, bias=False):
+@@ -299,7 +299,7 @@ def variance(v, bias=False):
          0.4897530450000000?
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
@@ -189,7 +189,7 @@ index 6937f6cb410..fb296e00fb6 100644
          sage: variance(x, bias=False)                                                   # needs numpy
          2.5
 diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index 955a256e9b4..e5ed6160b79 100644
+index cc15eff82e9..e32e7fd28b3 100644
 --- a/src/sage/structure/coerce.pyx
 +++ b/src/sage/structure/coerce.pyx
 @@ -521,7 +521,7 @@ cdef class CoercionModel:
@@ -202,10 +202,10 @@ index 955a256e9b4..e5ed6160b79 100644
          sage: # needs sage.rings.real_mpfr
          sage: x = polygen(RR)
 diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index cd89ad2a256..6fdf6d8ef23 100644
+index 362d01ea297..92bce28b032 100644
 --- a/src/sage/symbolic/function.pyx
 +++ b/src/sage/symbolic/function.pyx
-@@ -965,7 +965,7 @@ cdef class BuiltinFunction(Function):
+@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
  
              sage: import numpy                                                          # needs numpy
              sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
@@ -215,10 +215,10 @@ index cd89ad2a256..6fdf6d8ef23 100644
              sage: sin(numpy.int32(0))                                                   # needs numpy
              0.0
 diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 5b007d9e5fd..4a096d317e7 100644
+index 32afe8d3a62..63734e68f63 100644
 --- a/src/sage/symbolic/ring.pyx
 +++ b/src/sage/symbolic/ring.pyx
-@@ -1163,7 +1163,7 @@ cdef class NumpyToSRMorphism(Morphism):
+@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
  
          sage: import numpy                                                              # needs numpy
          sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy

From 957cb88a6e2398a873a2d900d5faba44f5c8ceaf Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 8 Sep 2024 09:35:16 -0300
Subject: [PATCH 05/11] nauty: update to 2.8.9.

---
 srcpkgs/nauty/patches/fix-runalltests.patch | 11 +++++++++++
 srcpkgs/nauty/template                      |  7 ++++---
 2 files changed, 15 insertions(+), 3 deletions(-)
 create mode 100644 srcpkgs/nauty/patches/fix-runalltests.patch

diff --git a/srcpkgs/nauty/patches/fix-runalltests.patch b/srcpkgs/nauty/patches/fix-runalltests.patch
new file mode 100644
index 00000000000000..34e1692cf6e6e3
--- /dev/null
+++ b/srcpkgs/nauty/patches/fix-runalltests.patch
@@ -0,0 +1,11 @@
+--- a/runalltests.in	2024-08-26 00:55:55.000000000 -0300
++++ b/runalltests.in	2024-09-08 09:30:04.032719770 -0300
+@@ -121,7 +121,7 @@
+ runonetest "./geng -q -TD6 10 | ./ransubg -qS765 -P9/10 | ./countg --NN,A,G,GG" "" nautestv.ans
+ runonetest "./genrang -q -P3 -S1234 70 1000 | ./countg --G,GG" "" nautestw.ans
+ runonetest "./genrang -q -P4 -z -S1234 70 500 | ./countg --G,GG" "" nautestx.ans
+-runonetest "./geng -q -bT 12 | ./ranlabg -qS7654 -m5 | uniqg -u" "" nautesty.ans
++runonetest "./geng -q -bT 12 | ./ranlabg -qS7654 -m5 | ./uniqg -u" "" nautesty.ans
+ 
+ echo " "
+ 
diff --git a/srcpkgs/nauty/template b/srcpkgs/nauty/template
index 6f85b1d064d4e5..aea4e4a6eb0294 100644
--- a/srcpkgs/nauty/template
+++ b/srcpkgs/nauty/template
@@ -1,18 +1,18 @@
 # Template file for 'nauty'
 pkgname=nauty
-version=2.8.8
+version=2.8.9
 revision=1
 build_style=gnu-configure
 make_install_args="includedir=/usr/include/nauty
  pkgconfigexecdir=/usr/lib/pkgconfig"
-hostmakedepends="automake"
+hostmakedepends="automake libtool"
 short_desc="Compute the automorphism groups of graphs and digraphs"
 maintainer="Gonzalo Tornaría <tornaria@cmat.edu.uy>"
 license="Apache-2.0"
 homepage="https://pallini.di.uniroma1.it/"
 changelog="https://pallini.di.uniroma1.it/changes24-28.txt"
 distfiles="https://pallini.di.uniroma1.it/nauty${version//./_}.tar.gz"
-checksum=159d2156810a6bb240410cd61eb641add85088d9f15c888cdaa37b8681f929ce
+checksum=c97ab42bf48796a86a598bce3e9269047ca2b32c14fc23e07208a244fe52c4ee
 
 build_options="native_build"
 
@@ -21,6 +21,7 @@ if [ -z "$build_option_native_build" ]; then
 fi
 
 pre_configure() {
+	aclocal
 	autoreconf -fi
 }
 

From 1c1032e91f22c617773f3aa8c1ac9135831624c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 7 Sep 2024 14:32:41 -0300
Subject: [PATCH 06/11] sagemath: update to 10.5.beta3.

---
 .../sagemath/patches/36641-sympy_1.13.patch   | 60 -------------------
 .../sagemath/patches/38572-nauty_2.8.9.patch  | 13 ++++
 srcpkgs/sagemath/patches/get_patches          |  4 +-
 srcpkgs/sagemath/template                     |  4 +-
 4 files changed, 17 insertions(+), 64 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/36641-sympy_1.13.patch
 create mode 100644 srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch

diff --git a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch b/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
deleted file mode 100644
index 01e859ad023f4d..00000000000000
--- a/srcpkgs/sagemath/patches/36641-sympy_1.13.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py
-index 823a0d14a41..de1c8531814 100644
---- a/src/sage/doctest/forker.py
-+++ b/src/sage/doctest/forker.py
-@@ -150,14 +150,15 @@ def init_sage(controller=None):
-         sage: from sympy.printing.pretty.pretty import PrettyPrinter
-         sage: s = sympify('+x^'.join(str(i) for i in range(30)))
-         sage: print(PrettyPrinter(settings={'wrap_line': True}).doprint(s))
--         29    28    27    26    25    24    23    22    21    20    19    18    17
--        x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   +
-+         29    28    27    26    25    24    23    22    21    20    19    18    17    ↪
-+        x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   + x   +  ↪
-         <BLANKLINE>
--         16    15    14    13    12    11    10    9    8    7    6    5    4    3
--        x   + x   + x   + x   + x   + x   + x   + x  + x  + x  + x  + x  + x  + x  + x
-+        ↪  16    15    14    13    12    11    10    9    8    7    6    5    4    3   ↪
-+        ↪ x   + x   + x   + x   + x   + x   + x   + x  + x  + x  + x  + x  + x  + x  + ↪
-         <BLANKLINE>
--        2
--          + x
-+        ↪   2
-+        ↪  x  + x
-+
- 
-     The displayhook sorts dictionary keys to simplify doctesting of
-     dictionary output::
-diff --git a/src/sage/functions/hypergeometric.py b/src/sage/functions/hypergeometric.py
-index ade7836b310..eb5c6665c0d 100644
---- a/src/sage/functions/hypergeometric.py
-+++ b/src/sage/functions/hypergeometric.py
-@@ -124,7 +124,7 @@
-     sage: maxima(hypergeometric([1, 1, 1], [3, 3, 3], x))                               # needs sage.symbolic
-     hypergeometric([1,1,1],[3,3,3],_SAGE_VAR_x)
-     sage: hypergeometric((5, 4), (4, 4), 3)._sympy_()                                   # needs sympy sage.symbolic
--    hyper((5, 4), (4, 4), 3)
-+    hyper((5,), (4,), 3)
-     sage: hypergeometric((5, 4), (4, 4), 3)._mathematica_init_()                        # needs sage.symbolic
-     'HypergeometricPFQ[{5,4},{4,4},3]'
- 
-diff --git a/src/sage/typeset/ascii_art.py b/src/sage/typeset/ascii_art.py
-index 83d92af8959..e470e2bd88d 100644
---- a/src/sage/typeset/ascii_art.py
-+++ b/src/sage/typeset/ascii_art.py
-@@ -44,11 +44,12 @@
-     sage: shell.run_cell('%display ascii_art')
-     sage: shell.run_cell("i = var('i')")                                                # needs sage.symbolic
-     sage: shell.run_cell('sum(factorial(i)*x^i, i, 0, 10)')                             # needs sage.symbolic
--             10           9          8         7        6        5       4      3
--    3628800*x   + 362880*x  + 40320*x  + 5040*x  + 720*x  + 120*x  + 24*x  + 6*x
-+             10           9          8         7        6        5       4      3  >
-+    3628800*x   + 362880*x  + 40320*x  + 5040*x  + 720*x  + 120*x  + 24*x  + 6*x   >
-     <BLANKLINE>
--         2
--    + 2*x  + x + 1
-+    >      2
-+    > + 2*x  + x + 1
-+
-     sage: shell.run_cell('3/(7*x)')                                                     # needs sage.symbolic
-      3
-     ---
diff --git a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
new file mode 100644
index 00000000000000..5f75a8bef5556a
--- /dev/null
+++ b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
@@ -0,0 +1,13 @@
+diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
+index e6e5312b8a8..aa10d15d4d8 100644
+--- a/src/sage/graphs/generators/families.py
++++ b/src/sage/graphs/generators/families.py
+@@ -3710,7 +3710,7 @@ def nauty_gentreeg(options='', debug=False):
+         ...
+         ValueError: wrong format of parameter options
+         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
+-        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
++        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n... [res/mod] ...
+         sage: list(graphs.nauty_gentreeg("3", debug=True))
+         ['>A ...gentreeg ...\n', Graph on 3 vertices]
+     """
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index c182576ea553cd..8f540dad14bfd1 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -1,6 +1,6 @@
 #! /bin/sh
 
-version=10.4
+version=10.5
 
 URL_BASE_PR="https://github.com/sagemath/sage/pull/"
 URL_BASE_COMPARE="https://github.com/sagemath/sage/compare/${version}..."
@@ -27,8 +27,8 @@ get_pr() {
 # run from patches dir
 cd $(dirname "$0")
 
-get_pr 36641 "sympy 1.13"
 get_pr 37884 "gap 4.13.1"
+get_pr 38572 "nauty 2.8.9"
 
 #get_pr 37645 "fix doctest"
 get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index f5e1d8c68cfcbe..709a3ea4262101 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta2
+version=10.5.beta3
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=0fe0c82dd6959951fc07d55737d270290f64947e183a403ca25709e21b751dee
+checksum=cbf3614c1b9be5f0a0756b0a5480c2ebfa663bd87bd66eefd162a755979bcb3d
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 91e2bbb98c7707f436c090192396a097909510d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 22 Sep 2024 08:19:39 -0300
Subject: [PATCH 07/11] sagemath: update to 10.5.beta5.

---
 .../sagemath/patches/38572-nauty_2.8.9.patch  |  13 -
 srcpkgs/sagemath/patches/numpy_2.1a.patch     |  28 ---
 srcpkgs/sagemath/patches/numpy_2.1b.patch     | 229 ------------------
 srcpkgs/sagemath/template                     |   4 +-
 4 files changed, 2 insertions(+), 272 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
 delete mode 100644 srcpkgs/sagemath/patches/numpy_2.1a.patch
 delete mode 100644 srcpkgs/sagemath/patches/numpy_2.1b.patch

diff --git a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch b/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
deleted file mode 100644
index 5f75a8bef5556a..00000000000000
--- a/srcpkgs/sagemath/patches/38572-nauty_2.8.9.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/sage/graphs/generators/families.py b/src/sage/graphs/generators/families.py
-index e6e5312b8a8..aa10d15d4d8 100644
---- a/src/sage/graphs/generators/families.py
-+++ b/src/sage/graphs/generators/families.py
-@@ -3710,7 +3710,7 @@ def nauty_gentreeg(options='', debug=False):
-         ...
-         ValueError: wrong format of parameter options
-         sage: list(graphs.nauty_gentreeg("3 -x", debug=True))
--        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n [res/mod] ...
-+        ['>E Usage: ...gentreeg [-D#] [-Z#:#] [-ulps] [-q] n... [res/mod] ...
-         sage: list(graphs.nauty_gentreeg("3", debug=True))
-         ['>A ...gentreeg ...\n', Graph on 3 vertices]
-     """
diff --git a/srcpkgs/sagemath/patches/numpy_2.1a.patch b/srcpkgs/sagemath/patches/numpy_2.1a.patch
deleted file mode 100644
index 493c75e2f8f8e0..00000000000000
--- a/srcpkgs/sagemath/patches/numpy_2.1a.patch
+++ /dev/null
@@ -1,28 +0,0 @@
-commit d755b32cbed462abf01a1cd782ba57cb92fbf713
-Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
-Date:   Mon Aug 19 23:25:32 2024 -0300
-
-    add copy parameter to numpy (needed for v2.1)
-
-diff --git a/src/sage/matrix/matrix1.pyx b/src/sage/matrix/matrix1.pyx
-index 3edb9ead54d..2c76fd1e557 100644
---- a/src/sage/matrix/matrix1.pyx
-+++ b/src/sage/matrix/matrix1.pyx
-@@ -670,7 +670,7 @@ cdef class Matrix(Matrix0):
-             entries = [[sib(v, 2) for v in row] for row in self.rows()]
-             return sib.name('matrix')(self.base_ring(), entries)
- 
--    def numpy(self, dtype=None):
-+    def numpy(self, dtype=None, copy=True):
-         """
-         Return the Numpy matrix associated to this matrix.
- 
-@@ -731,7 +731,7 @@ cdef class Matrix(Matrix0):
-             (3, 4)
-         """
-         import numpy
--        A = numpy.matrix(self.list(), dtype=dtype)
-+        A = numpy.matrix(self.list(), dtype=dtype, copy=copy)
-         return numpy.resize(A,(self.nrows(), self.ncols()))
- 
-     # Define the magic "__array__" function so that numpy.array(m) can convert
diff --git a/srcpkgs/sagemath/patches/numpy_2.1b.patch b/srcpkgs/sagemath/patches/numpy_2.1b.patch
deleted file mode 100644
index 8dc0eec2b5a9d8..00000000000000
--- a/srcpkgs/sagemath/patches/numpy_2.1b.patch
+++ /dev/null
@@ -1,229 +0,0 @@
-commit 8260d18c3cf8e356db3d95fc46f6e68f75b453fd
-Author: Gonzalo Tornaría <tornaria@cmat.edu.uy>
-Date:   Tue Aug 20 00:05:33 2024 -0300
-
-    silence np.set_printoptions (for numpy 2.1)
-
-diff --git a/src/sage/combinat/fully_packed_loop.py b/src/sage/combinat/fully_packed_loop.py
-index 74a14fa1ecd..82e6c7eb3c8 100644
---- a/src/sage/combinat/fully_packed_loop.py
-+++ b/src/sage/combinat/fully_packed_loop.py
-@@ -68,7 +68,7 @@ def _make_color_list(n, colors=None, color_map=None, randomize=False):
- 
-         sage: import numpy as np
-         sage: if int(np.version.short_version[0]) > 1:
--        ....:     np.set_printoptions(legacy="1.25")
-+        ....:     _token = np.set_printoptions(legacy="1.25")
-         sage: from sage.combinat.fully_packed_loop import _make_color_list
-         sage: _make_color_list(5)
-         sage: _make_color_list(5, ['blue', 'red'])
-diff --git a/src/sage/functions/special.py b/src/sage/functions/special.py
-index 308171af3cd..6f66624ef87 100644
---- a/src/sage/functions/special.py
-+++ b/src/sage/functions/special.py
-@@ -219,7 +219,7 @@ class SphericalHarmonic(BuiltinFunction):
-         sage: from scipy.special import sph_harm  # NB: arguments x and y are swapped   # needs scipy
-         sage: import numpy as np                                                        # needs scipy
-         sage: if int(np.version.short_version[0]) > 1:                                  # needs scipy
--        ....:     np.set_printoptions(legacy="1.25")                                    # needs scipy
-+        ....:     _token = np.set_printoptions(legacy="1.25")                           # needs scipy
-         sage: sph_harm(1, 1, pi.n(), (pi/2).n())  # abs tol 1e-14                       # needs scipy sage.symbolic
-         (0.3454941494713355-4.231083042742082e-17j)
- 
-diff --git a/src/sage/numerical/optimize.py b/src/sage/numerical/optimize.py
-index b3e42a6a6a2..13ffa4d1789 100644
---- a/src/sage/numerical/optimize.py
-+++ b/src/sage/numerical/optimize.py
-@@ -381,7 +381,7 @@ def minimize(func, x0, gradient=None, hessian=None, algorithm='default',
-         ....:    return sum(100.0r*(x[1r:]-x[:-1r]**2.0r)**2.0r + (1r-x[:-1r])**2.0r)
-         sage: import numpy
-         sage: if int(numpy.version.short_version[0]) > 1:
--        ....:     numpy.set_printoptions(legacy="1.25")
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")
-         sage: from numpy import zeros
-         sage: def rosen_der(x):
-         ....:    xm = x[1r:-1r]
-diff --git a/src/sage/plot/arrow.py b/src/sage/plot/arrow.py
-index 02442f90ba4..1fe3f0b051a 100644
---- a/src/sage/plot/arrow.py
-+++ b/src/sage/plot/arrow.py
-@@ -55,7 +55,7 @@ class CurveArrow(GraphicPrimitive):
- 
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: from sage.plot.arrow import CurveArrow
-             sage: b = CurveArrow(path=[[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],
-             ....:                options={})
-diff --git a/src/sage/plot/multigraphics.py b/src/sage/plot/multigraphics.py
-index d2f70b44526..2eaacc6879e 100644
---- a/src/sage/plot/multigraphics.py
-+++ b/src/sage/plot/multigraphics.py
-@@ -766,7 +766,7 @@ class MultiGraphics(WithEqualityById, SageObject):
-             (0.2, 0.3, 0.4, 0.1)
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: ax1.get_position().bounds  # tol 1.0e-13
-             (0.2, 0.3, 0.4000000000000001, 0.10000000000000003)
-         """
-@@ -1269,7 +1269,7 @@ class GraphicsArray(MultiGraphics):
-             sage: G = graphics_array([g1, g2])
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: G.position(0)  # tol 5.0e-3
-             (0.025045451349937315,
-              0.03415488992713045,
-diff --git a/src/sage/plot/streamline_plot.py b/src/sage/plot/streamline_plot.py
-index b69a05b37bf..25e404bfc7d 100644
---- a/src/sage/plot/streamline_plot.py
-+++ b/src/sage/plot/streamline_plot.py
-@@ -72,7 +72,7 @@ class StreamlinePlot(GraphicPrimitive):
-             sage: x, y = var('x y')
-             sage: import numpy  # to ensure numpy 2.0 compatibility
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: d = streamline_plot((.01*x, x+y), (x,10,20), (y,10,20))[0].get_minmax_data()
-             sage: d['xmin']
-             10.0
-diff --git a/src/sage/rings/integer.pyx b/src/sage/rings/integer.pyx
-index 11811b9587f..8ce0f7f2683 100644
---- a/src/sage/rings/integer.pyx
-+++ b/src/sage/rings/integer.pyx
-@@ -595,7 +595,7 @@ cdef class Integer(sage.structure.element.EuclideanDomainElement):
-             sage: # needs numpy
-             sage: import numpy
-             sage: if int(numpy.version.short_version[0]) > 1:
--            ....:     numpy.set_printoptions(legacy="1.25")
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")
-             sage: numpy.int8('12') == 12
-             True
-             sage: 12 == numpy.int8('12')
-diff --git a/src/sage/rings/real_mpfi.pyx b/src/sage/rings/real_mpfi.pyx
-index 11953a50ab5..6aafcceed89 100644
---- a/src/sage/rings/real_mpfi.pyx
-+++ b/src/sage/rings/real_mpfi.pyx
-@@ -232,7 +232,7 @@ TESTS::
- 
-     sage: import numpy                                                                  # needs numpy
-     sage: if int(numpy.version.short_version[0]) > 1:                                   # needs numpy
--    ....:     numpy.set_printoptions(legacy="1.25")                                     # needs numpy
-+    ....:     _token = numpy.set_printoptions(legacy="1.25")                            # needs numpy
-     sage: RIF(2) == numpy.int8('2')                                                     # needs numpy
-     True
-     sage: numpy.int8('2') == RIF(2)                                                     # needs numpy
-diff --git a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-index 40b92ab23eb..3838bcccb8a 100755
---- a/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-+++ b/src/sage/schemes/elliptic_curves/period_lattice_region.pyx
-@@ -78,7 +78,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: PeriodicRegion(CDF(2), CDF(2*I), data).is_empty()
-@@ -296,7 +296,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((10, 10))
-             sage: data[1:4,1:4] = True
-@@ -320,7 +320,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1,1] = True
-@@ -375,7 +375,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
- 
-             sage: data = np.zeros((20, 20))
-@@ -528,7 +528,7 @@ cdef class PeriodicRegion:
- 
-             sage: import numpy as np
-             sage: if int(np.version.short_version[0]) > 1:
--            ....:     np.set_printoptions(legacy="1.25")
-+            ....:     _token = np.set_printoptions(legacy="1.25")
-             sage: from sage.schemes.elliptic_curves.period_lattice_region import PeriodicRegion
-             sage: data = np.zeros((4, 4))
-             sage: data[1, 1] = True
-diff --git a/src/sage/stats/basic_stats.py b/src/sage/stats/basic_stats.py
-index 47d890cf0ab..ba7f0cdb0f9 100644
---- a/src/sage/stats/basic_stats.py
-+++ b/src/sage/stats/basic_stats.py
-@@ -222,7 +222,7 @@ def std(v, bias=False):
-         sage: # needs numpy
-         sage: import numpy
-         sage: if int(numpy.version.short_version[0]) > 1:
--        ....:     numpy.set_printoptions(legacy="1.25")
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")
-         sage: x = numpy.array([1,2,3,4,5])
-         sage: std(x, bias=False)
-         1.5811388300841898
-@@ -299,7 +299,7 @@ def variance(v, bias=False):
-         0.4897530450000000?
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
-         sage: x = numpy.array([1,2,3,4,5])                                              # needs numpy
-         sage: variance(x, bias=False)                                                   # needs numpy
-         2.5
-diff --git a/src/sage/structure/coerce.pyx b/src/sage/structure/coerce.pyx
-index cc15eff82e9..e32e7fd28b3 100644
---- a/src/sage/structure/coerce.pyx
-+++ b/src/sage/structure/coerce.pyx
-@@ -521,7 +521,7 @@ cdef class CoercionModel:
- 
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
- 
-         sage: # needs sage.rings.real_mpfr
-         sage: x = polygen(RR)
-diff --git a/src/sage/symbolic/function.pyx b/src/sage/symbolic/function.pyx
-index 362d01ea297..92bce28b032 100644
---- a/src/sage/symbolic/function.pyx
-+++ b/src/sage/symbolic/function.pyx
-@@ -962,7 +962,7 @@ cdef class BuiltinFunction(Function):
- 
-             sage: import numpy                                                          # needs numpy
-             sage: if int(numpy.version.short_version[0]) > 1:                           # needs numpy
--            ....:     numpy.set_printoptions(legacy="1.25")                             # needs numpy
-+            ....:     _token = numpy.set_printoptions(legacy="1.25")                    # needs numpy
- 
-             sage: sin(numpy.int32(0))                                                   # needs numpy
-             0.0
-diff --git a/src/sage/symbolic/ring.pyx b/src/sage/symbolic/ring.pyx
-index 32afe8d3a62..63734e68f63 100644
---- a/src/sage/symbolic/ring.pyx
-+++ b/src/sage/symbolic/ring.pyx
-@@ -1154,7 +1154,7 @@ cdef class NumpyToSRMorphism(Morphism):
- 
-         sage: import numpy                                                              # needs numpy
-         sage: if int(numpy.version.short_version[0]) > 1:                               # needs numpy
--        ....:     numpy.set_printoptions(legacy="1.25")                                 # needs numpy
-+        ....:     _token = numpy.set_printoptions(legacy="1.25")                        # needs numpy
-         sage: f(x) = x^2
-         sage: f(numpy.int8('2'))                                                        # needs numpy
-         4
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 709a3ea4262101..4face5e8f7ad84 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta3
+version=10.5.beta5
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=cbf3614c1b9be5f0a0756b0a5480c2ebfa663bd87bd66eefd162a755979bcb3d
+checksum=af4e8215043cd5376adea87f37928b94863561e36cba2171dab48ea984f7f259
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 296ec0fdc151e67a541387e4954be1d4a73a513b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sun, 29 Sep 2024 22:24:40 -0300
Subject: [PATCH 08/11] sagemath: update to 10.5.beta6.

---
 srcpkgs/sagemath/patches/get_patches | 2 +-
 srcpkgs/sagemath/template            | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 8f540dad14bfd1..381c307a3e962a 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -28,7 +28,7 @@ get_pr() {
 cd $(dirname "$0")
 
 get_pr 37884 "gap 4.13.1"
-get_pr 38572 "nauty 2.8.9"
+#get_pr 38572 "nauty 2.8.9"
 
 #get_pr 37645 "fix doctest"
 get_pr 37885 "cython warnings"
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index 4face5e8f7ad84..fb806ca641d378 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta5
+version=10.5.beta6
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=af4e8215043cd5376adea87f37928b94863561e36cba2171dab48ea984f7f259
+checksum=f95f196142d7abf091185e31d8023091c5746a9e3d2321d906161c65f944fa40
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 76f44bc40fb4c8a13545656de73a73337336bef0 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Tue, 15 Oct 2024 15:30:11 -0300
Subject: [PATCH 09/11] sagemath: update to 10.5.beta7.

---
 srcpkgs/sagemath/template | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index fb806ca641d378..d19d4ac007f9ba 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta6
+version=10.5.beta7
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=f95f196142d7abf091185e31d8023091c5746a9e3d2321d906161c65f944fa40
+checksum=b98a883aab3b6f551243bc3cffb6825c92f6faf86604e9a9cc8f38cfb9af2f32
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

From 041826e8f89a9b6c92985182eb6e79b12d19ed81 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 26 Oct 2024 19:06:21 -0300
Subject: [PATCH 10/11] python3-Cython: new alternative fix for 6122, taken
 from 6430

---
 srcpkgs/python3-Cython/patches/fix-regression.patch | 12 +++++++++---
 srcpkgs/python3-Cython/template                     |  2 +-
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/srcpkgs/python3-Cython/patches/fix-regression.patch b/srcpkgs/python3-Cython/patches/fix-regression.patch
index f5957cfa59c2f5..5a29e6a5143ed9 100644
--- a/srcpkgs/python3-Cython/patches/fix-regression.patch
+++ b/srcpkgs/python3-Cython/patches/fix-regression.patch
@@ -1,9 +1,11 @@
 Revert https://github.com/cython/cython/pull/6124 which causes a
 serious regression, e.g. sagemath FTBS with cython 3.0.11
 
+Source: https://github.com/cython/cython/pull/6430
+
 --- a/Cython/Compiler/Nodes.py
 +++ b/Cython/Compiler/Nodes.py
-@@ -710,10 +710,8 @@ class CFuncDeclaratorNode(CDeclaratorNode):
+@@ -717,10 +717,8 @@ def analyse(self, return_type, env, nonempty=0, directive_locals=None, visibilit
                  and not self.has_explicit_exc_clause
                  and self.exception_check
                  and visibility != 'extern'):
@@ -15,11 +17,15 @@ serious regression, e.g. sagemath FTBS with cython 3.0.11
              warning(self.pos,
                      "Implicit noexcept declaration is deprecated."
                      " Function declaration should contain 'noexcept' keyword.",
-@@ -3128,6 +3126,7 @@ class DefNode(FuncDefNode):
+@@ -3128,6 +3126,11 @@ def as_cfunction(self, cfunc=None, scope=None, overridable=True, returns=None, e
              if scope is None:
                  scope = cfunc.scope
              cfunc_type = cfunc.type
-+            has_explicit_exc_clause=True
++            if cfunc_type.exception_check:
++                # this ensures `legacy_implicit_noexcept` does not trigger
++                # as it would result in a mismatch
++                # (declaration with except, definition with implicit noexcept)
++                has_explicit_exc_clause = True
              if len(self.args) != len(cfunc_type.args) or cfunc_type.has_varargs:
                  error(self.pos, "wrong number of arguments")
                  error(cfunc.pos, "previous declaration here")
diff --git a/srcpkgs/python3-Cython/template b/srcpkgs/python3-Cython/template
index faec5722ae171a..a01702f0747d10 100644
--- a/srcpkgs/python3-Cython/template
+++ b/srcpkgs/python3-Cython/template
@@ -1,7 +1,7 @@
 # Template file for 'python3-Cython'
 pkgname=python3-Cython
 version=3.0.11
-revision=2
+revision=3
 build_style=python3-module
 hostmakedepends="python3-setuptools"
 makedepends="python3-devel"

From 06c01ba6cef7e3216a6d041a12a6af349b63c008 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Sat, 26 Oct 2024 18:59:52 -0300
Subject: [PATCH 11/11] sagemath: update to 10.5.beta8.

---
 .../sagemath/patches/37884-gap_4.13.1.patch   | 203 ------------------
 .../sagemath/patches/38873-fix_doctest.patch  |  25 +++
 srcpkgs/sagemath/patches/get_patches          |   3 +-
 srcpkgs/sagemath/patches/revert-38826.patch   |  26 +++
 srcpkgs/sagemath/template                     |   4 +-
 5 files changed, 55 insertions(+), 206 deletions(-)
 delete mode 100644 srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
 create mode 100644 srcpkgs/sagemath/patches/38873-fix_doctest.patch
 create mode 100644 srcpkgs/sagemath/patches/revert-38826.patch

diff --git a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch b/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
deleted file mode 100644
index 321e0a94487da3..00000000000000
--- a/srcpkgs/sagemath/patches/37884-gap_4.13.1.patch
+++ /dev/null
@@ -1,203 +0,0 @@
-diff --git a/src/sage/algebras/fusion_rings/fusion_double.py b/src/sage/algebras/fusion_rings/fusion_double.py
-index 71277561331..3b681d75d3b 100644
---- a/src/sage/algebras/fusion_rings/fusion_double.py
-+++ b/src/sage/algebras/fusion_rings/fusion_double.py
-@@ -133,7 +133,7 @@ class FusionDouble(CombinatorialFreeModule):
-         sage: G = SmallPermutationGroup(16,9)
-         sage: F = FusionDouble(G, prefix='b', inject_variables=True)
-         sage: b13^2 # long time (4s)
--        b0 + b2 + b4 + b15 + b16 + b17 + b18 + b24 + b26 + b27
-+        b0 + b3 + b4
-     """
-     @staticmethod
-     def __classcall_private__(cls, G, prefix='s', inject_variables=False):
-diff --git a/src/sage/categories/simplicial_sets.py b/src/sage/categories/simplicial_sets.py
-index aabd3cdbb4f..14bebdcd080 100644
---- a/src/sage/categories/simplicial_sets.py
-+++ b/src/sage/categories/simplicial_sets.py
-@@ -591,9 +591,9 @@ def _canonical_twisting_operator(self):
-                     sage: X = simplicial_sets.Torus()
-                     sage: d = X._canonical_twisting_operator()
-                     sage: d
--                    {(s_0 v_0, sigma_1): f3, (sigma_1, s_0 v_0): f2*f3^-1, (sigma_1, sigma_1): f2}
-+                    {(s_0 v_0, sigma_1): f2, (sigma_1, s_0 v_0): f1*f2^-1, (sigma_1, sigma_1): f1}
-                     sage: list(d.values())[0].parent()
--                    Multivariate Laurent Polynomial Ring in f2, f3 over Integer Ring
-+                    Multivariate Laurent Polynomial Ring in f1, f2 over Integer Ring
-                     sage: Y = simplicial_sets.RealProjectiveSpace(2)
-                     sage: d2 = Y._canonical_twisting_operator()
-                     sage: d2
-@@ -674,10 +674,10 @@ def twisted_chain_complex(self, twisting_operator=None, dimensions=None, augment
-                     sage: X = simplicial_sets.Torus()
-                     sage: C = X.twisted_chain_complex()
-                     sage: C.differential(1)
--                    [      f3 - 1 f2*f3^-1 - 1       f2 - 1]
-+                    [      f2 - 1 f1*f2^-1 - 1       f1 - 1]
-                     sage: C.differential(2)
--                    [       1 f2*f3^-1]
--                    [      f3        1]
-+                    [       1 f1*f2^-1]
-+                    [      f2        1]
-                     [      -1       -1]
-                     sage: C.differential(3)
-                     []
-@@ -844,29 +844,29 @@ def twisted_homology(self, n, reduced=False):
-                     sage: # needs sage.graphs
-                     sage: Y = simplicial_sets.Torus()
-                     sage: Y.twisted_homology(1)
--                    Quotient module by Submodule of Ambient free module of rank 5 over the integral domain Multivariate Polynomial Ring in f2, f2inv, f3, f3inv over Integer Ring
-+                    Quotient module by Submodule of Ambient free module of rank 5 over the integral domain Multivariate Polynomial Ring in f1, f1inv, f2, f2inv over Integer Ring
-                     Generated by the rows of the matrix:
-                     [           1            0            0            0            0]
-                     [           0            1            0            0            0]
-                     [           0            0            1            0            0]
-                     [           0            0            0            1            0]
-                     [           0            0            0            0            1]
-+                    [f1*f1inv - 1            0            0            0            0]
-+                    [           0 f1*f1inv - 1            0            0            0]
-+                    [           0            0 f1*f1inv - 1            0            0]
-+                    [           0            0            0 f1*f1inv - 1            0]
-+                    [           0            0            0            0 f1*f1inv - 1]
-                     [f2*f2inv - 1            0            0            0            0]
-                     [           0 f2*f2inv - 1            0            0            0]
-                     [           0            0 f2*f2inv - 1            0            0]
-                     [           0            0            0 f2*f2inv - 1            0]
-                     [           0            0            0            0 f2*f2inv - 1]
--                    [f3*f3inv - 1            0            0            0            0]
--                    [           0 f3*f3inv - 1            0            0            0]
--                    [           0            0 f3*f3inv - 1            0            0]
--                    [           0            0            0 f3*f3inv - 1            0]
--                    [           0            0            0            0 f3*f3inv - 1]
-                     sage: Y.twisted_homology(2)
--                    Quotient module by Submodule of Ambient free module of rank 0 over the integral domain Multivariate Polynomial Ring in f2, f2inv, f3, f3inv over Integer Ring
-+                    Quotient module by Submodule of Ambient free module of rank 0 over the integral domain Multivariate Polynomial Ring in f1, f1inv, f2, f2inv over Integer Ring
-                     Generated by the rows of the matrix:
-                     []
-                     sage: Y.twisted_homology(1, reduced=True)
--                    Quotient module by Submodule of Ambient free module of rank 5 over the integral domain Multivariate Polynomial Ring in f2, f2inv, f3, f3inv over Integer Ring
-+                    Quotient module by Submodule of Ambient free module of rank 5 over the integral domain Multivariate Polynomial Ring in f1, f1inv, f2, f2inv over Integer Ring
-                     Generated by the rows of the matrix:
-                     [1 0 0 0 0]
-                     [0 1 0 0 0]
-diff --git a/src/sage/combinat/matrices/latin.py b/src/sage/combinat/matrices/latin.py
-index e2d818e9480..84e6c4fcc9b 100644
---- a/src/sage/combinat/matrices/latin.py
-+++ b/src/sage/combinat/matrices/latin.py
-@@ -2444,7 +2444,7 @@ def p3_group_bitrade_generators(p):
-     EXAMPLES::
- 
-         sage: from sage.combinat.matrices.latin import *
--        sage: p3_group_bitrade_generators(3)
-+        sage: p3_group_bitrade_generators(3)  # random output
-         ((2,6,7)(3,8,9),
-          (1,2,3)(4,7,8)(5,6,9),
-          (1,9,2)(3,7,4)(5,8,6),
-diff --git a/src/sage/groups/cubic_braid.py b/src/sage/groups/cubic_braid.py
-index 61db70925e1..521289c7578 100644
---- a/src/sage/groups/cubic_braid.py
-+++ b/src/sage/groups/cubic_braid.py
-@@ -282,7 +282,7 @@ def _richcmp_(self, other, op):
-         EXAMPLES::
- 
-             sage: CBG3 = CubicBraidGroup(3)
--            sage: sorted(CBG3)    # indirect doctest
-+            sage: sorted(CBG3)    # indirect doctest, random output
-             [(c0*c1^-1)^2, c0*c1^-1*c0, c0^-1*c1*c0^-1, c0^-1*c1^-1*c0,
-              c1*c0^-1*c1, c0^-1*c1^-1*c0^-1, c0^-1*c1^-1, c1^-1*c0*c1^-1,
-              c0*c1^-1*c0^-1, c0^-1*c1, c0^-1*c1*c0, c0*c1^-1, c1*c0^-1,
-diff --git a/src/sage/groups/finitely_presented.py b/src/sage/groups/finitely_presented.py
-index 4ac2faa783b..7016d08381b 100644
---- a/src/sage/groups/finitely_presented.py
-+++ b/src/sage/groups/finitely_presented.py
-@@ -1344,8 +1344,8 @@ def abelianization_map(self):
-             sage: H = G.quotient([g1^2, g2*g1*g2^(-1)*g1^(-1), g1*g3^(-2), g0^4])
-             sage: H.abelianization_map()
-             Group morphism:
--                From: Finitely presented group  < g0, g1, g2, g3 | g1^2, g2*g1*g2^-1*g1^-1, g1*g3^-2, g0^4 >
--                To:   Finitely presented group  < f2, f3, f4 | f2^-1*f3^-1*f2*f3, f2^-1*f4^-1*f2*f4, f3^-1*f4^-1*f3*f4, f2^4, f3^4 >
-+              From: Finitely presented group < g0, g1, g2, g3 | g1^2, g2*g1*g2^-1*g1^-1, g1*g3^-2, g0^4 >
-+              To:   Finitely presented group < f1, f2, f3 | f1^4, f2^-1*f1^-1*f2*f1, f2^4, f3^-1*f1^-1*f3*f1, f3^-1*f2^-1*f3*f2 >
-             sage: g = FreeGroup(0) / []
-             sage: g.abelianization_map()
-             Group endomorphism of Finitely presented group  <  |  >
-@@ -1394,10 +1394,10 @@ def abelianization_to_algebra(self, ring=QQ):
-             Defining g0, g1, g2, g3
-             sage: H = G.quotient([g1^2, g2*g1*g2^(-1)*g1^(-1), g1*g3^(-2), g0^4])
-             sage: H.abelianization_to_algebra()
--            (Finitely presented group  < f2, f3, f4 | f2^-1*f3^-1*f2*f3, f2^-1*f4^-1*f2*f4,
--                                                      f3^-1*f4^-1*f3*f4, f2^4, f3^4 >,
--             Multivariate Laurent Polynomial Ring in f2, f3, f4 over Rational Field,
--             [f2^4 - 1, f3^4 - 1], [f2^-1*f3^-2, f3^-2, f4, f3])
-+            (Finitely presented group < f1, f2, f3 | f1^4, f2^-1*f1^-1*f2*f1, f2^4, f3^-1*f1^-1*f3*f1, f3^-1*f2^-1*f3*f2 >,
-+             Multivariate Laurent Polynomial Ring in f1, f2, f3 over Rational Field,
-+             [f1^4 - 1, f2^4 - 1],
-+             [f1^3*f2^2, f2^2, f3, f2])
-             sage: g=FreeGroup(0) / []
-             sage: g.abelianization_to_algebra()
-             (Finitely presented group  <  |  >, Rational Field, [], [])
-@@ -1673,7 +1673,7 @@ def abelian_alexander_matrix(self, ring=QQ, simplified=True):
-             []
-             sage: G = FreeGroup(3)/[(2, 1, 1), (1, 2, 2, 3, 3)]
-             sage: A, ideal = G.abelian_alexander_matrix(simplified=True); A
--            [-f3^2 - f3^4 - f3^6         f3^3 + f3^6]
-+            [-f1^2 - f1^4 - f1^6         f1^3 + f1^6]
-             sage: g = FreeGroup(1) / []
-             sage: g.abelian_alexander_matrix()
-             ([], [])
-@@ -1773,11 +1773,11 @@ def characteristic_varieties(self, ring=QQ, matrix_ideal=None, groebner=False):
-              3: Ideal (1) of Multivariate Laurent Polynomial Ring in f1, f2 over Integer Ring}
-             sage: G = FreeGroup(2)/[(1,2,1,-2,-1,-2)]
-             sage: G.characteristic_varieties()
--            {0: Ideal (0) of Univariate Laurent Polynomial Ring in f2 over Rational Field,
--             1: Ideal (-1 + 2*f2 - 2*f2^2 + f2^3) of Univariate Laurent Polynomial Ring in f2 over Rational Field,
--             2: Ideal (1) of Univariate Laurent Polynomial Ring in f2 over Rational Field}
-+            {0: Ideal (0) of Univariate Laurent Polynomial Ring in f1 over Rational Field,
-+             1: Ideal (-1 + 2*f1 - 2*f1^2 + f1^3) of Univariate Laurent Polynomial Ring in f1 over Rational Field,
-+             2: Ideal (1) of Univariate Laurent Polynomial Ring in f1 over Rational Field}
-             sage: G.characteristic_varieties(groebner=True)
--            {0: [0], 1: [-1 + f2, 1 - f2 + f2^2], 2: []}
-+            {0: [0], 1: [-1 + f1, 1 - f1 + f1^2], 2: []}
-             sage: G = FreeGroup(2)/[3 * (1, ), 2 * (2, )]
-             sage: G.characteristic_varieties(groebner=True)
-             {0: [-1 + F1, 1 + F1, 1 - F1 + F1^2, 1 + F1 + F1^2], 1: [1 - F1 + F1^2],  2: []}
-diff --git a/src/sage/groups/perm_gps/permgroup_named.py b/src/sage/groups/perm_gps/permgroup_named.py
-index 5c153b93d4c..bd4afad2942 100644
---- a/src/sage/groups/perm_gps/permgroup_named.py
-+++ b/src/sage/groups/perm_gps/permgroup_named.py
-@@ -3465,16 +3465,14 @@ class SmallPermutationGroup(PermutationGroup_generic):
-         sage: G = SmallPermutationGroup(12,4); G
-         Group of order 12 and GAP Id 4 as a permutation group
-         sage: G.gens()
--        ((1,2)(3,5)(4,10)(6,8)(7,12)(9,11),
--         (1,3)(2,5)(4,7)(6,9)(8,11)(10,12),
--         (1,4,8)(2,6,10)(3,7,11)(5,9,12))
-+        ((4,5), (1,2), (3,4,5))
-         sage: G.character_table()                                                       # needs sage.rings.number_field
-         [ 1  1  1  1  1  1]
--        [ 1 -1 -1  1  1 -1]
-+        [ 1 -1  1 -1  1 -1]
-         [ 1 -1  1  1 -1  1]
--        [ 1  1 -1  1 -1 -1]
--        [ 2  0 -2 -1  0  1]
--        [ 2  0  2 -1  0 -1]
-+        [ 1  1  1 -1 -1 -1]
-+        [ 2  0 -1 -2  0  1]
-+        [ 2  0 -1  2  0 -1]
-         sage: def numgps(n): return ZZ(libgap.NumberSmallGroups(n))
-         sage: all(SmallPermutationGroup(n,k).id() == [n,k]
-         ....:     for n in [1..64] for k in [1..numgps(n)])
-@@ -3483,11 +3481,11 @@ class SmallPermutationGroup(PermutationGroup_generic):
-         sage: H.is_abelian()
-         False
-         sage: [H.centralizer(g) for g in H.conjugacy_classes_representatives()]
--        [Subgroup generated by [(1,2)(3,6)(4,5), (1,3,5)(2,4,6)] of
-+        [Subgroup generated by [(1,3), (2,3)] of
-           (Group of order 6 and GAP Id 1 as a permutation group),
--         Subgroup generated by [(1,2)(3,6)(4,5)] of
-+         Subgroup generated by [(2,3)] of
-           (Group of order 6 and GAP Id 1 as a permutation group),
--         Subgroup generated by [(1,3,5)(2,4,6), (1,5,3)(2,6,4)] of
-+         Subgroup generated by [(1,2,3)] of
-           (Group of order 6 and GAP Id 1 as a permutation group)]
-     """
- 
diff --git a/srcpkgs/sagemath/patches/38873-fix_doctest.patch b/srcpkgs/sagemath/patches/38873-fix_doctest.patch
new file mode 100644
index 00000000000000..f42a8a570ca0cb
--- /dev/null
+++ b/srcpkgs/sagemath/patches/38873-fix_doctest.patch
@@ -0,0 +1,25 @@
+diff --git a/src/sage/parallel/map_reduce.py b/src/sage/parallel/map_reduce.py
+index 303f7405416..a182a136a2f 100644
+--- a/src/sage/parallel/map_reduce.py
++++ b/src/sage/parallel/map_reduce.py
+@@ -1133,18 +1133,16 @@ def start_workers(self):
+ 
+         TESTS::
+ 
++            sage: # long time
+             sage: from sage.parallel.map_reduce import RESetMapReduce
+             sage: def children(x):
+             ....:     print(f"Starting: {x}", flush=True)
+             ....:     return []
+             sage: S = RESetMapReduce(roots=[1, 2], children=children)
+             sage: S.setup_workers(2)
+-            sage: S.start_workers(); sleep(float(5))  # long time
++            sage: S.start_workers(); sleep(float(5))
+             Starting: ...
+             Starting: ...
+-
+-        Cleanup::
+-
+             sage: S.finish()
+         """
+         if self._nprocess == 0:
diff --git a/srcpkgs/sagemath/patches/get_patches b/srcpkgs/sagemath/patches/get_patches
index 381c307a3e962a..39fb67ef79aa7d 100755
--- a/srcpkgs/sagemath/patches/get_patches
+++ b/srcpkgs/sagemath/patches/get_patches
@@ -27,8 +27,9 @@ get_pr() {
 # run from patches dir
 cd $(dirname "$0")
 
-get_pr 37884 "gap 4.13.1"
+#get_pr 37884 "gap 4.13.1"
 #get_pr 38572 "nauty 2.8.9"
 
 #get_pr 37645 "fix doctest"
 get_pr 37885 "cython warnings"
+get_pr 38873 "fix doctest"
diff --git a/srcpkgs/sagemath/patches/revert-38826.patch b/srcpkgs/sagemath/patches/revert-38826.patch
new file mode 100644
index 00000000000000..6a97d896db44f7
--- /dev/null
+++ b/srcpkgs/sagemath/patches/revert-38826.patch
@@ -0,0 +1,26 @@
+Revert "src/sage/env.py: canonicalize paths in a test"
+
+This reverts commit 53a6d3133ea7782c7498ea6ab6bd3041815bd6a6.
+
+See: https://github.com/sagemath/sage/pull/38826#issuecomment-2439757935
+
+--- a/src/sage/env.py
++++ b/src/sage/env.py
+@@ -8,14 +8,10 @@ environment variables, and has the same ``SAGE_ROOT`` and ``SAGE_LOCAL``
+ 
+     sage: env = {k:v for (k,v) in os.environ.items() if not k.startswith("SAGE_")}
+     sage: from subprocess import check_output
+-    sage: module_name = "sage.all"   # hide .all import from the linter
+-    sage: cmd  = f"from {module_name} import SAGE_ROOT, SAGE_LOCAL;"
+-    sage: cmd +=  "from os.path import samefile;"
+-    sage: cmd += f"s1 = samefile(SAGE_ROOT, '{SAGE_ROOT}');"
+-    sage: cmd += f"s2 = samefile(SAGE_LOCAL, '{SAGE_LOCAL}');"
+-    sage: cmd += "print(s1 and s2);"
++    sage: environment = "sage.all"
++    sage: cmd = f"from {environment} import SAGE_ROOT, SAGE_LOCAL; print((SAGE_ROOT, SAGE_LOCAL))"
+     sage: out = check_output([sys.executable, "-c", cmd], env=env).decode().strip()   # long time
+-    sage: out == "True"                                                               # long time
++    sage: out == repr((SAGE_ROOT, SAGE_LOCAL))                                        # long time
+     True
+ 
+ AUTHORS:
diff --git a/srcpkgs/sagemath/template b/srcpkgs/sagemath/template
index d19d4ac007f9ba..0fa1fb968249f6 100644
--- a/srcpkgs/sagemath/template
+++ b/srcpkgs/sagemath/template
@@ -1,6 +1,6 @@
 # Template file for 'sagemath'
 pkgname=sagemath
-version=10.5.beta7
+version=10.5.beta8
 revision=1
 _pypi_version=${version/.beta/b}
 _pypi_version=${_pypi_version/.rc/rc}
@@ -32,7 +32,7 @@ license="GPL-2.0-or-later"
 homepage="https://www.sagemath.org/"
 changelog="https://github.com/sagemath/sage/releases"
 distfiles="${PYPI_SITE}/s/sagemath-standard/sagemath_standard-${_pypi_version}.tar.gz"
-checksum=b98a883aab3b6f551243bc3cffb6825c92f6faf86604e9a9cc8f38cfb9af2f32
+checksum=0c386e88524a91ad97db4f3f8ee7408d8678072596b3ab5e9ffaea2cb6be13fd
 nocross="due to ntl (eclib, singular), fflas-ffpack, givaro, linbox, sympow, maxima"
 
 # main repo `.../src/sage/`  is `.../sage/` here

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

end of thread, other threads:[~2024-10-29  0:41 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-08-18 17:54 [PR PATCH] [BETA] sagemath: update to 10.5.beta2 tornaria
2024-08-20 20:57 ` [PR PATCH] [Updated] " tornaria
2024-08-21  1:11 ` tornaria
2024-08-22  2:10 ` tornaria
2024-08-24  4:03 ` tornaria
2024-09-08 16:10 ` tornaria
2024-09-09  1:13 ` [BETA] sagemath: update to 10.5.beta3 dkwo
2024-09-10  0:07 ` tornaria
2024-09-10 20:23 ` dkwo
2024-09-22 12:01 ` [PR PATCH] [Updated] " tornaria
2024-10-15 19:18 ` [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta5 tornaria
2024-10-29  0:41 ` [PR PATCH] [Updated] [BETA] sagemath: update to 10.5.beta7 tornaria

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).