summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorAndreas Enge <andreas@enge.fr>2025-12-19 16:44:05 +0100
committerAndreas Enge <andreas@enge.fr>2025-12-19 16:44:05 +0100
commit5ddff69615e6d341c1360713d96b9f5ac62d40a1 (patch)
treed4edd404168f35c446cf2e83acf02ed5f94a8114 /gnu
parent0297f8813f7b1df626b5d4987c9a7028df1ad5b1 (diff)
gnu: sage: Update to 10.7.
* gnu/packages/patches/sage-safeguard-sage-getargspec-cython.patch: Remove file. * gnu/local.mk (dist_patch_DATA): Unregister patch. * gnu/packages/sagemath.scm (sage): Update to 10.7. [origin]: Remove patch. Change-Id: I64093e73369bd378b2553df589f0e2c6e5097aef
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/patches/sage-safeguard-sage-getargspec-cython.patch79
-rw-r--r--gnu/packages/sagemath.scm9
3 files changed, 2 insertions, 87 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 82d1acd8251..820ebdb5c72 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2283,7 +2283,6 @@ dist_patch_DATA = \
2283 %D%/packages/patches/rxvt-unicode-fix-cursor-position.patch \ 2283 %D%/packages/patches/rxvt-unicode-fix-cursor-position.patch \
2284 %D%/packages/patches/s7-flint-3.patch \ 2284 %D%/packages/patches/s7-flint-3.patch \
2285 %D%/packages/patches/safeint-disable-tests.patch \ 2285 %D%/packages/patches/safeint-disable-tests.patch \
2286 %D%/packages/patches/sage-safeguard-sage-getargspec-cython.patch \
2287 %D%/packages/patches/sajson-for-gemmi-numbers-as-strings.patch \ 2286 %D%/packages/patches/sajson-for-gemmi-numbers-as-strings.patch \
2288 %D%/packages/patches/sajson-build-with-gcc10.patch \ 2287 %D%/packages/patches/sajson-build-with-gcc10.patch \
2289 %D%/packages/patches/sane-look-for-plugins-in-SANE_BACKEND_LIB_PATH.patch \ 2288 %D%/packages/patches/sane-look-for-plugins-in-SANE_BACKEND_LIB_PATH.patch \
diff --git a/gnu/packages/patches/sage-safeguard-sage-getargspec-cython.patch b/gnu/packages/patches/sage-safeguard-sage-getargspec-cython.patch
deleted file mode 100644
index 19354703a79..00000000000
--- a/gnu/packages/patches/sage-safeguard-sage-getargspec-cython.patch
+++ /dev/null
@@ -1,79 +0,0 @@
1From d87a60c54453763476845138133ad7da54c159a7 Mon Sep 17 00:00:00 2001
2From: user202729 <25191436+user202729@users.noreply.github.com>
3Date: Mon, 24 Mar 2025 10:38:12 +0700
4Subject: [PATCH 1/2] Safeguard _sage_getargspec_cython
5
6---
7This patch was taken from: https://github.com/sagemath/sage/pull/39776
8It will be released in version 10.7 and can be removed after the upgrade.
9
10 src/sage/misc/sageinspect.py | 5 +++++
11 1 file changed, 5 insertions(+)
12
13diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py
14index 6fc0e29551f..d25f1f81820 100644
15--- a/src/sage/misc/sageinspect.py
16+++ b/src/sage/misc/sageinspect.py
17@@ -1139,6 +1139,11 @@ def _sage_getargspec_cython(source):
18 defaults=('a string', {(1, 2, 3): True}),
19 kwonlyargs=[], kwonlydefaults=None, annotations={})
20 """
21+ if not isinstance(source, str):
22+ # the caller ought to ensure this, but if it forgets (e.g. passing None),
23+ # we raise the correct exception type to avoid confusing error message
24+ # and possible further hard-to-debug errors, see :issue:`39735`
25+ raise TypeError
26 defpos = source.find('def ')
27 assert defpos > -1, "The given source does not contain 'def'"
28 s = source[defpos:].strip()
29
30From 21dd8224fca8a70490c754309350d08f56178809 Mon Sep 17 00:00:00 2001
31From: user202729 <25191436+user202729@users.noreply.github.com>
32Date: Thu, 27 Mar 2025 22:58:22 +0700
33Subject: [PATCH 2/2] Change to AssertionError and handle issue upstream
34
35---
36 src/sage/misc/sageinspect.py | 22 ++++++++++++----------
37 1 file changed, 12 insertions(+), 10 deletions(-)
38
39diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py
40index b617e288b97..bb704d74075 100644
41--- a/src/sage/misc/sageinspect.py
42+++ b/src/sage/misc/sageinspect.py
43@@ -1140,11 +1140,10 @@ def _sage_getargspec_cython(source):
44 defaults=('a string', {(1, 2, 3): True}),
45 kwonlyargs=[], kwonlydefaults=None, annotations={})
46 """
47- if not isinstance(source, str):
48- # the caller ought to ensure this, but if it forgets (e.g. passing None),
49- # we raise the correct exception type to avoid confusing error message
50- # and possible further hard-to-debug errors, see :issue:`39735`
51- raise TypeError
52+ assert isinstance(source, str)
53+ # the caller ought to ensure this, but if it forgets (e.g. passing None),
54+ # we avoid raising AttributeError to avoid confusing error message
55+ # and possible further hard-to-debug errors, see :issue:`39735`
56 defpos = source.find('def ')
57 assert defpos > -1, "The given source does not contain 'def'"
58 s = source[defpos:].strip()
59@@ -1682,12 +1681,15 @@ def foo(x, a='\')"', b={not (2+1==3):'bar'}): return
60 except TypeError: # arg is not a code object
61 # The above "hopefully" was wishful thinking:
62 try:
63- return inspect.FullArgSpec(*_sage_getargspec_cython(sage_getsource(obj)))
64+ source = sage_getsource(obj)
65 except TypeError: # This happens for Python builtins
66- # The best we can do is to return a generic argspec
67- args = []
68- varargs = 'args'
69- varkw = 'kwds'
70+ source = None
71+ if source is not None:
72+ return inspect.FullArgSpec(*_sage_getargspec_cython(source))
73+ # The best we can do is to return a generic argspec
74+ args = []
75+ varargs = 'args'
76+ varkw = 'kwds'
77 try:
78 defaults = func_obj.__defaults__
79 except AttributeError:
diff --git a/gnu/packages/sagemath.scm b/gnu/packages/sagemath.scm
index 1638b8a004b..a43eab54b7a 100644
--- a/gnu/packages/sagemath.scm
+++ b/gnu/packages/sagemath.scm
@@ -363,21 +363,16 @@ database.")
363(define-public sage 363(define-public sage
364 (package 364 (package
365 (name "sage") 365 (name "sage")
366 (version "10.6") 366 (version "10.7")
367 (source (origin 367 (source (origin
368 (method git-fetch) 368 (method git-fetch)
369 (uri (git-reference 369 (uri (git-reference
370 (url "https://github.com/sagemath/sage") 370 (url "https://github.com/sagemath/sage")
371 (commit version))) 371 (commit version)))
372 (file-name (git-file-name name version)) 372 (file-name (git-file-name name version))
373 (patches
374 ;; This patch works around a Cython issue and can be removed
375 ;; after sage 10.7 is released. See
376 ;; https://github.com/sagemath/sage/issues/39735
377 (search-patches "sage-safeguard-sage-getargspec-cython.patch"))
378 (sha256 373 (sha256
379 (base32 374 (base32
380 "0m2f6k6nwgyzfhf45r0kp798aimjxhpfnmsp1k03jpj9d6mhadk4")))) 375 "0513nmym1shlj0vkb982hpj1v86f327w5kav0523wk1xljc432cx"))))
381 (build-system pyproject-build-system) 376 (build-system pyproject-build-system)
382 (native-inputs 377 (native-inputs
383 (list autoconf automake m4 pkg-config ; for ./bootstrap 378 (list autoconf automake m4 pkg-config ; for ./bootstrap