···11diff --git a/src/sage_docbuild/__init__.py b/src/sage_docbuild/__init__.py
22-index 8a5c1a19d2..21fd192642 100644
22+index b12d56a3c9..df9d949ed1 100644
33--- a/src/sage_docbuild/__init__.py
44+++ b/src/sage_docbuild/__init__.py
55-@@ -89,27 +89,6 @@ def builder_helper(type):
55+@@ -88,30 +88,6 @@ def builder_helper(type):
66 """
77- Returns a function which builds the documentation for
77+ Return a function which builds the documentation for
88 output type ``type``.
99-
1010- TESTS:
···1919- ....: raise BaseException("abort pool operation")
2020- sage: original_runsphinx, sage_docbuild.sphinxbuild.runsphinx = sage_docbuild.sphinxbuild.runsphinx, raiseBaseException
2121-
2222+- sage: from sage.misc.temporary_file import tmp_dir
2323+- sage: os.environ['SAGE_DOC'] = tmp_dir()
2424+- sage: sage.env.var('SAGE_DOC') # random
2225- sage: from sage_docbuild import builder_helper, build_ref_doc
2326- sage: from sage_docbuild import _build_many as build_many
2427- sage: helper = builder_helper("html")
2525-- sage: try:
2828+- sage: try: # optional - sagemath_doc_html
2629- ....: build_many(build_ref_doc, [("docname", "en", "html", {})])
2730- ....: except Exception as E:
2831- ....: "Non-exception during docbuild: abort pool operation" in str(E)
···3033 """
3134 def f(self, *args, **kwds):
3235 output_dir = self._output_dir(type)
3333-@@ -131,10 +110,9 @@ def builder_helper(type):
3636+@@ -139,10 +115,9 @@ def builder_helper(type):
3437 logger.debug(build_command)
35383639 # Run Sphinx with Sage's special logger
···4447 if ABORT_ON_ERROR:
4548 raise
4649diff --git a/src/sage_docbuild/sphinxbuild.py b/src/sage_docbuild/sphinxbuild.py
4747-index d917c3e9d4..551cc8028a 100644
5050+index a39c99ffe9..73be823684 100644
4851--- a/src/sage_docbuild/sphinxbuild.py
4952+++ b/src/sage_docbuild/sphinxbuild.py
5050-@@ -327,3 +327,8 @@ def runsphinx():
5353+@@ -330,3 +330,8 @@ def runsphinx():
5154 sys.stderr = saved_stderr
5255 sys.stdout.flush()
5356 sys.stderr.flush()
+1-1
pkgs/applications/science/math/sage/sage-env.nix
···186186 export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data'
187187188188 # for find_library
189189- export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
189189+ export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular giac]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
190190 '';
191191} // { # equivalent of `passthru`, which `writeTextFile` doesn't support
192192 lib = sagelib;
+5-84
pkgs/applications/science/math/sage/sage-src.nix
···5858 );
5959in
6060stdenv.mkDerivation rec {
6161- version = "9.5";
6161+ version = "9.6";
6262 pname = "sage-src";
63636464 src = fetchFromGitHub {
6565 owner = "sagemath";
6666 repo = "sage";
6767 rev = version;
6868- sha256 = "sha256-uOsLpsGpcIGs8Xr82X82MElnTB2E908gytyNJ8WVD5w=";
6868+ sha256 = "sha256-QY8Yga3hD1WhSCtA2/PVry8hHlMmC31J8jCBFtWgIU0=";
6969 };
70707171 # Patches needed because of particularities of nix or the way this is packaged.
7272 # The goal is to upstream all of them and get rid of this list.
7373 nixPatches = [
7474- # Since https://trac.sagemath.org/ticket/32174, some external features are
7575- # marked as "safe" and get auto-detected, in which case the corresponding
7676- # optional tests are executed. We disable auto-detection of safe features if
7777- # we are doctesting with an "--optional" argument which does not include
7878- # "sage", because tests from autodetected features expect context provided
7979- # by running basic sage tests. This is necessary to test sagemath_doc_html
8080- # separately. See https://trac.sagemath.org/ticket/26110 for a related
8181- # upstream discussion (from the time when Sage still had optional py2/py3
8282- # tags).
8383- ./patches/Only-test-external-software-when-all-of-sage-is.patch
8484-8574 # Fixes a potential race condition which can lead to transient doctest failures.
8675 ./patches/fix-ecl-race.patch
8776···120109 # https://trac.sagemath.org/ticket/32959
121110 ./patches/linbox-1.7-upgrade.patch
122111123123- # https://trac.sagemath.org/ticket/33170
124124- (fetchSageDiff {
125125- base = "9.6.beta5";
126126- name = "ipython-8.1-update.patch";
127127- rev = "4d2b53f1541375861310af3a7f7109c1c2ed475d";
128128- sha256 = "sha256-ELda/VBzsQH7NdFas69fQ35QPUoJCeLx/gxT1j7qGR8=";
129129- })
130130-131131- # https://trac.sagemath.org/ticket/32968
132132- (fetchSageDiff {
133133- base = "9.5";
134134- name = "sphinx-4.3-update.patch";
135135- rev = "fc84f82f52b6f05f512cb359ec7c100f93cf8841";
136136- sha256 = "sha256-bBbfdcnw/9LUOlY8rHJRbFJEdMXK4shosqTNaobTS1Q=";
137137- })
138138-139139- # https://trac.sagemath.org/ticket/33189
140140- (fetchSageDiff {
141141- base = "9.5";
142142- name = "arb-2.22-update.patch";
143143- rev = "53532ddd4e2dc92469c1590ebf0c40f8f69bf579";
144144- sha256 = "sha256-6SoSBvIlqvNwZV3jTB6uPdUtaWIOeNmddi2poK/WvGs=";
145145- })
146146-147147- # TODO: This will not be necessary when Sphinx 4.4.1 is released,
148148- # since some warnings introduced in 4.4.0 will be disabled by then
149149- # (https://github.com/sphinx-doc/sphinx/pull/10126).
150150- # https://trac.sagemath.org/ticket/33272
151151- (fetchSageDiff {
152152- base = "9.5";
153153- name = "sphinx-4.4-warnings.patch";
154154- rev = "97d7958bed441cf2ccc714d88f83d3a8426bc085";
155155- sha256 = "sha256-y1STE0oxswnijGCsBw8eHWWqpmT1XMznIfA0vvX9pFA=";
156156- })
157157-158112 # adapted from https://trac.sagemath.org/ticket/23712#comment:22
159113 ./patches/tachyon-renamed-focallength.patch
160114161161- # https://trac.sagemath.org/ticket/33336
162162- (fetchSageDiff {
163163- base = "9.6.beta2";
164164- name = "scipy-1.8-update.patch";
165165- rev = "9c8235e44ffb509efa8a3ca6cdb55154e2b5066d";
166166- sha256 = "sha256-bfc4ljNOxVnhlmxIuNbjbKl4vJXYq2tlF3Z8bbC8PWw=";
167167- })
168168-169169- # https://trac.sagemath.org/ticket/33495
170170- (fetchSageDiff {
171171- base = "9.6.beta5";
172172- name = "networkx-2.7-update.patch";
173173- rev = "8452003846a7303100847d8d0ed642fc642c11d6";
174174- sha256 = "sha256-A/XMouPlc2sjFp30L+56fBGJXydS2EtzfPOV98FCDqI=";
175175- })
176176-177177- # https://trac.sagemath.org/ticket/33226
178178- (fetchSageDiff {
179179- base = "9.6.beta0";
180180- name = "giac-1.7.0-45-update.patch";
181181- rev = "33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c";
182182- sha256 = "sha256-DOyxahf3+IaYdkgmAReNDCorRzMgO8+yiVrJ5TW1km0=";
183183- })
184184-185185- # https://trac.sagemath.org/ticket/33398
186186- (fetchSageDiff {
187187- base = "9.6.beta4";
188188- name = "sympy-1.10-update.patch";
189189- rev = "6b7c3a28656180e42163dc10f7b4a571b93e5f27";
190190- sha256 = "sha256-fnUyM2yjHkCykKRfzQQ4glcUYmCS/fYzDzmCf0nuebk=";
191191- # The patch contains a whitespace change to a file that didn't exist in Sage 9.5.
192192- excludes = [ "build/*" "src/sage/manifolds/vector_bundle_fiber_element.py" ];
193193- })
194194-195115 # docutils 0.18.1 now triggers Sphinx warnings. tolerate them for
196196- # now, because patching Sphinx is not feasible.
197197- # https://github.com/sphinx-doc/sphinx/issues/9777#issuecomment-1104481271
116116+ # now, because patching Sphinx is not feasible. remove when Sphinx
117117+ # 5.0 hits nixpkgs.
118118+ # https://github.com/sphinx-doc/sphinx/pull/10372
198119 ./patches/docutils-0.18.1-deprecation.patch
199120 ];
200121
+5-1
pkgs/applications/science/math/sage/sagedoc.nix
···89899090 doCheck = true;
9191 checkPhase = ''
9292- ${sage-with-env}/bin/sage -t --optional=sagemath_doc_html --all
9292+ # sagemath_doc_html tests assume sage tests are being run, so we
9393+ # compromise: we run standard tests, but only on files containing
9494+ # relevant tests. as of Sage 9.6, there are only 4 such files.
9595+ grep -PRl "#.*optional.*sagemath_doc_html" ${src}/src/sage{,_docbuild} | \
9696+ xargs ${sage-with-env}/bin/sage -t --optional=sage,sagemath_doc_html
9397 '';
9498}
+6-2
pkgs/applications/science/math/sage/sagelib.nix
···6767, pillow
6868, ipykernel
6969, networkx
7070-, sphinx # TODO: this is in setup.cfg, bug should we override it?
7070+, ptyprocess
7171+, lrcalc-python
7272+, sphinx # TODO: this is in setup.cfg, should we override it?
7173}:
72747375assert (!blas.isILP64) && (!lapack.isILP64);
···157159 networkx
158160 jupyter-client
159161 ipywidgets
162162+ ptyprocess
163163+ lrcalc-python
160164 sphinx
161165 ];
162166···188192 # Sage tests already catch any relevant API breakage.
189193 # according to the discussion at https://trac.sagemath.org/ticket/33520,
190194 # upper bounds will be less noisy starting from Sage 9.6.
191191- sed -i 's/==2.1.0rc1/>=2.1.1/' ../gmpy2/install-requires.txt
195195+ sed -i 's/==0.5.1/>=0.5.1/' ../ptyprocess/install-requires.txt
192196 sed -i 's/, <[^, ]*//' ../*/install-requires.txt
193197194198 for infile in src/*.m4; do