Merge pull request #171511 from collares/sage-9.6

sage: 9.5 -> 9.6
main
7c6f434c 2 years ago committed by GitHub
commit 1d4c47ea08
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      pkgs/applications/science/math/lrcalc/default.nix
  2. 10
      pkgs/applications/science/math/sage/default.nix
  3. 46
      pkgs/applications/science/math/sage/patches/Only-test-external-software-when-all-of-sage-is.patch
  4. 2
      pkgs/applications/science/math/sage/patches/configurationpy-error-verbose.patch
  5. 4
      pkgs/applications/science/math/sage/patches/docutils-0.18.1-deprecation.patch
  6. 17
      pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch
  7. 2
      pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix
  8. 2
      pkgs/applications/science/math/sage/sage-env.nix
  9. 89
      pkgs/applications/science/math/sage/sage-src.nix
  10. 15
      pkgs/applications/science/math/sage/sage.nix
  11. 16
      pkgs/applications/science/math/sage/sagedoc.nix
  12. 8
      pkgs/applications/science/math/sage/sagelib.nix
  13. 31
      pkgs/development/python-modules/lrcalc-python/default.nix
  14. 2
      pkgs/top-level/python-packages.nix

@ -1,18 +1,17 @@
{ lib, stdenv
, fetchFromBitbucket
, fetchpatch
, autoreconfHook
}:
stdenv.mkDerivation rec {
version = "1.2";
version = "2.1";
pname = "lrcalc";
src = fetchFromBitbucket {
owner = "asbuch";
repo = "lrcalc";
rev = "lrcalc-${version}";
sha256 = "1c12d04jdyxkkav4ak8d1aqrv594gzihwhpxvc6p9js0ry1fahss";
sha256 = "0s3amf3z75hnrjyszdndrvk4wp5p630dcgyj341i6l57h43d1p4k";
};
doCheck = true;
@ -21,15 +20,6 @@ stdenv.mkDerivation rec {
autoreconfHook
];
patches = [
# Fix include syntax:
# For private includes, use `#include "..."` instead of `#include <...>`
(fetchpatch {
url = "https://bitbucket.org/asbuch/lrcalc/commits/226981a0/raw/";
sha256 = "02kaqx5s3l642rhh28kn2wg9wr098vzpknxyl4pv627lqa3lv9vm";
})
];
meta = with lib; {
description = "Littlewood-Richardson calculator";
homepage = "http://math.rutgers.edu/~asbuch/lrcalc/";

@ -48,6 +48,12 @@ let
logo64 = "${sage-src}/src/doc/common/themes/sage/static/sageicon.png";
};
jupyter-kernel-specs = pkgs.jupyter-kernel.create {
definitions = pkgs.jupyter-kernel.default // {
sagemath = jupyter-kernel-definition;
};
};
three = callPackage ./threejs-sage.nix { };
# A bash script setting various environment variables to tell sage where
@ -73,7 +79,7 @@ let
# The documentation for sage, building it takes a lot of ram.
sagedoc = callPackage ./sagedoc.nix {
inherit sage-with-env;
inherit python3 maxima;
inherit python3 maxima jupyter-kernel-specs;
};
# sagelib with added wrappers and a dependency on sage-tests to make sure thet tests were run.
@ -167,6 +173,6 @@ let
in
# A wrapper around sage that makes sure sage finds its docs (if they were build).
callPackage ./sage.nix {
inherit sage-tests sage-with-env sagedoc jupyter-kernel-definition;
inherit sage-tests sage-with-env sagedoc jupyter-kernel-specs;
inherit withDoc requireSageTests;
}

