···1diff --git a/src/sage_docbuild/__init__.py b/src/sage_docbuild/__init__.py
2-index 8a5c1a19d2..21fd192642 100644
3--- a/src/sage_docbuild/__init__.py
4+++ b/src/sage_docbuild/__init__.py
5-@@ -89,27 +89,6 @@ def builder_helper(type):
6 """
7- Returns a function which builds the documentation for
8 output type ``type``.
9-
10- TESTS:
···19- ....: raise BaseException("abort pool operation")
20- sage: original_runsphinx, sage_docbuild.sphinxbuild.runsphinx = sage_docbuild.sphinxbuild.runsphinx, raiseBaseException
21-
00022- sage: from sage_docbuild import builder_helper, build_ref_doc
23- sage: from sage_docbuild import _build_many as build_many
24- sage: helper = builder_helper("html")
25-- sage: try:
26- ....: build_many(build_ref_doc, [("docname", "en", "html", {})])
27- ....: except Exception as E:
28- ....: "Non-exception during docbuild: abort pool operation" in str(E)
···30 """
31 def f(self, *args, **kwds):
32 output_dir = self._output_dir(type)
33-@@ -131,10 +110,9 @@ def builder_helper(type):
34 logger.debug(build_command)
3536 # Run Sphinx with Sage's special logger
···44 if ABORT_ON_ERROR:
45 raise
46diff --git a/src/sage_docbuild/sphinxbuild.py b/src/sage_docbuild/sphinxbuild.py
47-index d917c3e9d4..551cc8028a 100644
48--- a/src/sage_docbuild/sphinxbuild.py
49+++ b/src/sage_docbuild/sphinxbuild.py
50-@@ -327,3 +327,8 @@ def runsphinx():
51 sys.stderr = saved_stderr
52 sys.stdout.flush()
53 sys.stderr.flush()
···1diff --git a/src/sage_docbuild/__init__.py b/src/sage_docbuild/__init__.py
2+index b12d56a3c9..df9d949ed1 100644
3--- a/src/sage_docbuild/__init__.py
4+++ b/src/sage_docbuild/__init__.py
5+@@ -88,30 +88,6 @@ def builder_helper(type):
6 """
7+ Return a function which builds the documentation for
8 output type ``type``.
9-
10- TESTS:
···19- ....: raise BaseException("abort pool operation")
20- sage: original_runsphinx, sage_docbuild.sphinxbuild.runsphinx = sage_docbuild.sphinxbuild.runsphinx, raiseBaseException
21-
22+- sage: from sage.misc.temporary_file import tmp_dir
23+- sage: os.environ['SAGE_DOC'] = tmp_dir()
24+- sage: sage.env.var('SAGE_DOC') # random
25- sage: from sage_docbuild import builder_helper, build_ref_doc
26- sage: from sage_docbuild import _build_many as build_many
27- sage: helper = builder_helper("html")
28+- sage: try: # optional - sagemath_doc_html
29- ....: build_many(build_ref_doc, [("docname", "en", "html", {})])
30- ....: except Exception as E:
31- ....: "Non-exception during docbuild: abort pool operation" in str(E)
···33 """
34 def f(self, *args, **kwds):
35 output_dir = self._output_dir(type)
36+@@ -139,10 +115,9 @@ def builder_helper(type):
37 logger.debug(build_command)
3839 # Run Sphinx with Sage's special logger
···47 if ABORT_ON_ERROR:
48 raise
49diff --git a/src/sage_docbuild/sphinxbuild.py b/src/sage_docbuild/sphinxbuild.py
50+index a39c99ffe9..73be823684 100644
51--- a/src/sage_docbuild/sphinxbuild.py
52+++ b/src/sage_docbuild/sphinxbuild.py
53+@@ -330,3 +330,8 @@ def runsphinx():
54 sys.stderr = saved_stderr
55 sys.stdout.flush()
56 sys.stderr.flush()
+1-1
pkgs/applications/science/math/sage/sage-env.nix
···186 export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data'
187188 # for find_library
189- export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
190 '';
191} // { # equivalent of `passthru`, which `writeTextFile` doesn't support
192 lib = sagelib;
···186 export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data'
187188 # for find_library
189+ export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular giac]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
190 '';
191} // { # equivalent of `passthru`, which `writeTextFile` doesn't support
192 lib = sagelib;
+5-84
pkgs/applications/science/math/sage/sage-src.nix
···58 );
59in
60stdenv.mkDerivation rec {
61- version = "9.5";
62 pname = "sage-src";
6364 src = fetchFromGitHub {
65 owner = "sagemath";
66 repo = "sage";
67 rev = version;
68- sha256 = "sha256-uOsLpsGpcIGs8Xr82X82MElnTB2E908gytyNJ8WVD5w=";
69 };
7071 # Patches needed because of particularities of nix or the way this is packaged.
72 # The goal is to upstream all of them and get rid of this list.
73 nixPatches = [
74- # Since https://trac.sagemath.org/ticket/32174, some external features are
75- # marked as "safe" and get auto-detected, in which case the corresponding
76- # optional tests are executed. We disable auto-detection of safe features if
77- # we are doctesting with an "--optional" argument which does not include
78- # "sage", because tests from autodetected features expect context provided
79- # by running basic sage tests. This is necessary to test sagemath_doc_html
80- # separately. See https://trac.sagemath.org/ticket/26110 for a related
81- # upstream discussion (from the time when Sage still had optional py2/py3
82- # tags).
83- ./patches/Only-test-external-software-when-all-of-sage-is.patch
84-85 # Fixes a potential race condition which can lead to transient doctest failures.
86 ./patches/fix-ecl-race.patch
87···120 # https://trac.sagemath.org/ticket/32959
121 ./patches/linbox-1.7-upgrade.patch
122123- # https://trac.sagemath.org/ticket/33170
124- (fetchSageDiff {
125- base = "9.6.beta5";
126- name = "ipython-8.1-update.patch";
127- rev = "4d2b53f1541375861310af3a7f7109c1c2ed475d";
128- sha256 = "sha256-ELda/VBzsQH7NdFas69fQ35QPUoJCeLx/gxT1j7qGR8=";
129- })
130-131- # https://trac.sagemath.org/ticket/32968
132- (fetchSageDiff {
133- base = "9.5";
134- name = "sphinx-4.3-update.patch";
135- rev = "fc84f82f52b6f05f512cb359ec7c100f93cf8841";
136- sha256 = "sha256-bBbfdcnw/9LUOlY8rHJRbFJEdMXK4shosqTNaobTS1Q=";
137- })
138-139- # https://trac.sagemath.org/ticket/33189
140- (fetchSageDiff {
141- base = "9.5";
142- name = "arb-2.22-update.patch";
143- rev = "53532ddd4e2dc92469c1590ebf0c40f8f69bf579";
144- sha256 = "sha256-6SoSBvIlqvNwZV3jTB6uPdUtaWIOeNmddi2poK/WvGs=";
145- })
146-147- # TODO: This will not be necessary when Sphinx 4.4.1 is released,
148- # since some warnings introduced in 4.4.0 will be disabled by then
149- # (https://github.com/sphinx-doc/sphinx/pull/10126).
150- # https://trac.sagemath.org/ticket/33272
151- (fetchSageDiff {
152- base = "9.5";
153- name = "sphinx-4.4-warnings.patch";
154- rev = "97d7958bed441cf2ccc714d88f83d3a8426bc085";
155- sha256 = "sha256-y1STE0oxswnijGCsBw8eHWWqpmT1XMznIfA0vvX9pFA=";
156- })
157-158 # adapted from https://trac.sagemath.org/ticket/23712#comment:22
159 ./patches/tachyon-renamed-focallength.patch
160161- # https://trac.sagemath.org/ticket/33336
162- (fetchSageDiff {
163- base = "9.6.beta2";
164- name = "scipy-1.8-update.patch";
165- rev = "9c8235e44ffb509efa8a3ca6cdb55154e2b5066d";
166- sha256 = "sha256-bfc4ljNOxVnhlmxIuNbjbKl4vJXYq2tlF3Z8bbC8PWw=";
167- })
168-169- # https://trac.sagemath.org/ticket/33495
170- (fetchSageDiff {
171- base = "9.6.beta5";
172- name = "networkx-2.7-update.patch";
173- rev = "8452003846a7303100847d8d0ed642fc642c11d6";
174- sha256 = "sha256-A/XMouPlc2sjFp30L+56fBGJXydS2EtzfPOV98FCDqI=";
175- })
176-177- # https://trac.sagemath.org/ticket/33226
178- (fetchSageDiff {
179- base = "9.6.beta0";
180- name = "giac-1.7.0-45-update.patch";
181- rev = "33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c";
182- sha256 = "sha256-DOyxahf3+IaYdkgmAReNDCorRzMgO8+yiVrJ5TW1km0=";
183- })
184-185- # https://trac.sagemath.org/ticket/33398
186- (fetchSageDiff {
187- base = "9.6.beta4";
188- name = "sympy-1.10-update.patch";
189- rev = "6b7c3a28656180e42163dc10f7b4a571b93e5f27";
190- sha256 = "sha256-fnUyM2yjHkCykKRfzQQ4glcUYmCS/fYzDzmCf0nuebk=";
191- # The patch contains a whitespace change to a file that didn't exist in Sage 9.5.
192- excludes = [ "build/*" "src/sage/manifolds/vector_bundle_fiber_element.py" ];
193- })
194-195 # docutils 0.18.1 now triggers Sphinx warnings. tolerate them for
196- # now, because patching Sphinx is not feasible.
197- # https://github.com/sphinx-doc/sphinx/issues/9777#issuecomment-1104481271
0198 ./patches/docutils-0.18.1-deprecation.patch
199 ];
200
···58 );
59in
60stdenv.mkDerivation rec {
61+ version = "9.6";
62 pname = "sage-src";
6364 src = fetchFromGitHub {
65 owner = "sagemath";
66 repo = "sage";
67 rev = version;
68+ sha256 = "sha256-QY8Yga3hD1WhSCtA2/PVry8hHlMmC31J8jCBFtWgIU0=";
69 };
7071 # Patches needed because of particularities of nix or the way this is packaged.
72 # The goal is to upstream all of them and get rid of this list.
73 nixPatches = [
0000000000074 # Fixes a potential race condition which can lead to transient doctest failures.
75 ./patches/fix-ecl-race.patch
76···109 # https://trac.sagemath.org/ticket/32959
110 ./patches/linbox-1.7-upgrade.patch
11100000000000000000000000000000000000112 # adapted from https://trac.sagemath.org/ticket/23712#comment:22
113 ./patches/tachyon-renamed-focallength.patch
1140000000000000000000000000000000000115 # docutils 0.18.1 now triggers Sphinx warnings. tolerate them for
116+ # now, because patching Sphinx is not feasible. remove when Sphinx
117+ # 5.0 hits nixpkgs.
118+ # https://github.com/sphinx-doc/sphinx/pull/10372
119 ./patches/docutils-0.18.1-deprecation.patch
120 ];
121
···8990 doCheck = true;
91 checkPhase = ''
92+ # sagemath_doc_html tests assume sage tests are being run, so we
93+ # compromise: we run standard tests, but only on files containing
94+ # relevant tests. as of Sage 9.6, there are only 4 such files.
95+ grep -PRl "#.*optional.*sagemath_doc_html" ${src}/src/sage{,_docbuild} | \
96+ xargs ${sage-with-env}/bin/sage -t --optional=sage,sagemath_doc_html
97 '';
98}
+6-2
pkgs/applications/science/math/sage/sagelib.nix
···67, pillow
68, ipykernel
69, networkx
70-, sphinx # TODO: this is in setup.cfg, bug should we override it?
0071}:
7273assert (!blas.isILP64) && (!lapack.isILP64);
···157 networkx
158 jupyter-client
159 ipywidgets
00160 sphinx
161 ];
162···188 # Sage tests already catch any relevant API breakage.
189 # according to the discussion at https://trac.sagemath.org/ticket/33520,
190 # upper bounds will be less noisy starting from Sage 9.6.
191- sed -i 's/==2.1.0rc1/>=2.1.1/' ../gmpy2/install-requires.txt
192 sed -i 's/, <[^, ]*//' ../*/install-requires.txt
193194 for infile in src/*.m4; do
···67, pillow
68, ipykernel
69, networkx
70+, ptyprocess
71+, lrcalc-python
72+, sphinx # TODO: this is in setup.cfg, should we override it?
73}:
7475assert (!blas.isILP64) && (!lapack.isILP64);
···159 networkx
160 jupyter-client
161 ipywidgets
162+ ptyprocess
163+ lrcalc-python
164 sphinx
165 ];
166···192 # Sage tests already catch any relevant API breakage.
193 # according to the discussion at https://trac.sagemath.org/ticket/33520,
194 # upper bounds will be less noisy starting from Sage 9.6.
195+ sed -i 's/==0.5.1/>=0.5.1/' ../ptyprocess/install-requires.txt
196 sed -i 's/, <[^, ]*//' ../*/install-requires.txt
197198 for infile in src/*.m4; do