summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
authorTimo Kaufmann <timokau@zoho.com>2020-03-09 13:02:29 +0100
committerTimo Kaufmann <timokau@zoho.com>2020-03-10 13:15:41 +0100
commit71335774051655fae820bc94c3e06c39dc778b99 (patch)
tree28ad27c1af82ac1b61ceabb96d706f522b2801aa /pkgs/applications/science
parent6b6f9d769a5086df38a06b680104d0c5fd1a8e0e (diff)
downloadnixpkgs-71335774051655fae820bc94c3e06c39dc778b99.tar
nixpkgs-71335774051655fae820bc94c3e06c39dc778b99.tar.gz
nixpkgs-71335774051655fae820bc94c3e06c39dc778b99.tar.bz2
nixpkgs-71335774051655fae820bc94c3e06c39dc778b99.tar.lz
nixpkgs-71335774051655fae820bc94c3e06c39dc778b99.tar.xz
nixpkgs-71335774051655fae820bc94c3e06c39dc778b99.tar.zst
nixpkgs-71335774051655fae820bc94c3e06c39dc778b99.zip
sage: fix test suite with docutils 0.15
The better way to fix this would be to backport the upstream sphinx
patch:

https://github.com/sphinx-doc/sphinx/commit/faedcc48ccb942b9a7b758b699b30f0d026c0771

Unfortunately it doesn't apply cleanly and isn't worth the effort
of backporting. Let's hope we can switch to python3 sage and the recent
sphinx version that comes with it before this becomes a problem.
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/math/sage/patches/docutils-0.15.patch24
-rw-r--r--pkgs/applications/science/math/sage/sage-src.nix5
2 files changed, 29 insertions, 0 deletions
diff --git a/pkgs/applications/science/math/sage/patches/docutils-0.15.patch b/pkgs/applications/science/math/sage/patches/docutils-0.15.patch
new file mode 100644
index 00000000000..63f5d2e146d
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/docutils-0.15.patch
@@ -0,0 +1,24 @@
+diff --git a/src/sage/misc/sphinxify.py b/src/sage/misc/sphinxify.py
+index 4849c2bffa..76b7bc8602 100644
+--- a/src/sage/misc/sphinxify.py
++++ b/src/sage/misc/sphinxify.py
+@@ -25,6 +25,7 @@ from __future__ import absolute_import, print_function
+ import os
+ import re
+ import shutil
++import warnings
+ from tempfile import mkdtemp
+ from sphinx.application import Sphinx
+ 
+@@ -120,7 +121,10 @@ smart_quotes = no""")
+     # buildername, confoverrides, status, warning, freshenv).
+     sphinx_app = Sphinx(srcdir, confdir, outdir, doctreedir, format,
+                         confoverrides, None, None, True)
+-    sphinx_app.build(None, [rst_name])
++    with warnings.catch_warnings():
++        # Quick and dirty workaround for https://trac.sagemath.org/ticket/28856#comment:19
++        warnings.simplefilter("ignore")
++        sphinx_app.build(None, [rst_name])
+     sys.path = old_sys_path
+ 
+     # We need to remove "_" from __builtin__ that the gettext module installs
diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix
index 4530cbf69f4..1cbea74edae 100644
--- a/pkgs/applications/science/math/sage/sage-src.nix
+++ b/pkgs/applications/science/math/sage/sage-src.nix
@@ -52,6 +52,11 @@ stdenv.mkDerivation rec {
     # Parallelize docubuild using subprocesses, fixing an isolation issue. See
     # https://groups.google.com/forum/#!topic/sage-packaging/YGOm8tkADrE
     ./patches/sphinx-docbuild-subprocesses.patch
+
+    # Fix doctest failures with docutils 0.15:
+    # https://nix-cache.s3.amazonaws.com/log/dzmzrb2zvardsmpy7idg7djkizmkzdhs-sage-tests-8.9.drv
+    # https://trac.sagemath.org/ticket/28856#comment:19
+    ./patches/docutils-0.15.patch
   ];
 
   # Since sage unfortunately does not release bugfix releases, packagers must