Merge pull request #72771 from timokau/sage-fixes

sage: fix tests

authored by

Timo Kaufmann and committed by
GitHub
c54848ee eeba5c8e

+75 -10
+15 -4
pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch
··· 1 diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py 2 - index bd6b76ab82..f8340a8c66 100644 3 --- a/src/sage/tests/cmdline.py 4 +++ b/src/sage/tests/cmdline.py 5 - @@ -872,7 +872,7 @@ def test_executable(args, input="", timeout=100.0, **kwds): 6 sage: with open(input, 'w') as F: 7 ....: _ = F.write(s) 8 - sage: test_executable(["sage", "--rst2sws", input, output]) # py2 9 - ('', '', 0) 10 - + ('', '...', 0) 11 sage: import tarfile # py2 12 sage: f = tarfile.open(output, 'r') # py2 13 sage: print(f.extractfile('sage_worksheet/worksheet.html').read()) # py2
··· 1 diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py 2 + index bd6b76ab82..ccf1203dec 100644 3 --- a/src/sage/tests/cmdline.py 4 +++ b/src/sage/tests/cmdline.py 5 + @@ -837,8 +837,6 @@ def test_executable(args, input="", timeout=100.0, **kwds): 6 + /// 7 + 4 8 + }}} 9 + - sage: err # py2 10 + - '' 11 + sage: ret 12 + 0 13 + 14 + @@ -871,8 +869,8 @@ def test_executable(args, input="", timeout=100.0, **kwds): 15 + sage: output = tmp_filename(ext='.sws') 16 sage: with open(input, 'w') as F: 17 ....: _ = F.write(s) 18 + - sage: test_executable(["sage", "--rst2sws", input, output]) # py2 19 - ('', '', 0) 20 + + sage: test_executable(["sage", "--rst2sws", input, output])[2] # py2 21 + + 0 22 sage: import tarfile # py2 23 sage: f = tarfile.open(output, 'r') # py2 24 sage: print(f.extractfile('sage_worksheet/worksheet.html').read()) # py2
+12
pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch
···
··· 1 + diff --git a/src/sage/all.py b/src/sage/all.py 2 + index c87c9372e9..862fca4fcc 100644 3 + --- a/src/sage/all.py 4 + +++ b/src/sage/all.py 5 + @@ -306,6 +306,7 @@ warnings.filters.remove(('ignore', None, DeprecationWarning, None, 0)) 6 + # Ignore all deprecations from IPython etc. 7 + warnings.filterwarnings('ignore', category=DeprecationWarning, 8 + module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic)') 9 + +warnings.filterwarnings('ignore', category=DeprecationWarning, message=r".*The import 'werkzeug.ImmutableDict' is deprecated") 10 + # Ignore collections.abc warnings, there are a lot of them but they are 11 + # harmless. 12 + warnings.filterwarnings('ignore', category=DeprecationWarning,
+13
pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch
···
··· 1 + diff --git a/sagenb/__init__.py b/sagenb/__init__.py 2 + index 4db0d2cb..2fc5f01e 100644 3 + --- a/sagenb/__init__.py 4 + +++ b/sagenb/__init__.py 5 + @@ -1,3 +1,8 @@ 6 + # -*- coding: utf-8 -* 7 + # init 8 + +import warnings 9 + from . import storage 10 + + 11 + +# deprecation in attrs, needs to be fixed in twisted 12 + +warnings.filterwarnings('ignore', category=DeprecationWarning, 13 + + message=r'The usage of `cmp` is deprecated and will be removed.*')
+19 -6
pkgs/applications/science/math/sage/sage-env.nix
··· 18 , ecl 19 , maxima-ecl 20 , singular 21 , giac 22 , palp 23 , rWrapper ··· 101 name = "sage-env"; 102 destination = "/${name}"; 103 text = '' 104 - export PKG_CONFIG_PATH='${lib.concatStringsSep ":" (map (pkg: "${pkg}/lib/pkgconfig") [ 105 - # This is only needed in the src/sage/misc/cython.py test and I'm not 106 - # sure if there's really a usecase for it outside of the tests. However 107 - # since singular and openblas are runtime dependencies anyways, it doesn't 108 - # really hurt to include. 109 singular 110 openblasCompat 111 - ]) 112 }' 113 export SAGE_ROOT='${sagelib.src}' 114 export SAGE_LOCAL='@sage-local@'
··· 18 , ecl 19 , maxima-ecl 20 , singular 21 + , fflas-ffpack 22 + , givaro 23 + , gd 24 + , libpng 25 + , linbox 26 + , m4ri 27 , giac 28 , palp 29 , rWrapper ··· 107 name = "sage-env"; 108 destination = "/${name}"; 109 text = '' 110 + export PKG_CONFIG_PATH='${lib.makeSearchPathOutput "dev" "lib/pkgconfig" [ 111 + # This should only be needed during build. However, since the doctests 112 + # also test the cython build (for example in src/sage/misc/cython.py), 113 + # it is also needed for the testsuite to pass. We could fix the 114 + # testsuite instead, but since all the packages are also runtime 115 + # dependencies it doesn't really hurt to include them here. 116 singular 117 openblasCompat 118 + fflas-ffpack givaro 119 + gd 120 + libpng zlib 121 + gsl 122 + linbox 123 + m4ri 124 + ] 125 }' 126 export SAGE_ROOT='${sagelib.src}' 127 export SAGE_LOCAL='@sage-local@'
+11
pkgs/applications/science/math/sage/sage-src.nix
··· 107 108 # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests 109 ./patches/ignore-cmp-deprecation.patch 110 ]; 111 112 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
··· 107 108 # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests 109 ./patches/ignore-cmp-deprecation.patch 110 + 111 + # Werkzeug has deprecated ImmutableDict, but it is still used in legacy 112 + # sagenb. That's no big issue since sagenb will be removed soon anyways. 113 + ./patches/ignore-werkzeug-immutable-dict-deprecation.patch 114 + 115 + # threejs r109 (#28560) 116 + (fetchpatch { 117 + name = "threejs-r109.patch"; 118 + url = "https://git.sagemath.org/sage.git/patch?id=fcc11d6effa39f375bc5f4ea5831fb7a2f2767da"; 119 + sha256 = "0hnmc8ld3bblks0hcjvjjaydkgwdr1cs3dbl2ys4gfq964pjgqwc"; 120 + }) 121 ]; 122 123 patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
+5
pkgs/applications/science/math/sage/sagenb.nix
··· 26 sha256 = "0bxvhr03qh2nsjdfc4pyfiqrn9jhp3vf7irsc9gqx0185jlblbxs"; 27 }; 28 29 propagatedBuildInputs = [ 30 twisted 31 flask
··· 26 sha256 = "0bxvhr03qh2nsjdfc4pyfiqrn9jhp3vf7irsc9gqx0185jlblbxs"; 27 }; 28 29 + patches = [ 30 + # cmp deprecation in attrs needs to be handled in twisted 31 + ./patches/sagenb-cmp-deprecation.patch 32 + ]; 33 + 34 propagatedBuildInputs = [ 35 twisted 36 flask