From 0f29ab871f966fbcbede8b76a3a7cbbd3e97e7e1 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Wed, 20 Apr 2022 23:07:49 +0200 Subject: [PATCH] sage: update test expectations --- .../patches/docutils-0.18.1-deprecation.patch | 13 +++++++ .../science/math/sage/sage-src.nix | 38 +++++++++++++++---- 2 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 pkgs/applications/science/math/sage/patches/docutils-0.18.1-deprecation.patch diff --git a/pkgs/applications/science/math/sage/patches/docutils-0.18.1-deprecation.patch b/pkgs/applications/science/math/sage/patches/docutils-0.18.1-deprecation.patch new file mode 100644 index 000000000000..94e0488e21e7 --- /dev/null +++ b/pkgs/applications/science/math/sage/patches/docutils-0.18.1-deprecation.patch @@ -0,0 +1,13 @@ +diff --git a/src/sage/misc/sagedoc.py b/src/sage/misc/sagedoc.py +index 4c56aea078..e51a77ae8a 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 ++ ... ++ FutureWarning: The configuration setting "embed_images" will be removed in Docutils 1.2. Use "image_loading: link". + '...div...File:...Type:...Definition:...identity_matrix...' + + In the 'text' version, double colons have been replaced with diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 04c2355d26aa..b230b0d42a03 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -13,9 +13,14 @@ let # Fetch a diff between `base` and `rev` on sage's git server. # Used to fetch trac tickets by setting the `base` to the last release and the # `rev` to the last commit of the ticket. - fetchSageDiff = { base, name, rev, sha256, squashed ? false, ...}@args: ( + # + # We don't use sage's own build system (which builds all its + # dependencies), so we exclude changes to "build/" from patches by + # default to avoid conflicts. + fetchSageDiff = { base, name, rev, sha256, squashed ? false, excludes ? [ "build/*" ] + , ...}@args: ( fetchpatch ({ - inherit name sha256; + inherit name sha256 excludes; # There are three places to get changes from: # @@ -49,11 +54,7 @@ let "https://github.com/sagemath/sagetrac-mirror/compare/${base}...${rev}.diff" ] else [ "https://git.sagemath.org/sage.git/patch?id2=${base}&id=${rev}" ]; - - # We don't care about sage's own build system (which builds all its dependencies). - # Exclude build system changes to avoid conflicts. - excludes = [ "build/*" ]; - } // builtins.removeAttrs args [ "rev" "base" "sha256" "squashed" ]) + } // builtins.removeAttrs args [ "rev" "base" "sha256" "squashed" "excludes" ]) ); in stdenv.mkDerivation rec { @@ -172,6 +173,29 @@ stdenv.mkDerivation rec { 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 + ./patches/docutils-0.18.1-deprecation.patch ]; patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;