@ -1,46 +0,0 @@
diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py
index 01f32fb8e4..4d83dc7b47 100644
--- a/src/sage/doctest/control.py
+++ b/src/sage/doctest/control.py
@@ -1253,6 +1253,7 @@ class DocTestController(SageObject):
self.log("Using --optional=" + self._optional_tags_string())
available_software._allow_external = self.options.optional is True or 'external' in self.options.optional
+ available_software._autodetect_safe = self.options.optional is True or 'sage' in self.options.optional
self.log("Features to be detected: " + ','.join(available_software.detectable()))
self.add_files()
self.expand_files_into_sources()
diff --git a/src/sage/doctest/external.py b/src/sage/doctest/external.py
index 84dae19ea5..badc61466e 100644
--- a/src/sage/doctest/external.py
+++ b/src/sage/doctest/external.py
@@ -409,6 +409,7 @@ class AvailableSoftware(object):
[]
"""
self._allow_external = True
+ self._autodetect_safe = True
# For multiprocessing of doctests, the data self._seen should be
# shared among subprocesses. Thus we use Array class from the
# multiprocessing module.
@@ -430,6 +431,8 @@ class AvailableSoftware(object):
sage: 'internet' in available_software # random, optional - internet
True
"""
+ if not self._autodetect_safe:
+ return False
try:
idx = self._indices[item]
except KeyError:
diff --git a/src/sage/features/sagemath.py b/src/sage/features/sagemath.py
index 433338766d..233623b14a 100644
--- a/src/sage/features/sagemath.py
+++ b/src/sage/features/sagemath.py
@@ -12,7 +12,7 @@ class sagemath_doc_html(StaticFile):
EXAMPLES::
- sage: from sage.features.sagemath import sagemath_doc_html
+ sage: from sage.features.sagemath import sagemath_doc_html # optional - sagemath_doc_html
sage: sagemath_doc_html().is_present() # optional - sagemath_doc_html
FeatureTestResult('sagemath_doc_html', True)
"""

@ -13,7 +13,7 @@ index 67d7d2accf..18279581e2 100644
- True
+ sage: print(output)
+ sage...[False, True]
+ sage...Exiting Sage ...
+ ...
"""
#*****************************************************************************

@ -1,11 +1,11 @@
diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py
index 4c56aea078..e51a77ae8a 100644
index 08c4225b87..3a9bbe4ed0 100644
--- a/src/sage/misc/sagedoc.py
+++ b/src/sage/misc/sagedoc.py
@@ -1402,6 +1402,8 @@ class _sage_doc:
sage: identity_matrix.__doc__ in browse_sage_doc(identity_matrix, 'rst')
True
sage: browse_sage_doc(identity_matrix, 'html', False) # optional - sphinx
sage: browse_sage_doc(identity_matrix, 'html', False) # optional - sphinx sagemath_doc_html
+ ...
+ FutureWarning: The configuration setting "embed_images" will be removed in Docutils 1.2. Use "image_loading: link".
'...div...File:...Type:...Definition:...identity_matrix...'

@ -1,10 +1,10 @@
diff --git a/src/sage_docbuild/__init__.py b/src/sage_docbuild/__init__.py
index 8a5c1a19d2..21fd192642 100644
index b12d56a3c9..df9d949ed1 100644
--- a/src/sage_docbuild/__init__.py
+++ b/src/sage_docbuild/__init__.py
@@ -89,27 +89,6 @@ def builder_helper(type):
@@ -88,30 +88,6 @@ def builder_helper(type):
"""
Returns a function which builds the documentation for
Return a function which builds the documentation for
output type ``type``.
-
- TESTS:
@ -19,10 +19,13 @@ index 8a5c1a19d2..21fd192642 100644
- ....: raise BaseException("abort pool operation")
- sage: original_runsphinx, sage_docbuild.sphinxbuild.runsphinx = sage_docbuild.sphinxbuild.runsphinx, raiseBaseException
-
- sage: from sage.misc.temporary_file import tmp_dir
- sage: os.environ['SAGE_DOC'] = tmp_dir()
- sage: sage.env.var('SAGE_DOC') # random
- sage: from sage_docbuild import builder_helper, build_ref_doc
- sage: from sage_docbuild import _build_many as build_many
- sage: helper = builder_helper("html")
- sage: try:
- sage: try: # optional - sagemath_doc_html
- ....: build_many(build_ref_doc, [("docname", "en", "html", {})])
- ....: except Exception as E:
- ....: "Non-exception during docbuild: abort pool operation" in str(E)
@ -30,7 +33,7 @@ index 8a5c1a19d2..21fd192642 100644
"""
def f(self, *args, **kwds):
output_dir = self._output_dir(type)
@@ -131,10 +110,9 @@ def builder_helper(type):
@@ -139,10 +115,9 @@ def builder_helper(type):
logger.debug(build_command)
# Run Sphinx with Sage's special logger
@ -44,10 +47,10 @@ index 8a5c1a19d2..21fd192642 100644
if ABORT_ON_ERROR:
raise
diff --git a/src/sage_docbuild/sphinxbuild.py b/src/sage_docbuild/sphinxbuild.py
index d917c3e9d4..551cc8028a 100644
index a39c99ffe9..73be823684 100644
--- a/src/sage_docbuild/sphinxbuild.py
+++ b/src/sage_docbuild/sphinxbuild.py
@@ -327,3 +327,8 @@ def runsphinx():
@@ -330,3 +330,8 @@ def runsphinx():
sys.stderr = saved_stderr
sys.stdout.flush()
sys.stderr.flush()

