Merge pull request #72771 from timokau/sage-fixes

sage: fix tests
This commit is contained in:
Timo Kaufmann 2019-11-06 16:21:51 +01:00 committed by GitHub
commit c54848ee77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 75 additions and 10 deletions

View File

@ -1,13 +1,24 @@
diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py
index bd6b76ab82..f8340a8c66 100644
index bd6b76ab82..ccf1203dec 100644
--- a/src/sage/tests/cmdline.py
+++ b/src/sage/tests/cmdline.py
@@ -872,7 +872,7 @@ def test_executable(args, input="", timeout=100.0, **kwds):
@@ -837,8 +837,6 @@ def test_executable(args, input="", timeout=100.0, **kwds):
///
4
}}}
- sage: err # py2
- ''
sage: ret
0
@@ -871,8 +869,8 @@ def test_executable(args, input="", timeout=100.0, **kwds):
sage: output = tmp_filename(ext='.sws')
sage: with open(input, 'w') as F:
....: _ = F.write(s)
sage: test_executable(["sage", "--rst2sws", input, output]) # py2
- sage: test_executable(["sage", "--rst2sws", input, output]) # py2
- ('', '', 0)
+ ('', '...', 0)
+ sage: test_executable(["sage", "--rst2sws", input, output])[2] # py2
+ 0
sage: import tarfile # py2
sage: f = tarfile.open(output, 'r') # py2
sage: print(f.extractfile('sage_worksheet/worksheet.html').read()) # py2

View File

@ -0,0 +1,12 @@
diff --git a/src/sage/all.py b/src/sage/all.py
index c87c9372e9..862fca4fcc 100644
--- a/src/sage/all.py
+++ b/src/sage/all.py
@@ -306,6 +306,7 @@ warnings.filters.remove(('ignore', None, DeprecationWarning, None, 0))
# Ignore all deprecations from IPython etc.
warnings.filterwarnings('ignore', category=DeprecationWarning,
module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic)')
+warnings.filterwarnings('ignore', category=DeprecationWarning, message=r".*The import 'werkzeug.ImmutableDict' is deprecated")
# Ignore collections.abc warnings, there are a lot of them but they are
# harmless.
warnings.filterwarnings('ignore', category=DeprecationWarning,

View File

@ -0,0 +1,13 @@
diff --git a/sagenb/__init__.py b/sagenb/__init__.py
index 4db0d2cb..2fc5f01e 100644
--- a/sagenb/__init__.py
+++ b/sagenb/__init__.py
@@ -1,3 +1,8 @@
# -*- coding: utf-8 -*
# init
+import warnings
from . import storage
+
+# deprecation in attrs, needs to be fixed in twisted
+warnings.filterwarnings('ignore', category=DeprecationWarning,
+ message=r'The usage of `cmp` is deprecated and will be removed.*')

View File

@ -18,6 +18,12 @@
, ecl
, maxima-ecl
, singular
, fflas-ffpack
, givaro
, gd
, libpng
, linbox
, m4ri
, giac
, palp
, rWrapper
@ -101,14 +107,21 @@ writeTextFile rec {
name = "sage-env";
destination = "/${name}";
text = ''
export PKG_CONFIG_PATH='${lib.concatStringsSep ":" (map (pkg: "${pkg}/lib/pkgconfig") [
# This is only needed in the src/sage/misc/cython.py test and I'm not
# sure if there's really a usecase for it outside of the tests. However
# since singular and openblas are runtime dependencies anyways, it doesn't
# really hurt to include.
export PKG_CONFIG_PATH='${lib.makeSearchPathOutput "dev" "lib/pkgconfig" [
# This should only be needed during build. However, since the doctests
# also test the cython build (for example in src/sage/misc/cython.py),
# it is also needed for the testsuite to pass. We could fix the
# testsuite instead, but since all the packages are also runtime
# dependencies it doesn't really hurt to include them here.
singular
openblasCompat
])
fflas-ffpack givaro
gd
libpng zlib
gsl
linbox
m4ri
]
}'
export SAGE_ROOT='${sagelib.src}'
export SAGE_LOCAL='@sage-local@'

View File

@ -107,6 +107,17 @@ stdenv.mkDerivation rec {
# ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests
./patches/ignore-cmp-deprecation.patch
# Werkzeug has deprecated ImmutableDict, but it is still used in legacy
# sagenb. That's no big issue since sagenb will be removed soon anyways.
./patches/ignore-werkzeug-immutable-dict-deprecation.patch
# threejs r109 (#28560)
(fetchpatch {
name = "threejs-r109.patch";
url = "https://git.sagemath.org/sage.git/patch?id=fcc11d6effa39f375bc5f4ea5831fb7a2f2767da";
sha256 = "0hnmc8ld3bblks0hcjvjjaydkgwdr1cs3dbl2ys4gfq964pjgqwc";
})
];
patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;

View File

@ -26,6 +26,11 @@ buildPythonPackage rec {
sha256 = "0bxvhr03qh2nsjdfc4pyfiqrn9jhp3vf7irsc9gqx0185jlblbxs";
};
patches = [
# cmp deprecation in attrs needs to be handled in twisted
./patches/sagenb-cmp-deprecation.patch
];
propagatedBuildInputs = [
twisted
flask