diff options
-rw-r--r-- | .SRCINFO | 4 | ||||
-rw-r--r-- | PKGBUILD | 11 | ||||
-rw-r--r-- | sagemath-python3.10.patch | 247 |
3 files changed, 258 insertions, 4 deletions
@@ -16,7 +16,6 @@ pkgbase = sagemath-git makedepends = tdlib makedepends = python-pkgconfig makedepends = shared_meataxe - makedepends = primecount makedepends = git depends = palp depends = brial @@ -105,6 +104,7 @@ pkgbase = sagemath-git source = sagemath-lrcalc2.patch source = sagemath-singular-4.2.1.p1.patch source = sagemath-linbox-1.7.patch + source = sagemath-python3.10.patch sha256sums = SKIP sha256sums = b2308f25c5e6ad330342fc365056d7aebfbba09b833e3be6fb6283061709b6a0 sha256sums = 2f310081357996b7d3bf813e63d07c0fc04d6724adbfbd1beeb554e9476e2e4c @@ -112,5 +112,7 @@ pkgbase = sagemath-git sha256sums = ede5e054c73eab9aa71285bb3a16c1f2f0e4fdc0d4645fe13912ff9489865bee sha256sums = 1f0c44a4998ed239a3d77e3028b98b6f2c28a95e9bb4b8557523cc8f12ffba34 sha256sums = eacea27b214d32cb886a75695153dfc36b5bad2fd2517e8e4eee18e74220e9e3 + sha256sums = 602bf5ff69b81cb72123e9f0b1ce7df1cec0c15b97273e93691c1f11b20cd545 + sha256sums = 93e563a167431357dde9b8948d3bfa2b7c17873013f80eed83d3c800f38bdcc2 pkgname = sagemath-git @@ -46,7 +46,7 @@ optdepends=('cython: to compile cython code' 'python-pip: to install optional packages with sage -pip' 'sage-notebook-exporter: convert flask notebooks to Jupyter' 'python-database-knotinfo: interface to the KnotInfo and LinkInfo databases') -makedepends=(cython boost ratpoints python-jinja sirocco mcqd coxeter bliss tdlib python-pkgconfig shared_meataxe primecount git) +makedepends=(cython boost ratpoints python-jinja sirocco mcqd coxeter bliss tdlib python-pkgconfig shared_meataxe git) conflicts=(sagemath) provides=(sagemath) source=(git://git.sagemath.org/sage.git#branch=develop @@ -55,14 +55,17 @@ source=(git://git.sagemath.org/sage.git#branch=develop test-optional.patch sagemath-lrcalc2.patch sagemath-singular-4.2.1.p1.patch - sagemath-linbox-1.7.patch) + sagemath-linbox-1.7.patch + sagemath-python3.10.patch) sha256sums=('SKIP' 'b2308f25c5e6ad330342fc365056d7aebfbba09b833e3be6fb6283061709b6a0' '2f310081357996b7d3bf813e63d07c0fc04d6724adbfbd1beeb554e9476e2e4c' 'd1310321bf07491658e83087a6ddb0011738fa17a1dc3275d6d5c6907eaf3df8' 'ede5e054c73eab9aa71285bb3a16c1f2f0e4fdc0d4645fe13912ff9489865bee' '1f0c44a4998ed239a3d77e3028b98b6f2c28a95e9bb4b8557523cc8f12ffba34' - 'eacea27b214d32cb886a75695153dfc36b5bad2fd2517e8e4eee18e74220e9e3') + 'eacea27b214d32cb886a75695153dfc36b5bad2fd2517e8e4eee18e74220e9e3' + '602bf5ff69b81cb72123e9f0b1ce7df1cec0c15b97273e93691c1f11b20cd545' + '93e563a167431357dde9b8948d3bfa2b7c17873013f80eed83d3c800f38bdcc2') options=(debug !strip) pkgver() { @@ -80,6 +83,8 @@ prepare(){ patch -p1 -i ../sagemath-singular-4.2.1.p1.patch # Fix build with linbox 1.7 https://trac.sagemath.org/ticket/32959 patch -p1 -i ../sagemath-linbox-1.7.patch +# Fix tests with Python 3.10 https://trac.sagemath.org/ticket/30766 + patch -p1 -i ../sagemath-python3.10.patch # Arch-specific patches # assume all optional packages are installed diff --git a/sagemath-python3.10.patch b/sagemath-python3.10.patch new file mode 100644 index 000000000000..6589cf62253d --- /dev/null +++ b/sagemath-python3.10.patch @@ -0,0 +1,247 @@ +diff --git a/src/sage/cpython/atexit.pyx b/src/sage/cpython/atexit.pyx +index 5b0c6d1..3ba391b 100644 +--- a/src/sage/cpython/atexit.pyx ++++ b/src/sage/cpython/atexit.pyx +@@ -144,43 +144,63 @@ cdef class restore_atexit: + + from cpython.ref cimport PyObject + +-# Internal structures defined in the CPython source in +-# Modules/atexitmodule.c and subject to (but unlikely to) change. Watch +-# https://bugs.python.org/issue32082 for a request to (eventually) +-# re-expose more of the atexit module's internals to Python +-ctypedef struct atexit_callback: +- PyObject* func +- PyObject* args +- PyObject* kwargs +- +- +-ctypedef struct atexitmodule_state: +- atexit_callback** atexit_callbacks +- int ncallbacks +- int callback_len +- +- +-cdef extern from "Python.h": +- void* PyModule_GetState(object module) +- ++# Implement "_atexit_callbacks()" for each supported python version ++cdef extern from *: ++ """ ++ #if PY_VERSION_HEX >= 0x030a0000 ++ /********** Python 3.10 **********/ ++ #define Py_BUILD_CORE ++ #undef _PyGC_FINALIZED ++ #include "internal/pycore_interp.h" ++ #include "internal/pycore_pystate.h" ++ static atexit_callback ** _atexit_callbacks(PyObject *self) { ++ PyInterpreterState *interp = _PyInterpreterState_GET(); ++ struct atexit_state state = interp->atexit; ++ return state.callbacks; ++ } ++ #else ++ /********** Python < 3.10 **********/ ++ /* Internal structures defined in the CPython source in ++ * Modules/atexitmodule.c and subject to (but unlikely to) change. Watch ++ * https://bugs.python.org/issue32082 for a request to (eventually) ++ * re-expose more of the atexit module's internals to Python ++ * typedef struct ++ */ ++ typedef struct { ++ PyObject *func; ++ PyObject *args; ++ PyObject *kwargs; ++ } atexit_callback; ++ typedef struct { ++ atexit_callback **atexit_callbacks; ++ int ncallbacks; ++ int callback_len; ++ } atexitmodule_state; ++ static atexit_callback ** _atexit_callbacks(PyObject *self) { ++ atexitmodule_state *state = PyModule_GetState(self); ++ return state->atexit_callbacks; ++ } ++ #endif ++ """ ++ ctypedef struct atexit_callback: ++ PyObject* func ++ PyObject* args ++ PyObject* kwargs ++ atexit_callback** _atexit_callbacks(object module) + + def _get_exithandlers(): + """Return list of exit handlers registered with the atexit module.""" +- cdef atexitmodule_state* state ++ cdef atexit_callback ** callbacks + cdef atexit_callback callback + cdef list exithandlers + cdef int idx + cdef object kwargs + +- state = <atexitmodule_state*>PyModule_GetState(atexit) +- +- if not state: +- raise RuntimeError("atexit module state missing or corrupt") +- + exithandlers = [] ++ callbacks = _atexit_callbacks(atexit) + +- for idx in range(state.ncallbacks): +- callback = state.atexit_callbacks[idx][0] ++ for idx in range(atexit._ncallbacks()): ++ callback = callbacks[idx][0] + if callback.kwargs: + kwargs = <object>callback.kwargs + else: +@@ -207,4 +227,5 @@ def _set_exithandlers(exithandlers): + + def _clear_exithandlers(): + """Clear the atexit module of all registered exit handlers.""" ++ + atexit._clear() +diff --git a/src/sage/misc/sageinspect.py b/src/sage/misc/sageinspect.py +index fb2073f..bd89233 100644 +--- a/src/sage/misc/sageinspect.py ++++ b/src/sage/misc/sageinspect.py +@@ -1585,6 +1585,8 @@ def sage_getargspec(obj): + ....: 'class Foo:\n' + ....: ' def __call__(self):\n' + ....: ' return None\n' ++ ....: ' def __module__(self):\n' ++ ....: ' return "sage.misc.sageinspect"\n' + ....: ' def _sage_src_(self):\n' + ....: ' return "the source code string"') + sage: shell.run_cell('f = Foo()') +diff --git a/src/sage/plot/colors.py b/src/sage/plot/colors.py +index 6fdba0f..f46b736 100644 +--- a/src/sage/plot/colors.py ++++ b/src/sage/plot/colors.py +@@ -918,12 +918,12 @@ class Color(object): + + sage: Color(0.3, 0.5, 0.7, space='hls').hls() + (0.30000000000000004, 0.5, 0.7) +- sage: Color(0.3, 0.5, 0.7, space='hsl').hls() ++ sage: Color(0.3, 0.5, 0.7, space='hsl').hls() # abs tol 1e-15 + (0.30000000000000004, 0.7, 0.5000000000000001) +- sage: Color('#aabbcc').hls() ++ sage: Color('#aabbcc').hls() # abs tol 1e-15 + (0.5833333333333334, 0.7333333333333334, 0.25000000000000017) + sage: from sage.plot.colors import orchid +- sage: orchid.hls() ++ sage: orchid.hls() # abs tol 1e-15 + (0.8396226415094339, 0.6470588235294117, 0.5888888888888889) + """ + return tuple(map(float, rgb_to_hls(*self._rgb))) +@@ -942,9 +942,9 @@ class Color(object): + sage: Color(1,0,0).hsl() + (0.0, 1.0, 0.5) + sage: from sage.plot.colors import orchid +- sage: orchid.hsl() ++ sage: orchid.hsl() # abs tol 1e-15 + (0.8396226415094339, 0.5888888888888889, 0.6470588235294117) +- sage: Color('#aabbcc').hsl() ++ sage: Color('#aabbcc').hsl() # abs tol 1e-15 + (0.5833333333333334, 0.25000000000000017, 0.7333333333333334) + """ + h, l, s = tuple(map(float, rgb_to_hls(*self._rgb))) +diff --git a/src/sage/rings/asymptotic/growth_group.py b/src/sage/rings/asymptotic/growth_group.py +index ba7e684..a91ec31 100644 +--- a/src/sage/rings/asymptotic/growth_group.py ++++ b/src/sage/rings/asymptotic/growth_group.py +@@ -5434,7 +5434,7 @@ class GrowthGroupFactory(UniqueFactory): + describing a growth group. + > *previous* ValueError: Cannot create a parent out of 'as'. + >> *previous* ValueError: unknown specification as +- >> *and* SyntaxError: unexpected EOF while parsing (<string>, line 1) ++ >> *and* SyntaxError: ... (<string>, line 1) + > *and* ValueError: Cannot create a parent out of 'df'. + >> *previous* ValueError: unknown specification df + >> *and* NameError: name 'df' is not defined +diff --git a/src/sage/schemes/riemann_surfaces/riemann_surface.py b/src/sage/schemes/riemann_surfaces/riemann_surface.py +index 3c3d387..f9d1e2b 100644 +--- a/src/sage/schemes/riemann_surfaces/riemann_surface.py ++++ b/src/sage/schemes/riemann_surfaces/riemann_surface.py +@@ -1390,7 +1390,7 @@ class RiemannSurface(object): + sage: S = RiemannSurface(f) + sage: _ = S.homology_basis() + sage: g,d = S.make_zw_interpolator([(0,0),(1,0)]); +- sage: all(f(*g(i*0.1)).abs() < 1e-13for i in range(10)) ++ sage: all(f(*g(i*0.1)).abs() < 1e-13 for i in range(10)) + True + sage: abs((g(1)[0]-g(0)[0]) - d) < 1e-13 + True +diff --git a/src/sage/structure/unique_representation.py b/src/sage/structure/unique_representation.py +index 9ead7a4..5d8d4ad 100644 +--- a/src/sage/structure/unique_representation.py ++++ b/src/sage/structure/unique_representation.py +@@ -1221,7 +1221,7 @@ class UniqueRepresentation(CachedRepresentation, WithEqualityById): + sage: isinstance(GF(7), GF) + Traceback (most recent call last): + ... +- TypeError: isinstance() arg 2 must be a type or tuple of types ++ TypeError: isinstance() arg 2 must be a type... + + sage: isinstance(GF, sage.structure.factory.UniqueFactory) + True +diff --git a/src/sage/symbolic/callable.py b/src/sage/symbolic/callable.py +index 5f3a7be..4b8efda 100644 +--- a/src/sage/symbolic/callable.py ++++ b/src/sage/symbolic/callable.py +@@ -38,27 +38,27 @@ The arguments in the definition must be symbolic variables (:trac:`10747`):: + sage: f(1)=2 + Traceback (most recent call last): + ... +- SyntaxError: can...t assign to function call ++ SyntaxError: can...t assign to function call... + + sage: f(x,1)=2 + Traceback (most recent call last): + ... +- SyntaxError: can...t assign to function call ++ SyntaxError: can...t assign to function call... + + sage: f(1,2)=3 + Traceback (most recent call last): + ... +- SyntaxError: can...t assign to function call ++ SyntaxError: can...t assign to function call... + + sage: f(1,2)=x + Traceback (most recent call last): + ... +- SyntaxError: can...t assign to function call ++ SyntaxError: can...t assign to function call... + + sage: f(x,2)=x + Traceback (most recent call last): + ... +- SyntaxError: can...t assign to function call ++ SyntaxError: can...t assign to function call... + """ + + import sage.rings.abc +diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py +index 4f16b0e..ba5aa14 100644 +--- a/src/sage/tests/cmdline.py ++++ b/src/sage/tests/cmdline.py +@@ -766,6 +766,7 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False + rfd.append(fderr) + if len(rfd) == 0: + break ++ timeout = float(timeout) + rlist = select.select(rfd, [], [], timeout)[0] + + if len(rlist) == 0: +diff --git a/src/setup.cfg.m4 b/src/setup.cfg.m4 +index 16f88f2..b8bd0c0 100644 +--- a/src/setup.cfg.m4 ++++ b/src/setup.cfg.m4 +@@ -26,7 +26,7 @@ classifiers = + Topic :: Scientific/Engineering :: Mathematics + + [options] +-python_requires = >=3.7, <3.10 ++python_requires = >=3.7, <3.11 + install_requires = + sage_conf + esyscmd(`sage-get-system-packages install-requires \ |