@ -2,6 +2,7 @@
, buildPythonPackage
, sage-src
, sphinx
, jupyter-sphinx
}:
buildPythonPackage rec {
@ -11,6 +12,7 @@ buildPythonPackage rec {
propagatedBuildInputs = [
sphinx
jupyter-sphinx
];
preBuild = ''

@ -186,7 +186,7 @@ writeTextFile rec {
export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data'
# for find_library
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular giac]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
'';
} // { # equivalent of `passthru`, which `writeTextFile` doesn't support
lib = sagelib;

@ -58,30 +58,19 @@ let
);
in
stdenv.mkDerivation rec {
version = "9.5";
version = "9.6";
pname = "sage-src";
src = fetchFromGitHub {
owner = "sagemath";
repo = "sage";
rev = version;
sha256 = "sha256-uOsLpsGpcIGs8Xr82X82MElnTB2E908gytyNJ8WVD5w=";
sha256 = "sha256-QY8Yga3hD1WhSCtA2/PVry8hHlMmC31J8jCBFtWgIU0=";
};
# Patches needed because of particularities of nix or the way this is packaged.
# The goal is to upstream all of them and get rid of this list.
nixPatches = [
# Since https://trac.sagemath.org/ticket/32174, some external features are
# marked as "safe" and get auto-detected, in which case the corresponding
# optional tests are executed. We disable auto-detection of safe features if
# we are doctesting with an "--optional" argument which does not include
# "sage", because tests from autodetected features expect context provided
# by running basic sage tests. This is necessary to test sagemath_doc_html
# separately. See https://trac.sagemath.org/ticket/26110 for a related
# upstream discussion (from the time when Sage still had optional py2/py3
# tags).
./patches/Only-test-external-software-when-all-of-sage-is.patch
# Fixes a potential race condition which can lead to transient doctest failures.
./patches/fix-ecl-race.patch
@ -120,81 +109,13 @@ stdenv.mkDerivation rec {
# https://trac.sagemath.org/ticket/32959
./patches/linbox-1.7-upgrade.patch
# https://trac.sagemath.org/ticket/33170
(fetchSageDiff {
base = "9.6.beta5";
name = "ipython-8.1-update.patch";
rev = "4d2b53f1541375861310af3a7f7109c1c2ed475d";
sha256 = "sha256-ELda/VBzsQH7NdFas69fQ35QPUoJCeLx/gxT1j7qGR8=";
})
# https://trac.sagemath.org/ticket/32968
(fetchSageDiff {
base = "9.5";
name = "sphinx-4.3-update.patch";
rev = "fc84f82f52b6f05f512cb359ec7c100f93cf8841";
sha256 = "sha256-bBbfdcnw/9LUOlY8rHJRbFJEdMXK4shosqTNaobTS1Q=";
})
# https://trac.sagemath.org/ticket/33189
(fetchSageDiff {
base = "9.5";
name = "arb-2.22-update.patch";
rev = "53532ddd4e2dc92469c1590ebf0c40f8f69bf579";
sha256 = "sha256-6SoSBvIlqvNwZV3jTB6uPdUtaWIOeNmddi2poK/WvGs=";
})
# TODO: This will not be necessary when Sphinx 4.4.1 is released,
# since some warnings introduced in 4.4.0 will be disabled by then
# (https://github.com/sphinx-doc/sphinx/pull/10126).
# https://trac.sagemath.org/ticket/33272
(fetchSageDiff {
base = "9.5";
name = "sphinx-4.4-warnings.patch";
rev = "97d7958bed441cf2ccc714d88f83d3a8426bc085";
sha256 = "sha256-y1STE0oxswnijGCsBw8eHWWqpmT1XMznIfA0vvX9pFA=";
})
# adapted from https://trac.sagemath.org/ticket/23712#comment:22
./patches/tachyon-renamed-focallength.patch
# https://trac.sagemath.org/ticket/33336
(fetchSageDiff {
base = "9.6.beta2";
name = "scipy-1.8-update.patch";
rev = "9c8235e44ffb509efa8a3ca6cdb55154e2b5066d";
sha256 = "sha256-bfc4ljNOxVnhlmxIuNbjbKl4vJXYq2tlF3Z8bbC8PWw=";
})
# https://trac.sagemath.org/ticket/33495
(fetchSageDiff {
base = "9.6.beta5";
name = "networkx-2.7-update.patch";
rev = "8452003846a7303100847d8d0ed642fc642c11d6";
sha256 = "sha256-A/XMouPlc2sjFp30L+56fBGJXydS2EtzfPOV98FCDqI=";
})
# https://trac.sagemath.org/ticket/33226
(fetchSageDiff {
base = "9.6.beta0";
name = "giac-1.7.0-45-update.patch";
rev = "33ea2adf01e9e2ce9f1e33779f0b1ac0d9d1989c";
sha256 = "sha256-DOyxahf3+IaYdkgmAReNDCorRzMgO8+yiVrJ5TW1km0=";
})
# https://trac.sagemath.org/ticket/33398
(fetchSageDiff {
base = "9.6.beta4";
name = "sympy-1.10-update.patch";
rev = "6b7c3a28656180e42163dc10f7b4a571b93e5f27";
sha256 = "sha256-fnUyM2yjHkCykKRfzQQ4glcUYmCS/fYzDzmCf0nuebk=";
# The patch contains a whitespace change to a file that didn't exist in Sage 9.5.
excludes = [ "build/*" "src/sage/manifolds/vector_bundle_fiber_element.py" ];
})
# docutils 0.18.1 now triggers Sphinx warnings. tolerate them for
# now, because patching Sphinx is not feasible.
# https://github.com/sphinx-doc/sphinx/issues/9777#issuecomment-1104481271
# now, because patching Sphinx is not feasible. remove when Sphinx
# 5.0 hits nixpkgs.
# https://github.com/sphinx-doc/sphinx/pull/10372
./patches/docutils-0.18.1-deprecation.patch
];

@ -2,8 +2,7 @@
, makeWrapper
, sage-tests
, sage-with-env
, jupyter-kernel-definition
, jupyter-kernel
, jupyter-kernel-specs
, sagedoc
, withDoc
, requireSageTests
@ -12,14 +11,6 @@
# A wrapper that makes sure sage finds its docs (if they were build) and the
# jupyter kernel spec.
let
# generate kernel spec + default kernels
kernel-specs = jupyter-kernel.create {
definitions = jupyter-kernel.default // {
sagemath = jupyter-kernel-definition;
};
};
in
stdenv.mkDerivation rec {
version = src.version;
pname = "sage";
@ -43,7 +34,7 @@ stdenv.mkDerivation rec {
--set SAGE_DOC_SRC_OVERRIDE "${src}/src/doc" ${
lib.optionalString withDoc "--set SAGE_DOC_OVERRIDE ${sagedoc}/share/doc/sage"
} \
--prefix JUPYTER_PATH : "${kernel-specs}"
--prefix JUPYTER_PATH : "${jupyter-kernel-specs}"
'';
doInstallCheck = withDoc;
@ -58,7 +49,7 @@ stdenv.mkDerivation rec {
quicktest = sage-tests.override { longTests = false; timeLimit = 600; }; # as many tests as possible in ~10m
doc = sagedoc;
lib = sage-with-env.env.lib;
kernelspec = jupyter-kernel-definition;
kernelspec = jupyter-kernel-specs.definition.sagemath;
};
meta = with lib; {

@ -1,6 +1,7 @@
{ stdenv
, sage-with-env
, python3
, jupyter-kernel-specs
, maxima
, tachyon
, jmol
@ -59,10 +60,15 @@ stdenv.mkDerivation rec {
OUTPUT="$OUTPUT_DIR/options.txt"
${sage-with-env}/bin/sage -advanced > "$OUTPUT"
${sage-with-env}/bin/sage --docbuild \
# jupyter-sphinx calls the sagemath jupyter kernel during docbuild
export JUPYTER_PATH=${jupyter-kernel-specs}
# sage --docbuild unsets JUPYTER_PATH, so we call sage_docbuild directly
# https://trac.sagemath.org/ticket/33650#comment:32
${sage-with-env}/bin/sage --python3 -m sage_docbuild \
--mathjax \
--no-pdf-links \
all html
all html < /dev/null
'';
installPhase = ''
@ -83,6 +89,10 @@ stdenv.mkDerivation rec {
doCheck = true;
checkPhase = ''
${sage-with-env}/bin/sage -t --optional=sagemath_doc_html --all
# sagemath_doc_html tests assume sage tests are being run, so we
# compromise: we run standard tests, but only on files containing
# relevant tests. as of Sage 9.6, there are only 4 such files.
grep -PRl "#.*optional.*sagemath_doc_html" ${src}/src/sage{,_docbuild} | \
xargs ${sage-with-env}/bin/sage -t --optional=sage,sagemath_doc_html
'';
}

@ -67,7 +67,9 @@
, pillow
, ipykernel
, networkx
, sphinx # TODO: this is in setup.cfg, bug should we override it?
, ptyprocess
, lrcalc-python
, sphinx # TODO: this is in setup.cfg, should we override it?
}:
assert (!blas.isILP64) && (!lapack.isILP64);
@ -157,6 +159,8 @@ buildPythonPackage rec {
networkx
jupyter-client
ipywidgets
ptyprocess
lrcalc-python
sphinx
];
@ -188,7 +192,7 @@ buildPythonPackage rec {
# Sage tests already catch any relevant API breakage.
# according to the discussion at https://trac.sagemath.org/ticket/33520,
# upper bounds will be less noisy starting from Sage 9.6.
sed -i 's/==2.1.0rc1/>=2.1.1/' ../gmpy2/install-requires.txt
sed -i 's/==0.5.1/>=0.5.1/' ../ptyprocess/install-requires.txt
sed -i 's/, <[^, ]*//' ../*/install-requires.txt
for infile in src/*.m4; do

@ -0,0 +1,31 @@
{ lib
, fetchPypi
, buildPythonPackage
, cython
, pkg-config
, lrcalc
}:
buildPythonPackage rec {
pname = "lrcalc-python";
version = "2.1";
src = fetchPypi {
inherit version;
pname = "lrcalc";
sha256 = "e3a0509aeda487b412b391a52e817ca36b5c063a8305e09fd54d53259dd6aaa9";
};
nativeBuildInputs = [ cython pkg-config ];
buildInputs = [ lrcalc ];
pythonImportsCheck = [ "lrcalc" ];
meta = with lib; {
description = "Littlewood-Richardson Calculator bindings";
homepage = "https://sites.math.rutgers.edu/~asbuch/lrcalc/";
maintainers = teams.sage.members;
license = licenses.gpl3;
};
}

@ -4998,6 +4998,8 @@ in {
losant-rest = callPackage ../development/python-modules/losant-rest { };
lrcalc-python = callPackage ../development/python-modules/lrcalc-python { };
lru-dict = callPackage ../development/python-modules/lru-dict { };
lsassy = callPackage ../development/python-modules/lsassy { };

Loading…
Cancel
Save