From dbd743b99e377238c0e695cfd10d8056ba98aed6 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Sat, 6 Aug 2016 04:49:46 -0300 Subject: sagemath-7.3-3.parabola1: updating version --- libre/sagemath/PKGBUILD | 38 +-- libre/sagemath/disable-fes.patch | 6 +- libre/sagemath/env.patch | 52 +--- libre/sagemath/increase-rtol.patch | 37 +++ libre/sagemath/is-package-installed.patch | 56 ++-- libre/sagemath/linbox-1.4.patch | 50 ++-- libre/sagemath/paths.patch | 34 +-- libre/sagemath/sagemath-ipython5.patch | 480 ++++++++++++++++++++++++++++-- libre/sagemath/skip-check.patch | 7 +- 9 files changed, 585 insertions(+), 175 deletions(-) create mode 100644 libre/sagemath/increase-rtol.patch (limited to 'libre') diff --git a/libre/sagemath/PKGBUILD b/libre/sagemath/PKGBUILD index 45d2b5e47..448bdcc17 100644 --- a/libre/sagemath/PKGBUILD +++ b/libre/sagemath/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 183005 2016-07-16 21:09:23Z arojas $ +# $Id: PKGBUILD 185390 2016-08-05 22:06:53Z arojas $ # Maintainer (Arch): Evgeniy Alekseev # Maintainer (Arch): Antonio Rojas # Contributor (Arch): Daniel Wallace @@ -10,8 +10,8 @@ # Maintainer: André Silva pkgname=sagemath -pkgver=7.2 -pkgrel=7.parabola1 +pkgver=7.3 +pkgrel=3.parabola1 pkgdesc="Free Mathematics Software, free software replacement of Magma, Maple, Mathematica, and Matlab, without nonfree nauty support" arch=(i686 x86_64 armv7h) url="http://www.sagemath.org" @@ -28,32 +28,35 @@ optdepends=('cython2: to compile cython code' 'python2-pkgconfig: to compile cyt 'modular_decomposition: modular decomposition of graphs' 'ffmpeg: to export animations to video' 'imagemagick: to show animations' 'coxeter3: Coxeter groups implementation' 'cryptominisat: SAT solver' 'gap-data: for computing Galois groups' 'lrs: Algorithms for linear reverse search used in game theory and for computing volume of polytopes' - 'python2-igraph: igraph backend for graph theory' - 'jupyter-notebook: Jupyter notebook interface' 'atlas-lapack: improved performance for some linear algebra operations') -makedepends=(cython2 boost ratpoints symmetrica fflas-ffpack python2-jinja coin-or-cbc + 'libhomfly: for computing the homfly polynomial of links' 'libbraiding: for computing in braid groups' + 'python2-igraph: igraph backend for graph theory' 'sage-notebook-exporter: convert flask notebooks to jupyter' + 'jupyter-notebook: Jupyter notebook interface') +makedepends=(cython2 boost ratpoints symmetrica fflas-ffpack python2-jinja coin-or-cbc libhomfly libbraiding mcqd coxeter3 cryptominisat modular_decomposition bliss-graphs tdlib python2-pkgconfig meataxe) # libfes conflicts=(sage-mathematics) replaces=(sage-mathematics) provides=(sage-mathematics) source=("$pkgname-$pkgver.tar.gz::https://github.com/sagemath/sage/archive/$pkgver.tar.gz" anal.h env.patch paths.patch clean.patch skip-check.patch cython-sys-path.patch is-package-installed.patch package.patch - disable-fes.patch jupyter-path.patch test-optional.patch python-2.7.11.patch linbox-1.4.patch ecm-7.patch sagemath-ipython5.patch) -md5sums=('2afeb8f75a33107fef5d509698c0eabc' + disable-fes.patch jupyter-path.patch test-optional.patch python-2.7.11.patch linbox-1.4.patch ecm-7.patch + sagemath-ipython5.patch increase-rtol.patch) +md5sums=('cb2aed3d24de7b2228a9b34e81a27870' 'a906a180d198186a39820b0a2f9a9c63' - 'f6c62f0ccc168c5e6e3dd9d6f73f6389' - '52d30e91110183489f66d7bf73c36c64' + 'd4d3c235c99b2bc92dde9f6e53935a8d' + '45b84ae5579273196df44f7464a01a30' '6d9ae0978ce6a05a0da2cafdfb178a09' - '5947a420a0b1483f0cbc74c76895789b' + '6cafcb381437d4751fd55b25d5090987' 'a1bcdd3fe620dbae60ed8b0e98b2ece7' - '541988696465f204235d595a349017f3' + 'b3ecf7c93a90e0afccbc686af9fdc85f' '9ba81f717ffd4e20b8b2f2a318307488' - '4eb23a3c7363258bc9ba764d6e5512ba' + '06a67e611d10aa2381efe1f08ea4ffd9' '16b529194c6105c3364127bd8f1efa83' 'cdcabd475b80afe0534a5621e972736e' 'ef927896f2071b442b1d07d7e69f5f3a' - '9f1cef3e477bafebe2ad301db56db8a2' + 'a276f0fbbff6eade409d0569ebd728d4' '0c9a57d35de80c2cd418ebec912efbbb' - '55e75afd249048a8718c4377c22afa52') + '2bcaca7284dda963ebdc17daf78cf6c9' + '39d3fded716d2a7ae0ab03e0896b7497') prepare(){ cd sage-$pkgver @@ -87,6 +90,8 @@ prepare(){ patch -p1 -i ../cython-sys-path.patch # fix regressions with ECM 7 patch -p1 -i ../ecm-7.patch +# increase numerical tolerance, needed by scipy 0.18 + patch -p1 -i ../increase-rtol.patch # Upstream patches # fix build against libfes 0.2 http://trac.sagemath.org/ticket/15209 @@ -110,9 +115,6 @@ prepare(){ # copy required private PARI header mkdir -p src/pari cp "$srcdir"/anal.h src/pari/anal.h - -# remove developer interface - rm -r src/sage/dev } diff --git a/libre/sagemath/disable-fes.patch b/libre/sagemath/disable-fes.patch index 873a6a663..086231d70 100644 --- a/libre/sagemath/disable-fes.patch +++ b/libre/sagemath/disable-fes.patch @@ -1,8 +1,8 @@ --- src/module_list.py.orig 2015-06-07 11:29:30.710612146 +0200 +++ src/module_list.py 2015-06-07 11:30:21.877506106 +0200 -@@ -685,11 +685,11 @@ - include_dirs = [SAGE_INC + '/ecl'], - depends = [SAGE_INC + '/ecl/ecl.h']), +@@ -564,11 +564,11 @@ + sources = ["sage/libs/ecl.pyx"], + libraries = ["ecl"]), - OptionalExtension("sage.libs.fes", - ["sage/libs/fes.pyx"], diff --git a/libre/sagemath/env.patch b/libre/sagemath/env.patch index 0ec5fc68c..5cb93b75f 100644 --- a/libre/sagemath/env.patch +++ b/libre/sagemath/env.patch @@ -70,11 +70,11 @@ +export SAGE_DOC_SRC="/usr/share/doc/sage" +export SAGE_DOC="/usr/share/doc/sage" - # We offer a toolchain option, so if $SAGE_LOCAL/toolchain/toolchain-env exists source it. - # Since the user might do something crazy we do not do any checks, but hope for the best. -@@ -309,9 +267,6 @@ - GIT_TEMPLATE_DIR="$SAGE_LOCAL"/share/git-core/templates && export GIT_TEMPLATE_DIR - GIT_EXEC_PATH="$SAGE_LOCAL"/libexec/git-core && export GIT_EXEC_PATH + if [ "$SAGE_BANNER" = "bare" ]; then + export SAGE_BANNER_TEXT=$(cat "$SAGE_ROOT/VERSION.txt") +@@ -319,9 +277,6 @@ + GPHELP="$SAGE_LOCAL/bin/gphelp" && export GPHELP + GPDOCDIR="$SAGE_LOCAL/share/pari/doc" && export GPDOCDIR -SINGULARPATH="$SAGE_LOCAL/share/singular" && export SINGULARPATH -SINGULAR_EXECUTABLE="$SAGE_LOCAL/bin/Singular" && export SINGULAR_EXECUTABLE @@ -82,7 +82,7 @@ if [ -z "$SAGE_REPO_ANONYMOUS" ]; then SAGE_REPO_ANONYMOUS="git://trac.sagemath.org/sage.git" export SAGE_REPO_ANONYMOUS -@@ -363,38 +318,33 @@ +@@ -364,10 +319,10 @@ export SAGE_STARTUP_FILE fi @@ -97,48 +97,16 @@ if [ "$PYTHON_EGG_CACHE" = "" ]; then PYTHON_EGG_CACHE="$DOT_SAGE/.python-eggs" - export PYTHON_EGG_CACHE - fi - - # Set PYTHONUSERBASE to avoid picking up non-Sage versions of - # Matplotlib, numpy, etc. See http://trac.sagemath.org/ticket/19612. - # - # For more history (it used to be PYTHONNOUSERSITE=yes which killed - # the ability to do "sage -pip install PACKAGE --user"), see - # http://trac.sagemath.org/ticket/14243 and - # http://trac.sagemath.org/ticket/18955. - - if [ "$PYTHONUSERBASE" = "" ]; then - PYTHONUSERBASE="$DOT_SAGE/local" - export PYTHONUSERBASE - fi - --if [ -d "$SAGE_LOCAL/lib/python" ]; then -- PYTHONPATH="$SAGE_LOCAL/lib/python:$SAGE_LOCAL/lib/python/site_packages" -- if [ -n "$SAGE_PATH" ]; then -- PYTHONPATH="$SAGE_PATH:$PYTHONPATH" -- fi -- PYTHONHOME="$SAGE_LOCAL" -- export PYTHONPATH -- export PYTHONHOME --fi -+PYTHONPATH="/usr/lib/sage/site-packages:$PYTHONPATH" -+PYTHONHOME="$SAGE_ROOT" -+export PYTHONPATH -+export PYTHONHOME - - if [ -z "${SAGE_ORIG_LD_LIBRARY_PATH_SET}" ]; then - SAGE_ORIG_LD_LIBRARY_PATH=$LD_LIBRARY_PATH && export SAGE_ORIG_LD_LIBRARY_PATH -@@ -431,8 +378,6 @@ +@@ -453,8 +400,6 @@ fi fi fi -MAXIMA_PREFIX="$SAGE_ROOT/local" && export MAXIMA_PREFIX - - ############ architecture flags + PERL5LIB="$SAGE_LOCAL/lib/perl5:$PERL5LIB" && export PERL5LIB - # Support flags to change the build architecture. Currently, this is -@@ -602,9 +547,6 @@ + ############ architecture flags +@@ -622,9 +567,6 @@ LD_LIBRARY_PATH="$SAGE_LOCAL/bin:$LD_LIBRARY_PATH" && export LD_LIBRARY_PATH fi diff --git a/libre/sagemath/increase-rtol.patch b/libre/sagemath/increase-rtol.patch new file mode 100644 index 000000000..dc0ff8799 --- /dev/null +++ b/libre/sagemath/increase-rtol.patch @@ -0,0 +1,37 @@ +diff -ru sage-7.3.orig/src/sage/coding/code_bounds.py sage-7.3/src/sage/coding/code_bounds.py +--- sage-7.3.orig/src/sage/coding/code_bounds.py 2016-08-05 20:26:10.033204091 +0200 ++++ sage-7.3/src/sage/coding/code_bounds.py 2016-08-05 20:32:27.276579565 +0200 +@@ -554,7 +554,7 @@ + if q < 2: # Here we check that q is actually at least 2 + raise ValueError("The value q must be an integer greater than 1") + +- eps = 4.5e-16 # find_root has about this as the default xtol ++ eps = 4.5e-15 # find_root has about this as the default xtol + ymax = 1 - 1/q + if x <= eps: + return 0 +diff -ru sage-7.3.orig/src/sage/numerical/optimize.py sage-7.3/src/sage/numerical/optimize.py +--- sage-7.3.orig/src/sage/numerical/optimize.py 2016-08-05 20:26:10.816536625 +0200 ++++ sage-7.3/src/sage/numerical/optimize.py 2016-08-05 20:32:21.449907130 +0200 +@@ -15,7 +15,7 @@ + from sage.rings.real_double import RDF + + +-def find_root(f, a, b, xtol=10e-13, rtol=4.5e-16, maxiter=100, full_output=False): ++def find_root(f, a, b, xtol=10e-13, rtol=4.5e-15, maxiter=100, full_output=False): + """ + Numerically find a root of ``f`` on the closed interval `[a,b]` + (or `[b,a]`) if possible, where ``f`` is a function in the one variable. +diff -ru sage-7.3.orig/src/sage/symbolic/expression.pyx sage-7.3/src/sage/symbolic/expression.pyx +--- sage-7.3.orig/src/sage/symbolic/expression.pyx 2016-08-05 20:26:11.333202767 +0200 ++++ sage-7.3/src/sage/symbolic/expression.pyx 2016-08-05 20:32:14.236566826 +0200 +@@ -10884,7 +10884,7 @@ + ret = ret[0] + return ret + +- def find_root(self, a, b, var=None, xtol=10e-13, rtol=4.5e-16, maxiter=100, full_output=False): ++ def find_root(self, a, b, var=None, xtol=10e-13, rtol=4.5e-15, maxiter=100, full_output=False): + """ + Numerically find a root of self on the closed interval [a,b] (or + [b,a]) if possible, where self is a function in the one variable. + diff --git a/libre/sagemath/is-package-installed.patch b/libre/sagemath/is-package-installed.patch index 3b6efc22b..0f1c59084 100644 --- a/libre/sagemath/is-package-installed.patch +++ b/libre/sagemath/is-package-installed.patch @@ -2,15 +2,15 @@ diff --git a/src/sage/databases/cremona.py b/src/sage/databases/cremona.py index 0a5f794..2969d92 100644 --- a/src/sage/databases/cremona.py +++ b/src/sage/databases/cremona.py -@@ -52,7 +52,6 @@ from sage.misc.prandom import randint +@@ -53,7 +53,6 @@ from sage.misc.prandom import randint import sage.schemes.elliptic_curves.constructor as elliptic - from sql_db import SQLDatabase, verify_column + from .sql_db import SQLDatabase, verify_column -from sage.misc.package import is_package_installed from sage.env import SAGE_SHARE from sage.misc.all import walltime -@@ -827,7 +826,7 @@ class MiniCremonaDatabase(SQLDatabase): +@@ -828,7 +827,7 @@ class MiniCremonaDatabase(SQLDatabase): if N < self.largest_conductor(): message = "There is no elliptic curve with label " + label \ + " in the database" @@ -19,7 +19,7 @@ index 0a5f794..2969d92 100644 message = "There is no elliptic curve with label " + label \ + " in the currently available databases" else: -@@ -1676,7 +1675,7 @@ def CremonaDatabase(name=None,mini=None,set_global=None): +@@ -1677,7 +1676,7 @@ def CremonaDatabase(name=None,mini=None,set_global=None): if name is None and not set_global: return _db if set_global and name is None: @@ -32,7 +32,7 @@ diff --git a/src/sage/game_theory/normal_form_game.py b/src/sage/game_theory/nor index b917d2a..80fb20c 100644 --- a/src/sage/game_theory/normal_form_game.py +++ b/src/sage/game_theory/normal_form_game.py -@@ -612,8 +612,9 @@ from sage.rings.all import QQ +@@ -614,8 +614,9 @@ from sage.rings.all import QQ from sage.structure.sage_object import SageObject from sage.matrix.constructor import matrix from sage.matrix.constructor import vector @@ -43,7 +43,7 @@ index b917d2a..80fb20c 100644 try: from gambit import Game -@@ -1315,13 +1316,13 @@ class NormalFormGame(SageObject, MutableMapping): +@@ -1317,13 +1318,13 @@ class NormalFormGame(SageObject, MutableMapping): raise ValueError("utilities have not been populated") if not algorithm: @@ -63,7 +63,7 @@ diff --git a/src/sage/geometry/polyhedron/base.py b/src/sage/geometry/polyhedron index 2f58d8b..eb519a2 100644 --- a/src/sage/geometry/polyhedron/base.py +++ b/src/sage/geometry/polyhedron/base.py -@@ -20,7 +20,6 @@ import six +@@ -21,7 +21,6 @@ import six from sage.structure.element import Element, coerce_binop, is_Vector from sage.misc.all import cached_method, prod @@ -71,7 +71,7 @@ index 2f58d8b..eb519a2 100644 from sage.rings.all import QQ, ZZ from sage.rings.real_double import RDF -@@ -3690,7 +3689,9 @@ class Polyhedron_base(Element): +@@ -3691,7 +3690,9 @@ class Polyhedron_base(Element): David Avis's lrs program. """ @@ -103,7 +103,7 @@ diff --git a/src/sage/graphs/generic_graph.py b/src/sage/graphs/generic_graph.py index 252984f..ce19682 100644 --- a/src/sage/graphs/generic_graph.py +++ b/src/sage/graphs/generic_graph.py -@@ -7833,7 +7833,6 @@ class GenericGraph(GenericGraph_pyx): +@@ -7856,7 +7856,6 @@ class GenericGraph(GenericGraph_pyx): sage: abs(flow_ff-flow_igraph) < 0.00001 # optional python_igraph True """ @@ -111,7 +111,7 @@ index 252984f..ce19682 100644 self._scream_if_not_simple(allow_loops=True) if vertex_bound and algorithm in ["FF", "igraph"]: raise ValueError("This method does not support both " + -@@ -7851,10 +7850,12 @@ class GenericGraph(GenericGraph_pyx): +@@ -7874,10 +7873,12 @@ class GenericGraph(GenericGraph_pyx): if algorithm is None: if vertex_bound: algorithm = "LP" @@ -127,7 +127,7 @@ index 252984f..ce19682 100644 if (algorithm == "FF"): return self._ford_fulkerson(x,y, value_only=value_only, integer=integer, use_edge_labels=use_edge_labels) -@@ -20134,17 +20135,22 @@ class GenericGraph(GenericGraph_pyx): +@@ -20251,17 +20252,22 @@ class GenericGraph(GenericGraph_pyx): Subgroup of (Permutation Group with generators [(0,7)(1,4)(2,3)(6,8)]) generated by [(0,7)(1,4)(2,3)(6,8)]] """ @@ -156,7 +156,7 @@ index 252984f..ce19682 100644 A = automorphism_group(self, partition) -@@ -20786,17 +20792,22 @@ class GenericGraph(GenericGraph_pyx): +@@ -20903,17 +20909,22 @@ class GenericGraph(GenericGraph_pyx): True """ @@ -189,7 +189,7 @@ diff --git a/src/sage/graphs/graph_generators.py b/src/sage/graphs/graph_generat index 5919ab3..1766796 100644 --- a/src/sage/graphs/graph_generators.py +++ b/src/sage/graphs/graph_generators.py -@@ -1192,8 +1192,9 @@ class GraphGenerators(): +@@ -1195,8 +1195,9 @@ class GraphGenerators(): .. [buckygen] \G. Brinkmann, J. Goedgebeur and B.D. McKay, Generation of Fullerenes, Journal of Chemical Information and Modeling, 52(11):2910-2918, 2012. """ @@ -201,7 +201,7 @@ index 5919ab3..1766796 100644 raise TypeError("the optional buckygen package is not installed") # number of vertices should be positive -@@ -1277,8 +1278,9 @@ class GraphGenerators(): +@@ -1280,8 +1281,9 @@ class GraphGenerators(): .. [benzene] \G. Brinkmann, G. Caporossi and P. Hansen, A Constructive Enumeration of Fusenes and Benzenoids, Journal of Algorithms, 45:155-166, 2002. """ @@ -213,7 +213,7 @@ index 5919ab3..1766796 100644 raise TypeError("the optional benzene package is not installed") # number of hexagons should be positive -@@ -1430,8 +1432,9 @@ class GraphGenerators(): +@@ -1433,8 +1435,9 @@ class GraphGenerators(): .. [plantri] \G. Brinkmann and B.D. McKay, Fast generation of planar graphs, MATCH-Communications in Mathematical and in Computer Chemistry, 58(2):323-357, 2007. """ @@ -225,7 +225,7 @@ index 5919ab3..1766796 100644 raise TypeError("the optional plantri package is not installed") # number of vertices should be positive -@@ -1629,8 +1632,9 @@ class GraphGenerators(): +@@ -1632,8 +1635,9 @@ class GraphGenerators(): sage: [g.size() for g in graphs.triangulations(6, minimum_connectivity=3)] # optional plantri [12, 12] """ @@ -237,7 +237,7 @@ index 5919ab3..1766796 100644 raise TypeError("the optional plantri package is not installed") # number of vertices should be positive -@@ -1783,8 +1787,9 @@ class GraphGenerators(): +@@ -1786,8 +1790,9 @@ class GraphGenerators(): sage: [len(g) for g in graphs.quadrangulations(12, no_nonfacial_quadrangles=True, dual=True)] # optional plantri [10, 10] """ @@ -293,7 +293,7 @@ diff --git a/src/sage/groups/perm_gps/permgroup.py b/src/sage/groups/perm_gps/pe index e42db61..d4d5684 100644 --- a/src/sage/groups/perm_gps/permgroup.py +++ b/src/sage/groups/perm_gps/permgroup.py -@@ -143,7 +143,6 @@ from sage.groups.perm_gps.permgroup_element import PermutationGroupElement, stan +@@ -145,7 +145,6 @@ from sage.groups.perm_gps.permgroup_element import PermutationGroupElement, stan from sage.groups.abelian_gps.abelian_group import AbelianGroup from sage.misc.cachefunc import cached_method from sage.groups.class_function import ClassFunction @@ -301,7 +301,7 @@ index e42db61..d4d5684 100644 from sage.sets.finite_enumerated_set import FiniteEnumeratedSet from sage.categories.all import FiniteEnumeratedSets from sage.groups.conjugacy_classes import ConjugacyClassGAP -@@ -188,8 +187,6 @@ def hap_decorator(f): +@@ -190,8 +189,6 @@ def hap_decorator(f): """ @wraps(f) def wrapped(self, n, p=0): @@ -310,7 +310,7 @@ index e42db61..d4d5684 100644 load_hap() from sage.arith.all import is_prime if not (p == 0 or is_prime(p)): -@@ -1681,9 +1678,7 @@ class PermutationGroup_generic(group.FiniteGroup): +@@ -1683,9 +1680,7 @@ class PermutationGroup_generic(group.FiniteGroup): try: return [Integer(n) for n in self._gap_().IdGroup()] except RuntimeError: @@ -321,7 +321,7 @@ index e42db61..d4d5684 100644 def id(self): """ -@@ -1734,9 +1729,7 @@ class PermutationGroup_generic(group.FiniteGroup): +@@ -1736,9 +1731,7 @@ class PermutationGroup_generic(group.FiniteGroup): try: return Integer(self._gap_().PrimitiveIdentification()) except RuntimeError: @@ -332,7 +332,7 @@ index e42db61..d4d5684 100644 def center(self): """ -@@ -4112,8 +4105,6 @@ class PermutationGroup_generic(group.FiniteGroup): +@@ -4114,8 +4107,6 @@ class PermutationGroup_generic(group.FiniteGroup): - David Joyner and Graham Ellis """ @@ -345,23 +345,23 @@ diff --git a/src/sage/misc/all.py b/src/sage/misc/all.py index 90e6985..21daeb0 100644 --- a/src/sage/misc/all.py +++ b/src/sage/misc/all.py -@@ -52,11 +52,6 @@ from fpickle import pickle_function, unpickle_function +@@ -53,11 +53,6 @@ from fpickle import pickle_function, unpickle_function - from dist import install_scripts + from .dist import install_scripts --from package import (install_package, +-from .package import (install_package, - installed_packages, is_package_installed, - standard_packages, optional_packages, experimental_packages, - upgrade, package_versions) - - from pager import pager + from .pager import pager lazy_import('sage.misc.sagedoc', ['browse_sage_doc', diff --git a/src/sage/rings/polynomial/multi_polynomial_sequence.py b/src/sage/rings/polynomial/multi_polynomial_sequence.py index da41cb0..49cae0b 100644 --- a/src/sage/rings/polynomial/multi_polynomial_sequence.py +++ b/src/sage/rings/polynomial/multi_polynomial_sequence.py -@@ -158,7 +158,6 @@ from sage.misc.cachefunc import cached_method +@@ -159,7 +159,6 @@ from sage.misc.cachefunc import cached_method from types import GeneratorType from sage.misc.converting_dict import KeyConvertingDict @@ -369,7 +369,7 @@ index da41cb0..49cae0b 100644 from sage.structure.sequence import Sequence, Sequence_generic -@@ -1428,10 +1427,11 @@ class PolynomialSequence_gf2(PolynomialSequence_generic): +@@ -1429,10 +1428,11 @@ class PolynomialSequence_gf2(PolynomialSequence_generic): if S != []: if algorithm == "exhaustive_search": diff --git a/libre/sagemath/linbox-1.4.patch b/libre/sagemath/linbox-1.4.patch index 5897df763..b3955eb51 100644 --- a/libre/sagemath/linbox-1.4.patch +++ b/libre/sagemath/linbox-1.4.patch @@ -53,7 +53,7 @@ index a49ed36..7798cb8 100644 ) ######################################################### -@@ -85,12 +112,6 @@ except ValueError: +@@ -91,12 +118,6 @@ except ValueError: singular_libs = ['singular', 'flint', 'ntl', 'gmpxx', 'gmp', 'readline', 'm'] ######################################################### @@ -66,7 +66,7 @@ index a49ed36..7798cb8 100644 ### Library order ######################################################### -@@ -105,8 +126,7 @@ givaro_extra_compile_args =['-D__STDC_LIMIT_MACROS'] +@@ -111,8 +132,7 @@ givaro_extra_compile_args =['-D__STDC_LIMIT_MACROS'] # at the very end of the list. library_order_list = [ "singular", "ec", "ecm", @@ -75,8 +75,8 @@ index a49ed36..7798cb8 100644 +] + linbox_libs + gsl_libs + [ "pari", "flint", "ratpoints", "ecl", "glpk", "ppl", "arb", "fplll", "mpfi", "mpfr", "mpc", "gmp", "gmpxx", - "polybori", -@@ -593,13 +613,10 @@ ext_modules = [ + "brial", +@@ -611,13 +631,10 @@ ext_modules = [ Extension('sage.libs.linbox.linbox', sources = ['sage/libs/linbox/linbox.pyx'], @@ -92,7 +92,7 @@ index a49ed36..7798cb8 100644 Extension('sage.libs.lcalc.lcalc_Lfunction', sources = ['sage/libs/lcalc/lcalc_Lfunction.pyx'], -@@ -645,9 +662,8 @@ ext_modules = [ +@@ -665,9 +682,8 @@ ext_modules = [ Extension('sage.libs.singular.singular', sources = ['sage/libs/singular/singular.pyx'], @@ -104,7 +104,7 @@ index a49ed36..7798cb8 100644 Extension('sage.libs.singular.polynomial', sources = ['sage/libs/singular/polynomial.pyx'], -@@ -667,8 +683,7 @@ ext_modules = [ +@@ -687,8 +703,7 @@ ext_modules = [ Extension('sage.libs.singular.function', sources = ['sage/libs/singular/function.pyx'], libraries = singular_libs, @@ -114,7 +114,7 @@ index a49ed36..7798cb8 100644 Extension('sage.libs.singular.option', sources = ['sage/libs/singular/option.pyx'], -@@ -923,19 +938,17 @@ ext_modules = [ +@@ -944,19 +959,17 @@ ext_modules = [ Extension('sage.matrix.matrix_modn_dense_float', sources = ['sage/matrix/matrix_modn_dense_float.pyx'], language="c++", @@ -122,7 +122,7 @@ index a49ed36..7798cb8 100644 + libraries = linbox_libs + cblas_libs, library_dirs = cblas_library_dirs, - include_dirs = cblas_include_dirs, -- extra_compile_args = ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args), +- extra_compile_args = nocxx11_args + ['-DDISABLE_COMMENTATOR'] + givaro_extra_compile_args), + include_dirs = cblas_include_dirs), Extension('sage.matrix.matrix_modn_dense_double', @@ -132,13 +132,13 @@ index a49ed36..7798cb8 100644 + libraries = linbox_libs + cblas_libs, library_dirs = cblas_library_dirs, include_dirs = cblas_include_dirs, -- extra_compile_args = ["-D_XPG6", "-DDISABLE_COMMENTATOR"] +- extra_compile_args = nocxx11_args + ["-D_XPG6", "-DDISABLE_COMMENTATOR"] - + m4ri_extra_compile_args + givaro_extra_compile_args), + extra_compile_args = ["-D_XPG6"]), Extension('sage.matrix.matrix_modn_sparse', sources = ['sage/matrix/matrix_modn_sparse.pyx']), -@@ -1374,8 +1387,7 @@ ext_modules = [ +@@ -1400,8 +1413,7 @@ ext_modules = [ Extension('sage.rings.finite_rings.element_givaro', sources = ["sage/rings/finite_rings/element_givaro.pyx"], libraries = ['givaro', 'ntl', 'gmpxx', 'gmp', 'm'], @@ -148,7 +148,7 @@ index a49ed36..7798cb8 100644 Extension('sage.rings.finite_rings.element_ntl_gf2e', sources = ['sage/rings/finite_rings/element_ntl_gf2e.pyx'], -@@ -1395,8 +1407,7 @@ ext_modules = [ +@@ -1421,8 +1433,7 @@ ext_modules = [ sources = ["sage/rings/finite_rings/hom_finite_field_givaro.pyx"], # this order is needed to compile under windows. libraries = ['givaro', 'ntl', 'gmpxx', 'gmp', 'm'], @@ -158,7 +158,7 @@ index a49ed36..7798cb8 100644 ################################ ## -@@ -1548,8 +1559,7 @@ ext_modules = [ +@@ -1574,8 +1585,7 @@ ext_modules = [ Extension('sage.rings.polynomial.plural', sources = ['sage/rings/polynomial/plural.pyx'], libraries = ['m', 'readline', 'singular', 'givaro', 'gmpxx', 'gmp'], @@ -214,7 +214,7 @@ index e102004..01ab1b1 100644 +# distutils: libraries = FFLASFFPACK_LIBRARIES +# distutils: library_dirs = FFLASFFPACK_LIBDIR + - from modular cimport ModDoubleField, ModFloatField, ModDoubleFieldElement, ModFloatFieldElement + from .modular cimport ModDoubleField, ModFloatField, ModDoubleFieldElement, ModFloatFieldElement cdef extern from "fflas-ffpack/fflas-ffpack.h" namespace "std": diff --git a/src/sage/libs/linbox/linbox.pyx b/src/sage/libs/linbox/linbox.pyx @@ -264,7 +264,7 @@ diff --git a/src/sage/libs/singular/singular.pyx b/src/sage/libs/singular/singul index 33d7f7ec..77f6e0a 100644 --- a/src/sage/libs/singular/singular.pyx +++ b/src/sage/libs/singular/singular.pyx -@@ -22,6 +22,7 @@ cdef extern from "limits.h": +@@ -23,6 +23,7 @@ cdef extern from "limits.h": import os @@ -272,7 +272,7 @@ index 33d7f7ec..77f6e0a 100644 from sage.libs.singular.decl cimport intvec from sage.libs.singular.decl cimport SR_HDL, SR_INT, SR_TO_INT from sage.libs.singular.decl cimport singular_options, singular_verbose_options -@@ -155,7 +156,7 @@ cdef FFgivE si2sa_GFqGivaro(number *n, ring *_ring, Cache_givaro cache): +@@ -156,7 +157,7 @@ cdef FFgivE si2sa_GFqGivaro(number *n, ring *_ring, Cache_givaro cache): order = cache.objectptr.cardinality() - 1 while z: @@ -365,7 +365,7 @@ diff --git a/src/sage/rings/finite_rings/element_givaro.pyx b/src/sage/rings/fin index d32b5cf..f2afa44 100644 --- a/src/sage/rings/finite_rings/element_givaro.pyx +++ b/src/sage/rings/finite_rings/element_givaro.pyx -@@ -58,8 +58,9 @@ from sage.misc.randstate cimport randstate, current_randstate +@@ -59,8 +59,9 @@ from sage.misc.randstate cimport randstate, current_randstate from sage.rings.finite_rings.finite_field_base cimport FiniteField from sage.rings.ring cimport Ring from element_ext_pari import FiniteField_ext_pariElement @@ -376,7 +376,7 @@ index d32b5cf..f2afa44 100644 import operator import sage.arith.all import finite_field_constructor as finite_field -@@ -373,18 +374,16 @@ cdef class Cache_givaro(SageObject): +@@ -374,18 +375,16 @@ cdef class Cache_givaro(SageObject): elif isinstance(e, int) or \ isinstance(e, Integer) or \ isinstance(e, long) or is_IntegerMod(e): @@ -399,8 +399,8 @@ index d32b5cf..f2afa44 100644 elif isinstance(e, str): return self.parent(eval(e.replace("^","**"),self.parent.gens_dict())) -@@ -394,8 +393,8 @@ cdef class Cache_givaro(SageObject): - raise TypeError, "e.parent must match self.vector_space" +@@ -395,8 +394,8 @@ cdef class Cache_givaro(SageObject): + raise TypeError("e.parent must match self.vector_space") ret = self._zero_element for i in range(len(e)): - e_entry = e[i] % self.characteristic() @@ -410,8 +410,8 @@ index d32b5cf..f2afa44 100644 to_add = make_FiniteField_givaroElement(self, res) ret = ret + to_add*self.parent.gen()**i return ret -@@ -434,8 +433,8 @@ cdef class Cache_givaro(SageObject): - raise ValueError, "list is too long" +@@ -435,8 +434,8 @@ cdef class Cache_givaro(SageObject): + raise ValueError("list is too long") ret = self._zero_element for i in range(len(e)): - e_entry = e[i] % self.characteristic() @@ -421,7 +421,7 @@ index d32b5cf..f2afa44 100644 to_add = make_FiniteField_givaroElement(self, res) ret = ret + to_add*self.parent.gen()**i return ret -@@ -572,19 +571,17 @@ cdef class Cache_givaro(SageObject): +@@ -573,19 +572,17 @@ cdef class Cache_givaro(SageObject): cdef int ret = k.zero cdef int a = k.indeterminate() cdef int at = k.one @@ -431,7 +431,7 @@ index d32b5cf..f2afa44 100644 + cdef int t, i if n<0 or n>k.cardinality(): - raise TypeError, "n must be between 0 and self.order()" + raise TypeError("n must be between 0 and self.order()") - _n = n - @@ -449,7 +449,7 @@ diff --git a/src/sage/rings/finite_rings/finite_field_givaro.py b/src/sage/rings index adbaab3..c431f6d 100644 --- a/src/sage/rings/finite_rings/finite_field_givaro.py +++ b/src/sage/rings/finite_rings/finite_field_givaro.py -@@ -269,7 +269,8 @@ class FiniteField_givaro(FiniteField): +@@ -270,7 +270,8 @@ class FiniteField_givaro(FiniteField): sage: k(2) # indirect doctest 0 @@ -459,7 +459,7 @@ index adbaab3..c431f6d 100644 sage: k(float(2.0)) 0 -@@ -343,7 +344,7 @@ class FiniteField_givaro(FiniteField): +@@ -344,7 +345,7 @@ class FiniteField_givaro(FiniteField): sage: k(pari('Mod(1,2)')) 1 sage: k(pari('Mod(2,3)')) diff --git a/libre/sagemath/paths.patch b/libre/sagemath/paths.patch index c8afe39bb..79b37408c 100644 --- a/libre/sagemath/paths.patch +++ b/libre/sagemath/paths.patch @@ -1,39 +1,13 @@ --- src/sage/env.py.orig 2014-06-25 10:47:25.827203554 +1200 +++ src/sage/env.py 2014-06-25 10:49:07.667402821 +1200 -@@ -87,25 +87,22 @@ - _add_variable_or_fallback('LOCAL_IDENTIFIER','$HOSTNAME.%s'%os.getpid()) +@@ -90,8 +90,8 @@ # bunch of sage directories and files --_add_variable_or_fallback('SAGE_ROOT', None) + _add_variable_or_fallback('SAGE_ROOT', None) -_add_variable_or_fallback('SAGE_LOCAL', opj('$SAGE_ROOT', 'local')) -_add_variable_or_fallback('SAGE_ETC', opj('$SAGE_LOCAL', 'etc')) --_add_variable_or_fallback('SAGE_INC', opj('$SAGE_LOCAL', 'include')) --_add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share')) -+_add_variable_or_fallback('SAGE_ROOT', '/usr') +_add_variable_or_fallback('SAGE_LOCAL', '/usr') +_add_variable_or_fallback('SAGE_ETC', '/etc/sage') -+_add_variable_or_fallback('SAGE_INC', opj('$SAGE_LOCAL', 'include')) -+_add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share', 'sage')) + _add_variable_or_fallback('SAGE_INC', opj('$SAGE_LOCAL', 'include')) + _add_variable_or_fallback('SAGE_SHARE', opj('$SAGE_LOCAL', 'share')) - _add_variable_or_fallback('SAGE_SRC', opj('$SAGE_ROOT', 'src')) --_add_variable_or_fallback('SITE_PACKAGES', site.getsitepackages()) -+_add_variable_or_fallback('SITE_PACKAGES', site.getsitepackages()+['/usr/lib/sage/site-packages']) - _add_variable_or_fallback('SAGE_LIB', SITE_PACKAGES[0]) - - _add_variable_or_fallback('SAGE_CYTHONIZED', opj('$SAGE_SRC', 'build', 'cythonized')) - --_add_variable_or_fallback('SAGE_EXTCODE', opj('$SAGE_SHARE', 'sage', 'ext')) --_add_variable_or_fallback('SAGE_LOGS', opj('$SAGE_ROOT', 'logs', 'pkgs')) --_add_variable_or_fallback('SAGE_SPKG_INST', opj('$SAGE_LOCAL', 'var', 'lib', 'sage', 'installed')) --_add_variable_or_fallback('SAGE_DOC_SRC', opj('$SAGE_SRC', 'doc')) --_add_variable_or_fallback('SAGE_DOC', opj('$SAGE_SHARE', 'doc', 'sage')) --_add_variable_or_fallback('DOT_SAGE', opj(os.environ.get('HOME','$SAGE_ROOT'), '.sage')) --_add_variable_or_fallback('SAGE_DOT_GIT', opj('$SAGE_ROOT', '.git')) -+_add_variable_or_fallback('SAGE_EXTCODE', opj('$SAGE_SHARE', 'ext')) -+_add_variable_or_fallback('SAGE_DOC_SRC', opj('$SAGE_SRC', 'doc')) -+_add_variable_or_fallback('SAGE_DOC', opj('/usr/share', 'doc', 'sage')) -+_add_variable_or_fallback('DOT_SAGE', opj(os.environ.get('HOME'), '.sage')) - _add_variable_or_fallback('SAGE_DISTFILES', opj('$SAGE_ROOT', 'upstream')) - - # misc - diff --git a/libre/sagemath/sagemath-ipython5.patch b/libre/sagemath/sagemath-ipython5.patch index 6d8557175..0f05de4d8 100644 --- a/libre/sagemath/sagemath-ipython5.patch +++ b/libre/sagemath/sagemath-ipython5.patch @@ -1,56 +1,446 @@ +diff --git a/src/sage/doctest/forker.py b/src/sage/doctest/forker.py +index 2654016..d3daed6 100644 +--- a/src/sage/doctest/forker.py ++++ b/src/sage/doctest/forker.py +@@ -116,10 +116,6 @@ def init_sage(): + from sage.structure.debug_options import debug + debug.refine_category_hash_check = True + +- # Disable IPython colors during doctests +- from sage.repl.interpreter import DEFAULT_SAGE_CONFIG +- DEFAULT_SAGE_CONFIG.TerminalInteractiveShell.colors = 'NoColor' +- + # We import readline before forking, otherwise Pdb doesn't work + # os OS X: http://trac.sagemath.org/14289 + import readline +@@ -1088,15 +1084,13 @@ class SageDocTestRunner(doctest.DocTestRunner): + sage: _ = sage0.eval("import doctest, sys, os, multiprocessing, subprocess") + sage: _ = sage0.eval("from sage.doctest.parsing import SageOutputChecker") + sage: _ = sage0.eval("import sage.doctest.forker as sdf") +- sage: _ = sage0.eval("sdf.init_sage()") + sage: _ = sage0.eval("from sage.doctest.control import DocTestDefaults") + sage: _ = sage0.eval("DD = DocTestDefaults(debug=True)") + sage: _ = sage0.eval("ex1 = doctest.Example('a = 17', '')") + sage: _ = sage0.eval("ex2 = doctest.Example('2*a', '1')") + sage: _ = sage0.eval("DT = doctest.DocTest([ex1,ex2], globals(), 'doubling', None, 0, None)") + sage: _ = sage0.eval("DTR = sdf.SageDocTestRunner(SageOutputChecker(), verbose=False, sage_options=DD, optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)") +- sage: sage0._prompt = r"debug: " +- sage: print(sage0.eval("DTR.run(DT, clear_globs=False)")) # indirect doctest ++ sage: print(sage0.eval("sdf.init_sage(); DTR.run(DT, clear_globs=False)")) # indirect doctest + ********************************************************************** + Line 1, in doubling + Failed example: +@@ -1110,7 +1104,6 @@ class SageDocTestRunner(doctest.DocTestRunner): + ... + sage: sage0.eval("a") + '...17' +- sage: sage0._prompt = "sage: " + sage: sage0.eval("quit") + 'Returning to doctests...TestResults(failed=1, attempted=2)' + """ +@@ -1144,13 +1137,14 @@ class SageDocTestRunner(doctest.DocTestRunner): + print(src) + if ex.want: + print(doctest._indent(ex.want[:-1])) +- from sage.repl.interpreter import DEFAULT_SAGE_CONFIG ++ from sage.repl.configuration import sage_ipython_config ++ from sage.repl.prompts import DebugPrompts + from IPython.terminal.embed import InteractiveShellEmbed +- import copy +- cfg = copy.deepcopy(DEFAULT_SAGE_CONFIG) +- prompt_config = cfg.PromptManager +- prompt_config.in_template = 'debug: ' +- prompt_config.in2_template = '.....: ' ++ cfg = sage_ipython_config.default() ++ # Currently this doesn't work: prompts only work in pty ++ # We keep simple_prompt=True, prompts will be "In [0]:" ++ # cfg.InteractiveShell.prompts_class = DebugPrompts ++ # cfg.InteractiveShell.simple_prompt = False + shell = InteractiveShellEmbed(config=cfg, banner1='', user_ns=dict(globs)) + shell(header='', stack_depth=2) + except KeyboardInterrupt: +@@ -1248,6 +1242,7 @@ class SageDocTestRunner(doctest.DocTestRunner): + sage: _ = sage0.eval("ex = doctest.Example('E = EllipticCurve([0,0]); E', 'A singular Elliptic Curve')") + sage: _ = sage0.eval("DT = doctest.DocTest([ex], globals(), 'singular_curve', None, 0, None)") + sage: _ = sage0.eval("DTR = sdf.SageDocTestRunner(SageOutputChecker(), verbose=False, sage_options=DD, optionflags=doctest.NORMALIZE_WHITESPACE|doctest.ELLIPSIS)") ++ sage: old_prompt = sage0._prompt + sage: sage0._prompt = r"\(Pdb\) " + sage: sage0.eval("DTR.run(DT, clear_globs=False)") # indirect doctest + '... ArithmeticError("invariants " + str(ainvs) + " define a singular curve")' +@@ -1257,7 +1252,7 @@ class SageDocTestRunner(doctest.DocTestRunner): + '...EllipticCurve_field.__init__(self, K, ainvs)' + sage: sage0.eval("p ainvs") + '(0, 0, 0, 0, 0)' +- sage: sage0._prompt = "sage: " ++ sage: sage0._prompt = old_prompt + sage: sage0.eval("quit") + 'TestResults(failed=1, attempted=1)' + """ +diff --git a/src/sage/doctest/test.py b/src/sage/doctest/test.py +index d69136f..a6cc4d0 100644 +--- a/src/sage/doctest/test.py ++++ b/src/sage/doctest/test.py +@@ -360,7 +360,7 @@ Test the ``--debug`` option:: + s...: b = 5 + s...: a + b + 8 +- debug: ++ In [1]: + + Returning to doctests... + ********************************************************************** +diff --git a/src/sage/interfaces/sage0.py b/src/sage/interfaces/sage0.py +index 87bfc0b..77cd151 100644 +--- a/src/sage/interfaces/sage0.py ++++ b/src/sage/interfaces/sage0.py +@@ -18,6 +18,7 @@ from __future__ import absolute_import + + import cPickle + import os ++import re + + from .expect import Expect, ExpectElement, FunctionElement + import sage.repl.preparse +@@ -146,10 +147,17 @@ class Sage(ExtraTabCompletion, Expect): + if init_code is None: + init_code = ['from sage.all import *', 'import cPickle'] + else: +- # Disable the IPython history (implemented as SQLite database) +- # to avoid problems with locking. +- command = "sage-ipython --HistoryManager.hist_file=:memory: --colors=NoColor" +- prompt = "sage: " ++ command = ' '.join([ ++ 'sage-ipython', ++ # Disable the IPython history (implemented as SQLite database) ++ # to avoid problems with locking. ++ '--HistoryManager.hist_file=:memory:', ++ # Disable everything that prints ANSI codes ++ '--colors=NoColor', ++ '--no-term-title', ++ '--simple-prompt', ++ ]) ++ prompt = re.compile('In \[\d+\]: ') + if init_code is None: + init_code = ['import cPickle'] + +diff --git a/src/sage/misc/trace.py b/src/sage/misc/trace.py +index 0da17e7..efcaa33 100644 +--- a/src/sage/misc/trace.py ++++ b/src/sage/misc/trace.py +@@ -54,6 +54,7 @@ def trace(code, preparse=True): + sage: import pexpect + sage: s = pexpect.spawn('sage') + sage: _ = s.sendline("trace('print(factor(10))'); print(3+97)") ++ sage: _ = s.expect('ipdb>', timeout=90) + sage: _ = s.sendline("s"); _ = s.sendline("c"); + sage: _ = s.expect('100', timeout=90) + +diff --git a/src/sage/repl/configuration.py b/src/sage/repl/configuration.py +new file mode 100644 +index 0000000..5034039 +--- /dev/null ++++ b/src/sage/repl/configuration.py +@@ -0,0 +1,152 @@ ++r""" ++Sage's IPython Configuration ++""" ++ ++#***************************************************************************** ++# Copyright (C) 2016 Volker Braun ++# ++# Distributed under the terms of the GNU General Public License (GPL) ++# as published by the Free Software Foundation; either version 2 of ++# the License, or (at your option) any later version. ++# http://www.gnu.org/licenses/ ++#***************************************************************************** ++ ++from __future__ import absolute_import ++ ++import sys ++import copy ++from traitlets.config.loader import Config ++ ++from sage.repl.prompts import SagePrompts ++ ++ ++# Name of the Sage IPython extension ++SAGE_EXTENSION = 'sage' ++ ++ ++class SageIpythonConfiguration(object): ++ ++ def _doctest_mode(self): ++ """ ++ Whether we are in doctest mode ++ ++ This returns ``True`` during doctests. ++ ++ EXAMPLES:: ++ ++ sage: from sage.repl.configuration import sage_ipython_config ++ sage: sage_ipython_config._doctest_mode() ++ True ++ """ ++ from sage.doctest import DOCTEST_MODE ++ return DOCTEST_MODE ++ ++ def _allow_ansi(self): ++ """ ++ Whether to allow ANSI escape sequences ++ ++ This returns ``False`` during doctests to avoid ANSI escape ++ sequences. ++ ++ EXAMPLES:: ++ ++ sage: from sage.repl.configuration import sage_ipython_config ++ sage: sage_ipython_config._allow_ansi() ++ False ++ """ ++ return (not self._doctest_mode()) and sys.stdout.isatty() ++ ++ def colors(self): ++ """ ++ Return the IPython color palette ++ ++ This returns ``'NoColor'`` during doctests to avoid ANSI escape ++ sequences. ++ ++ EXAMPLES:: ++ ++ sage: from sage.repl.configuration import sage_ipython_config ++ sage: sage_ipython_config.simple_prompt() ++ True ++ """ ++ return 'LightBG' if self._allow_ansi() else 'NoColor' ++ ++ def simple_prompt(self): ++ """ ++ Return whether to use the simple prompt ++ ++ This returns ``True`` during doctests to avoid ANSI escape sequences. ++ ++ EXAMPLES:: ++ ++ sage: from sage.repl.configuration import sage_ipython_config ++ sage: sage_ipython_config.simple_prompt() ++ True ++ """ ++ return not self._allow_ansi() ++ ++ def term_title(self): ++ """ ++ Return whether to set the terminal title ++ ++ This returns false during doctests to avoid ANSI escape sequences. ++ ++ EXAMPLES:: ++ ++ sage: from sage.repl.configuration import sage_ipython_config ++ sage: sage_ipython_config.term_title() ++ False ++ """ ++ return self._allow_ansi() ++ ++ def default(self): ++ """ ++ Return a new default configuration object ++ ++ EXAMPLES:: ++ ++ sage: from sage.repl.configuration import sage_ipython_config ++ sage: sage_ipython_config.default() ++ {'InteractiveShell': {'colors': ... ++ """ ++ from sage.repl.interpreter import SageTerminalInteractiveShell ++ cfg = Config( ++ TerminalIPythonApp=Config( ++ display_banner=False, ++ verbose_crash=True, ++ test_shell=False, ++ shell_class=SageTerminalInteractiveShell, ++ ), ++ InteractiveShell=Config( ++ prompts_class=SagePrompts, ++ ast_node_interactivity='all', ++ colors=self.colors(), ++ simple_prompt=self.simple_prompt(), ++ term_title=self.term_title(), ++ confirm_exit=False, ++ separate_in='' ++ ), ++ InteractiveShellApp=Config(extensions=[SAGE_EXTENSION]), ++ ) ++ if self._doctest_mode(): ++ # Using the file-backed history causes problems in parallel tests ++ cfg.HistoryManager = Config(hist_file=':memory:') ++ return cfg ++ ++ def copy(self): ++ """ ++ Return a copy of the current configuration ++ ++ EXAMPLES:: ++ ++ sage: from sage.repl.configuration import sage_ipython_config ++ sage: sage_ipython_config.copy() ++ {'InteractiveShell': {'colors': ... ++ """ ++ try: ++ return copy.deepcopy(get_ipython().config) ++ except NameError: ++ return self.default() ++ ++ ++sage_ipython_config = SageIpythonConfiguration() diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py -index ef8724d..6896985 100644 +index e0499c7..1f4eda7 100644 --- a/src/sage/repl/interpreter.py +++ b/src/sage/repl/interpreter.py -@@ -103,6 +103,7 @@ import os +@@ -102,18 +102,15 @@ Check that Cython source code appears in tracebacks:: + #***************************************************************************** + + +-import copy + import os import re - import sys +-import sys from sage.repl.preparse import preparse +from sage.repl.prompts import SagePrompts, InterfacePrompts - from traitlets.config.loader import Config +-from traitlets.config.loader import Config from traitlets import Bool, Type -@@ -371,11 +372,6 @@ class SageTestShell(SageShellOverride, TerminalInteractiveShell): - ################################################################### - DEFAULT_SAGE_CONFIG = Config( + from sage.env import SAGE_LOCAL +- +-SAGE_EXTENSION = 'sage' ++from sage.repl.configuration import sage_ipython_config, SAGE_EXTENSION + + def embedded(): + """ +@@ -370,31 +367,7 @@ class SageTestShell(SageShellOverride, TerminalInteractiveShell): + rc = super(SageTestShell, self).run_cell(*args, **kwds) + + +-################################################################### +-# Default configuration +-################################################################### +- +-DEFAULT_SAGE_CONFIG = Config( - PromptManager = Config( - in_template = 'sage: ', - in2_template = '....: ', - justify = False, - out_template = ''), - TerminalIPythonApp = Config( - display_banner = False, - verbose_crash = True, -@@ -383,6 +379,7 @@ DEFAULT_SAGE_CONFIG = Config( - shell_class = SageTerminalInteractiveShell, - ), - InteractiveShell = Config( -+ prompts_class = SagePrompts, - ast_node_interactivity = 'all', - colors = 'LightBG' if sys.stdout.isatty() else 'NoColor', - confirm_exit = False, -@@ -616,13 +613,11 @@ def interface_shell_embed(interface): - cfg = copy.deepcopy(get_ipython().config) - except NameError: - cfg = copy.deepcopy(DEFAULT_SAGE_CONFIG) +- TerminalIPythonApp = Config( +- display_banner = False, +- verbose_crash = True, +- test_shell = False, +- shell_class = SageTerminalInteractiveShell, +- ), +- InteractiveShell = Config( +- ast_node_interactivity = 'all', +- colors = 'LightBG' if sys.stdout.isatty() else 'NoColor', +- confirm_exit = False, +- separate_in = ''), +- InteractiveShellApp = Config(extensions=[SAGE_EXTENSION]), +-) +- +- ++ + ################################################################### + # Transformers used in the SageInputSplitter + ################################################################### +@@ -614,19 +587,17 @@ def interface_shell_embed(interface): + sage: shell = interface_shell_embed(gap) + sage: shell.run_cell('List( [1..10], IsPrime )') + [ false, true, true, false, true, false, true, false, false, false ] +- +- """ +- try: +- cfg = copy.deepcopy(get_ipython().config) +- except NameError: +- cfg = copy.deepcopy(DEFAULT_SAGE_CONFIG) - cfg.PromptManager['in_template'] = interface.name() + ': ' - cfg.PromptManager['in2_template'] = len(interface.name())*'.' + ': ' -- ++ ) failed: ++ AttributeError: type object 'ExecutionResult' has no attribute '__qualname__'> + ++ Note that the repr error is https://github.com/ipython/ipython/issues/9756 ++ """ ++ cfg = sage_ipython_config.copy() ipshell = InteractiveShellEmbed(config=cfg, banner1='\n --> Switching to %s <--\n\n'%interface, - exit_msg = '\n --> Exiting back to Sage <--\n') +- exit_msg = '\n --> Exiting back to Sage <--\n') ++ exit_msg='\n --> Exiting back to Sage <--\n') ipshell.interface = interface + ipshell.prompts = InterfacePrompts(interface.name()) while ipshell.prefilter_manager.transformers: ipshell.prefilter_manager.transformers.pop() +@@ -669,7 +640,7 @@ def get_test_shell(): + sage: out + err + '' + """ +- config = copy.deepcopy(DEFAULT_SAGE_CONFIG) ++ config = sage_ipython_config.default() + config.TerminalIPythonApp.test_shell = True + config.TerminalIPythonApp.shell_class = SageTestShell + app = SageTerminalApp.instance(config=config) +@@ -748,12 +719,9 @@ class SageTerminalApp(TerminalIPythonApp): + sage: os.environ['IPYTHONDIR'] = IPYTHONDIR + """ + super(SageTerminalApp, self).load_config_file(*args, **kwds) +- +- newconfig = copy.deepcopy(DEFAULT_SAGE_CONFIG) +- ++ newconfig = sage_ipython_config.default() + # merge in the config loaded from file + newconfig.merge(self.config) +- + self.config = newconfig + + def init_shell(self): +@@ -767,7 +735,7 @@ class SageTerminalApp(TerminalIPythonApp): + + EXAMPLES:: + +- sage: from sage.repl.interpreter import SageTerminalApp, DEFAULT_SAGE_CONFIG ++ sage: from sage.repl.interpreter import SageTerminalApp + sage: app = SageTerminalApp.instance() + sage: app.shell + +@@ -776,7 +744,6 @@ class SageTerminalApp(TerminalIPythonApp): + self.shell = self.shell_class.instance( + parent=self, + config=self.config, +- display_banner=False, + profile_dir=self.profile_dir, + ipython_dir=self.ipython_dir) + self.shell.configurables.append(self) +diff --git a/src/sage/repl/ipython_tests.py b/src/sage/repl/ipython_tests.py +index 0fa568d..2bb34cd 100644 +--- a/src/sage/repl/ipython_tests.py ++++ b/src/sage/repl/ipython_tests.py +@@ -100,6 +100,12 @@ Next, test the pinfo2 magic for Cython code:: + ... + File: .../sage/tests/stl_vector.pyx + Type: type ++ ++Test that there are no warnings being ignored internally:: ++ ++ sage: import warnings ++ sage: warnings.simplefilter('error'); get_test_shell() ++ + ''' + + diff --git a/src/sage/repl/prompts.py b/src/sage/repl/prompts.py new file mode 100644 -index 0000000..69f8cdd +index 0000000..e885730 --- /dev/null +++ b/src/sage/repl/prompts.py -@@ -0,0 +1,67 @@ +@@ -0,0 +1,92 @@ +r""" +Sage Commandline Prompts +""" @@ -118,3 +508,41 @@ index 0000000..69f8cdd + (Token.OutPrompt, ''), + ] + ++ ++class DebugPrompts(Prompts): ++ ++ def in_prompt_tokens(self, cli=None): ++ return [ ++ (Token.Prompt, 'debug: '), ++ ] ++ ++ def continuation_prompt_tokens(self, cli=None, width=None): ++ return [ ++ (Token.Prompt, '.....: '), ++ ] ++ ++ def rewrite_prompt_tokens(self): ++ return [ ++ (Token.Prompt, '-----> '), ++ ] ++ ++ def out_prompt_tokens(self): ++ return [ ++ (Token.OutPrompt, ''), ++ ] ++ ++ ++ +diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py +index 0d15d82..417ec5e 100644 +--- a/src/sage/tests/cmdline.py ++++ b/src/sage/tests/cmdline.py +@@ -385,7 +385,7 @@ def test_executable(args, input="", timeout=100.0, **kwds): + ********************************************************************** + Previously executed commands: + s...: assert True == False +- debug: ++ In [1]: + + Returning to doctests... + ********************************************************************** diff --git a/libre/sagemath/skip-check.patch b/libre/sagemath/skip-check.patch index dae5f7277..48cac24b7 100644 --- a/libre/sagemath/skip-check.patch +++ b/libre/sagemath/skip-check.patch @@ -1,6 +1,6 @@ --- src/bin/sage.orig 2014-12-18 09:47:27.354829070 +0100 +++ src/bin/sage 2014-12-18 09:48:00.041563401 +0100 -@@ -286,18 +286,6 @@ +@@ -352,18 +352,6 @@ # Prepare for running Sage, either interactively or non-interactively. sage_setup() { @@ -16,6 +16,7 @@ - exit 1 - fi - - # Display the startup banner + # Display the startup banner (unless SAGE_BANNER is explictly "no") if [ "$SAGE_BANNER" != "no" ]; then - cat "$SAGE_LOCAL/bin/sage-banner" + # can be 'bare', or 'yes', or unspecified + -- cgit v1.2.3