diff --git a/sagemath-4ti2.patch b/sagemath-4ti2.patch index 7ed50a2..1d07f24 100644 --- a/sagemath-4ti2.patch +++ b/sagemath-4ti2.patch @@ -1,17 +1,17 @@ diff -up src/sage/sandpiles/sandpile.py.orig src/sage/sandpiles/sandpile.py ---- src/sage/sandpiles/sandpile.py.orig 2018-08-03 05:10:09.000000000 -0600 -+++ src/sage/sandpiles/sandpile.py 2018-08-29 08:47:29.728055776 -0600 -@@ -342,9 +342,6 @@ from sage.arith.all import falling_facto +--- src/sage/sandpiles/sandpile.py.orig 2018-10-17 17:14:17.000000000 -0600 ++++ src/sage/sandpiles/sandpile.py 2018-10-25 13:18:34.198894883 -0600 +@@ -344,9 +344,6 @@ from sage.arith.all import falling_facto from sage.rings.all import Integer, PolynomialRing, QQ, ZZ - from sage.symbolic.all import I, pi + from sage.symbolic.all import I, pi, SR -# TODO: remove the following line once 4ti2 functions are removed --path_to_zsolve = os.path.join(SAGE_LOCAL,'bin','zsolve') +-path_to_zsolve = os.path.join(SAGE_LOCAL, 'bin', 'zsolve') - - class Sandpile(DiGraph): - """ - Class for Dhar's abelian sandpile model. -@@ -5197,7 +5194,7 @@ class SandpileDivisor(dict): + + + def _sandpile_help(cls, usage, verbose=True): +@@ -5150,7 +5147,7 @@ class SandpileDivisor(dict): sign_file.close() # compute try: diff --git a/sagemath-buildroot.patch b/sagemath-buildroot.patch new file mode 100644 index 0000000..e4d28eb --- /dev/null +++ b/sagemath-buildroot.patch @@ -0,0 +1,12 @@ +--- src/setup.py.orig 2018-10-16 09:07:30.086993782 -0600 ++++ src/setup.py 2018-10-16 09:10:20.586710425 -0600 +@@ -387,6 +387,9 @@ class sage_build_cython(Command): + with open(self._version_file, 'w') as f: + f.write(self._version_stamp) + ++ # Remove buildroot paths from the generated files ++ subprocess.run(["find", "build/cythonized/sage", "-type", "f", "-exec", "sed", "-i", "s|@@BUILDROOT@@||g", "{}", "+"], check=True) ++ + # Finally, copy relevant cythonized files from build/cythonized + # tree into the build-lib tree + for (dst_dir, src_files) in self.get_cythonized_package_files(): diff --git a/sagemath-cremona.patch b/sagemath-cremona.patch index 053d412..723f035 100644 --- a/sagemath-cremona.patch +++ b/sagemath-cremona.patch @@ -1,12 +1,12 @@ diff -up src/sage/databases/cremona.py.orig src/sage/databases/cremona.py ---- src/sage/databases/cremona.py.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/databases/cremona.py 2018-08-29 08:48:43.090148635 -0600 +--- src/sage/databases/cremona.py.orig 2018-10-17 17:13:36.000000000 -0600 ++++ src/sage/databases/cremona.py 2018-10-25 13:24:02.644939224 -0600 @@ -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 sage.misc.package import is_package_installed - from sage.env import SAGE_SHARE + from sage.env import CREMONA_MINI_DATA_DIR, CREMONA_LARGE_DATA_DIR from sage.misc.all import walltime @@ -825,14 +824,6 @@ class MiniCremonaDatabase(SQLDatabase): diff --git a/sagemath-eclib.patch b/sagemath-eclib.patch deleted file mode 100644 index f0dca1e..0000000 --- a/sagemath-eclib.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- src/sage/libs/eclib/wrap.cpp.orig 2018-05-05 16:21:24.000000000 -0600 -+++ src/sage/libs/eclib/wrap.cpp 2018-08-09 21:57:02.055392569 -0600 -@@ -133,8 +133,8 @@ char* Curvedata_isogeny_class(struct Cur - - - int mw_process(struct Curvedata* curve, struct mw* m, -- const struct bigint* x, const struct bigint* y, -- const struct bigint* z, int sat) -+ const bigint* x, const bigint* y, -+ const bigint* z, int sat) - { - Point P(*curve, *x, *y, *z); - if (!P.isvalid()) -@@ -188,7 +188,7 @@ int mw_rank(struct mw* m) - } - - /* Returns index and unsat long array, which user must deallocate */ --int mw_saturate(struct mw* m, struct bigint* index, char** unsat, -+int mw_saturate(struct mw* m, bigint* index, char** unsat, - long sat_bd, int odd_primes_only) - { - vector v; diff --git a/sagemath-escape.patch b/sagemath-escape.patch new file mode 100644 index 0000000..9c3a8e1 --- /dev/null +++ b/sagemath-escape.patch @@ -0,0 +1,108 @@ +--- build/pkgs/sagenb/src/sagenb/misc/sphinxify.py.orig 2018-10-25 14:14:33.031253545 -0600 ++++ build/pkgs/sagenb/src/sagenb/misc/sphinxify.py 2018-10-25 15:33:56.358876835 -0600 +@@ -133,7 +133,7 @@ def sphinxify(docstring, format='html'): + # "/media/...path.../blah.png" + # to + # "/doc/static/reference/media/...path.../blah.png" +- output = re.sub("""src=['"](/?\.\.)*/?media/([^"']*)['"]""", ++ output = re.sub("""src=['"](/?\\.\\.)*/?media/([^"']*)['"]""", + 'src="/doc/static/reference/media/\\2"', + output) + # Remove spurious \(, \), \[, \]. +--- build/pkgs/sagenb/src/sagenb/misc/support.py.orig 2018-10-25 13:30:02.499892169 -0600 ++++ build/pkgs/sagenb/src/sagenb/misc/support.py 2018-10-25 14:14:33.032253542 -0600 +@@ -550,7 +550,7 @@ try: + return args[0].__getattribute__(str(self))(*args[1:], **kwds) + + def automatic_name_eval(s, globals, max_names=10000): +- """ ++ r""" + Exec the string ``s`` in the scope of the ``globals`` + dictionary, and if any :exc:`NameError`\ s are raised, try to + fix them by defining the variable that caused the error to be +--- build/pkgs/sagenb/src/sagenb/notebook/cell.py.orig 2018-10-25 13:30:55.707737342 -0600 ++++ build/pkgs/sagenb/src/sagenb/notebook/cell.py 2018-10-25 14:14:33.032253542 -0600 +@@ -441,7 +441,7 @@ class Cell_generic(object): + return isinstance(self, Cell) + + def is_auto_cell(self): +- """ ++ r""" + Returns whether this is an automatically evaluated generic + cell. This is always false for :class:`Cell_generic`\ s and + :class:`TextCell`\ s. +@@ -647,7 +647,7 @@ class TextCell(Cell_generic): + return self._text + + def set_cell_output_type(self, typ='wrap'): +- """ ++ r""" + Sets this text cell's output type. This does nothing for + :class:`TextCell`\ s. + +@@ -1320,8 +1320,8 @@ class Cell(Cell_generic): + if len(s) == 0: + return False + s = s[0] +- return bool(re.search('(? diff --git a/sagemath-jmol.patch b/sagemath-jmol.patch index b3f89ed..4a76bb1 100644 --- a/sagemath-jmol.patch +++ b/sagemath-jmol.patch @@ -1,12 +1,12 @@ diff -up src/sage/interfaces/jmoldata.py.orig src/sage/interfaces/jmoldata.py ---- src/sage/interfaces/jmoldata.py.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/interfaces/jmoldata.py 2018-08-29 08:47:39.203938604 -0600 +--- src/sage/interfaces/jmoldata.py.orig 2018-10-17 17:13:47.000000000 -0600 ++++ src/sage/interfaces/jmoldata.py 2018-10-25 13:22:07.965272901 -0600 @@ -148,8 +148,6 @@ class JmolData(SageObject): sage: print(os.path.exists(testfile)) # optional -- java True """ - # Set up paths, file names and scripts -- jmolpath = os.path.join(SAGE_LOCAL, "share", "jmol", "JmolData.jar") +- jmolpath = os.path.join(JMOL_DIR, "JmolData.jar") target_native = targetfile if sys.platform == 'cygwin': diff --git a/sagemath-libgap.patch b/sagemath-libgap.patch index 1ba2a10..1e7cbf0 100644 --- a/sagemath-libgap.patch +++ b/sagemath-libgap.patch @@ -1,30 +1,18 @@ diff -up src/sage/env.py.orig src/sage/env.py ---- src/sage/env.py.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/env.py 2018-08-29 11:25:26.833962117 -0600 +--- src/sage/env.py.orig 2018-10-17 17:13:36.000000000 -0600 ++++ src/sage/env.py 2018-10-25 14:10:21.564960823 -0600 @@ -164,7 +164,7 @@ _add_variable_or_fallback('CONWAY_POLYNO _add_variable_or_fallback('GRAPHS_DATA_DIR', opj('$SAGE_SHARE','graphs')) _add_variable_or_fallback('ELLCURVE_DATA_DIR',opj('$SAGE_SHARE','ellcurves')) _add_variable_or_fallback('POLYTOPE_DATA_DIR',opj('$SAGE_SHARE','reflexive_polytopes')) -_add_variable_or_fallback('GAP_ROOT_DIR', opj('$SAGE_LOCAL','gap','latest')) -+_add_variable_or_fallback('GAP_ROOT_DIR', opj('usr','lib','gap')) ++_add_variable_or_fallback('GAP_ROOT_DIR', opj('/usr','lib','gap')) _add_variable_or_fallback('THEBE_DIR', opj('$SAGE_SHARE','thebe')) - - # locate singular shared object -diff -up src/sage/interfaces/gap.py.orig src/sage/interfaces/gap.py ---- src/sage/interfaces/gap.py.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/interfaces/gap.py 2018-08-29 11:21:43.180584324 -0600 -@@ -197,7 +197,7 @@ import string - - WORKSPACE = gap_workspace_file() - --GAP_BINARY = os.path.join(SAGE_LOCAL, 'bin', 'gap') -+GAP_BINARY = os.path.join('usr', 'bin', 'gap') - - first_try = True - + _add_variable_or_fallback('COMBINATORIAL_DESIGN_DATA_DIR', opj('$SAGE_SHARE', 'combinatorial_designs')) + _add_variable_or_fallback('CREMONA_MINI_DATA_DIR', opj('$SAGE_SHARE', 'cremona')) diff -up src/sage/libs/gap/test/main.c.orig src/sage/libs/gap/test/main.c ---- src/sage/libs/gap/test/main.c.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/libs/gap/test/main.c 2018-08-29 10:38:22.512653256 -0600 +--- src/sage/libs/gap/test/main.c.orig 2018-10-17 17:13:52.000000000 -0600 ++++ src/sage/libs/gap/test/main.c 2018-10-25 14:05:51.458727612 -0600 @@ -22,7 +22,7 @@ void eval(char* cmd) { libgap_start_interaction(cmd); @@ -35,8 +23,8 @@ diff -up src/sage/libs/gap/test/main.c.orig src/sage/libs/gap/test/main.c char* out = libgap_get_output(); libgap_exit(); diff -up src/sage/libs/gap/util.pyx.orig src/sage/libs/gap/util.pyx ---- src/sage/libs/gap/util.pyx.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/libs/gap/util.pyx 2018-08-29 11:32:06.654205922 -0600 +--- src/sage/libs/gap/util.pyx.orig 2018-10-25 13:50:51.168295628 -0600 ++++ src/sage/libs/gap/util.pyx 2018-10-25 14:05:51.458727612 -0600 @@ -25,6 +25,8 @@ from sage.cpython.string cimport str_to_ from sage.interfaces.gap_workspace import prepare_workspace_dir from sage.env import SAGE_LOCAL, GAP_ROOT_DIR diff --git a/sagemath-maxima.patch b/sagemath-maxima.patch index 10b1857..b74db06 100644 --- a/sagemath-maxima.patch +++ b/sagemath-maxima.patch @@ -1,6 +1,6 @@ diff -up src/bin/sage-maxima.lisp.orig src/bin/sage-maxima.lisp ---- src/bin/sage-maxima.lisp.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/bin/sage-maxima.lisp 2018-08-29 08:45:21.302643791 -0600 +--- src/bin/sage-maxima.lisp.orig 2018-10-17 17:13:34.000000000 -0600 ++++ src/bin/sage-maxima.lisp 2018-10-25 13:14:53.465538639 -0600 @@ -4,3 +4,8 @@ (setf *prompt-prefix* "") @@ -11,12 +11,12 @@ diff -up src/bin/sage-maxima.lisp.orig src/bin/sage-maxima.lisp + *standard-input* (open "/dev/stdin" :direction :input) + *standard-output* (open "/dev/stdout" :direction :output)) diff -up src/sage/interfaces/maxima.py.orig src/sage/interfaces/maxima.py ---- src/sage/interfaces/maxima.py.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/interfaces/maxima.py 2018-08-29 08:47:09.779302448 -0600 +--- src/sage/interfaces/maxima.py.orig 2018-10-17 17:13:51.000000000 -0600 ++++ src/sage/interfaces/maxima.py 2018-10-25 13:16:00.326343444 -0600 @@ -546,7 +546,7 @@ class Maxima(MaximaAbstract, Expect): Expect.__init__(self, name = 'maxima', - prompt = '\(\%i[0-9]+\) ', + prompt = r'\(\%i[0-9]+\) ', - command = 'maxima -p "{0}"'.format(STARTUP), + command = 'maxima --disable-readline -p "{0}"'.format(STARTUP), env = {'TMPDIR': str(ECL_TMP)}, diff --git a/sagemath-mpfr.patch b/sagemath-mpfr.patch index e9002c4..4d59f01 100644 --- a/sagemath-mpfr.patch +++ b/sagemath-mpfr.patch @@ -12,7 +12,7 @@ diff -up src/sage/libs/mpfr/__init__.pxd.orig src/sage/libs/mpfr/__init__.pxd diff -up src/sage/rings/complex_mpc.pyx.orig src/sage/rings/complex_mpc.pyx --- src/sage/rings/complex_mpc.pyx.orig 2018-08-03 05:10:09.000000000 -0600 +++ src/sage/rings/complex_mpc.pyx 2018-08-29 10:41:34.027286042 -0600 -@@ -2221,7 +2221,7 @@ cdef class MPComplexNumber(sage.structur +@@ -2225,7 +2225,7 @@ cdef class MPComplexNumber(sage.structur cdef RealNumber a,r a = self.argument()/n r = self.abs() diff --git a/sagemath-nauty.patch b/sagemath-nauty.patch index 2bedc83..12a341b 100644 --- a/sagemath-nauty.patch +++ b/sagemath-nauty.patch @@ -1,7 +1,7 @@ diff -up src/sage/graphs/graph_generators.py.orig src/sage/graphs/graph_generators.py ---- src/sage/graphs/graph_generators.py.orig 2018-08-29 08:52:26.099392035 -0600 -+++ src/sage/graphs/graph_generators.py 2018-08-29 08:56:44.782205619 -0600 -@@ -906,7 +906,7 @@ class GraphGenerators(): +--- src/sage/graphs/graph_generators.py.orig 2018-10-17 17:13:47.000000000 -0600 ++++ src/sage/graphs/graph_generators.py 2018-10-25 14:04:50.496901422 -0600 +@@ -911,7 +911,7 @@ class GraphGenerators(): else: enc_kwargs = {'encoding': 'latin-1'} diff --git a/sagemath-nofstring.patch b/sagemath-nofstring.patch deleted file mode 100644 index 66c4a86..0000000 --- a/sagemath-nofstring.patch +++ /dev/null @@ -1,60 +0,0 @@ -diff -up src/sage/arith/multi_modular.pyx.orig src/sage/arith/multi_modular.pyx ---- src/sage/arith/multi_modular.pyx.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/arith/multi_modular.pyx 2018-08-29 10:44:04.624424587 -0600 -@@ -173,9 +173,9 @@ cdef class MultiModularBasis_base(object - ArithmeticError: The inverse of 6 modulo 10 is not defined. - """ - if l_bound < 2: -- raise ValueError(f"minimum value for lower bound is 2, given: {l_bound}") -+ raise ValueError("minimum value for lower bound is 2, given: {l_bound}".format(l_bound=l_bound)) - if u_bound > MAX_MODULUS: -- raise ValueError(f"upper bound cannot be greater than {MAX_MODULUS}, given: {u_bound}") -+ raise ValueError("upper bound cannot be greater than {MAX_MODULUS}, given: {u_bound}".format(MAX_MODULUS=MAX_MODULUS, u_bound=u_bound)) - - self._l_bound = l_bound - self._u_bound = u_bound -@@ -234,7 +234,7 @@ cdef class MultiModularBasis_base(object - if check: - for p in plist: - if p > MAX_MODULUS: -- raise OverflowError(f"given modulus {p} is larger than {MAX_MODULUS}") -+ raise OverflowError("given modulus {p} is larger than {MAX_MODULUS}".format(p=p, MAX_MODULUS=MAX_MODULUS)) - self._realloc_to_new_count(self.n + len_plist) - - cdef Py_ssize_t i -diff -up src/sage/rings/finite_rings/integer_mod.pyx.orig src/sage/rings/finite_rings/integer_mod.pyx ---- src/sage/rings/finite_rings/integer_mod.pyx.orig 2018-08-03 05:10:09.000000000 -0600 -+++ src/sage/rings/finite_rings/integer_mod.pyx 2018-08-29 10:44:04.624424587 -0600 -@@ -468,7 +468,7 @@ cdef class IntegerMod_abstract(FiniteRin - from .integer_mod_ring import IntegerModRing - R = IntegerModRing(modulus) - if (self)._parent._IntegerModRing_generic__order % R.order(): -- raise ArithmeticError(f"reduction modulo {modulus!r} not defined") -+ raise ArithmeticError("reduction modulo {modulus} not defined".format(modulus=repr(modulus))) - return R(self) - - def is_nilpotent(self): -diff -up src/sage/structure/parent.pyx.orig src/sage/structure/parent.pyx ---- src/sage/structure/parent.pyx.orig 2018-08-03 05:10:09.000000000 -0600 -+++ src/sage/structure/parent.pyx 2018-08-29 10:44:04.625424574 -0600 -@@ -726,7 +726,7 @@ cdef class Parent(sage.structure.categor - cdef int init_coerce(self, bint warn=True) except -1: - if self._coerce_from_hash is None: - if warn: -- raise AssertionError(f"unexpected call of init_coerce() for {type(self)}") -+ raise AssertionError("unexpected call of init_coerce() for {typ}".format(typ=type(self))) - self._initial_coerce_list = [] - self._initial_action_list = [] - self._initial_convert_list = [] -diff -up src/sage/symbolic/ring.pyx.orig src/sage/symbolic/ring.pyx ---- src/sage/symbolic/ring.pyx.orig 2018-08-03 05:10:09.000000000 -0600 -+++ src/sage/symbolic/ring.pyx 2018-08-29 10:44:04.625424574 -0600 -@@ -378,7 +378,7 @@ cdef class SymbolicRing(CommutativeRing) - from sage.misc.all import prod - return prod([SR(p)**e for p,e in x], SR(x.unit())) - else: -- raise TypeError(f"unable to convert {x!r} to a symbolic expression") -+ raise TypeError("unable to convert {x} to a symbolic expression".format(x=repr(x))) - - return new_Expression_from_GEx(self, exp) - diff --git a/sagemath-atlas.patch b/sagemath-openblas.patch similarity index 94% rename from sagemath-atlas.patch rename to sagemath-openblas.patch index 211dba2..5d625e8 100644 --- a/sagemath-atlas.patch +++ b/sagemath-openblas.patch @@ -6,7 +6,7 @@ diff -up src/module_list.py.orig src/module_list.py # CBLAS can be one of multiple implementations -cblas_pc = pkgconfig.parse('cblas') -+cblas_pc = pkgconfig.parse('atlas') ++cblas_pc = pkgconfig.parse('openblas') cblas_libs = cblas_pc['libraries'] cblas_library_dirs = cblas_pc['library_dirs'] cblas_include_dirs = cblas_pc['include_dirs'] @@ -33,7 +33,7 @@ diff -up src/sage/misc/cython.py.orig src/sage/misc/cython.py # CBLAS can be one of multiple implementations -cblas_pc = pkgconfig.parse('cblas') -+cblas_pc = pkgconfig.parse('atlas') ++cblas_pc = pkgconfig.parse('openblas') cblas_libs = list(cblas_pc['libraries']) cblas_library_dirs = list(cblas_pc['library_dirs']) cblas_include_dirs = list(cblas_pc['include_dirs']) diff --git a/sagemath-python3.patch b/sagemath-python3.patch new file mode 100644 index 0000000..500ebaa --- /dev/null +++ b/sagemath-python3.patch @@ -0,0 +1,1075 @@ +--- build/pkgs/sagenb/src/sagenb/flask_version/worksheet_listing.py.orig 2018-01-24 04:17:47.000000000 -0700 ++++ build/pkgs/sagenb/src/sagenb/flask_version/worksheet_listing.py 2018-10-25 13:25:53.284617298 -0600 +@@ -2,7 +2,12 @@ + """ + from __future__ import absolute_import + import os +-import urllib, urlparse ++try: ++ from urllib.request import urlopen ++ from urllib.parse import urlparse ++except ImportError: ++ from urlparse import urlparse ++ from urllib import urlopen + from flask import Blueprint, url_for, render_template, request, session, redirect, g, current_app + from .decorators import login_required, guest_or_login_required, with_lock + from flask_babel import Babel, gettext, ngettext, lazy_gettext +--- build/pkgs/sagenb/src/sagenb/misc/sphinxify.py.orig 2018-06-10 13:56:16.000000000 -0600 ++++ build/pkgs/sagenb/src/sagenb/misc/sphinxify.py 2018-10-25 13:29:39.187960000 -0600 +@@ -19,6 +19,7 @@ AUTHORS: + import os + import re + import shutil ++import six.moves + from tempfile import mkdtemp + + # We import Sphinx on demand, to reduce Sage startup time. +@@ -94,9 +95,8 @@ def sphinxify(docstring, format='html'): + suffix = '.txt' + output_name = base_name + suffix + +- filed = open(rst_name, 'w') +- filed.write(docstring) +- filed.close() ++ with open(rst_name, 'w') as filed: ++ filed.write(docstring) + + # Sphinx constructor: Sphinx(srcdir, confdir, outdir, doctreedir, + # buildername, confoverrides, status, warning, freshenv). +@@ -120,8 +120,8 @@ def sphinxify(docstring, format='html'): + sys.path = old_sys_path + + #We need to remove "_" from __builtin__ that the gettext module installs +- import __builtin__ +- __builtin__.__dict__.pop('_', None) ++ from six.moves import builtins ++ builtins.__dict__.pop('_', None) + + if os.path.exists(output_name): + output = open(output_name, 'r').read() +@@ -481,7 +481,7 @@ skip_picklability_check_modules = [ + #'sage.misc.nested_class_test', # for test only + 'sage.misc.latex', + 'sage.misc.explain_pickle', +- '__builtin__', ++ 'builtins', + ] + + def check_nested_class_picklability(app, what, name, obj, skip, options): +@@ -532,7 +532,7 @@ def skip_member(app, what, name, obj, sk + if 'SAGE_CHECK_NESTED' in os.environ: + check_nested_class_picklability(app, what, name, obj, skip, options) + +- if getattr(obj, '__module__', None) == '__builtin__': ++ if getattr(obj, '__module__', None) == 'builtins': + return True + + if (hasattr(obj, '__name__') and obj.__name__.find('.') != -1 and +--- build/pkgs/sagenb/src/sagenb/misc/support.py.orig 2018-05-22 10:01:48.000000000 -0600 ++++ build/pkgs/sagenb/src/sagenb/misc/support.py 2018-10-25 13:30:02.499892169 -0600 +@@ -17,7 +17,7 @@ import sys + import pydoc + + from six import iteritems +-import __builtin__ ++import builtins + + try: + from cPickle import PicklingError +@@ -467,7 +467,7 @@ def cython_import(filename, verbose=Fals + use_cache=use_cache, + create_local_c_file=create_local_c_file) + sys.path.append(build_dir) +- return __builtin__.__import__(name) ++ return builtins.__import__(name) + + + def cython_import_all(filename, globals, verbose=False, compile_message=False, +--- build/pkgs/sagenb/src/sagenb/notebook/cell.py.orig 2018-08-29 08:44:38.823169061 -0600 ++++ build/pkgs/sagenb/src/sagenb/notebook/cell.py 2018-10-25 13:30:55.707737342 -0600 +@@ -20,6 +20,7 @@ import shutil + import textwrap + import time + from cgi import escape ++from sys import maxsize + + from sagenb.misc.misc import (word_wrap, strip_string_literals, + set_restrictive_permissions, unicode_str, +@@ -701,9 +702,8 @@ class Cell(Cell_generic): + + # start with a random integer so that evaluations of the cell + # from different runs have different version numbers. +- from sys import maxint + from random import randint +- self._version = randint(0,maxint) ++ self._version = randint(0,maxsize) + + def __repr__(self): + """ +@@ -2189,9 +2189,8 @@ class Cell(Cell_generic): + except AttributeError: + # start with a random integer so that evaluations of the cell + # from different runs have different version numbers. +- from sys import maxint + from random import randint +- self._version = randint(0,maxint) ++ self._version = randint(0,maxsize) + return self._version + + def time(self): +--- build/pkgs/sagenb/src/sagenb/notebook/docHTMLProcessor.py.orig 2018-01-24 04:17:38.000000000 -0700 ++++ build/pkgs/sagenb/src/sagenb/notebook/docHTMLProcessor.py 2018-10-25 13:35:09.227001150 -0600 +@@ -7,7 +7,7 @@ file. + + This takes an HTML document, i.e., Sage documentation, and returns it in + the editable format (notebook worksheet format with evaluable examples). It +-also returns a string representing the CSS link for the document. The SGML ++also returns a string representing the CSS link for the document. The HTML + parser is setup to return only the body of the HTML documentation page and + to re-format Sage examples and type-setting. + +@@ -25,7 +25,7 @@ This module contains three classes: + + .. NOTE:: + +- This extension of sgmllib.SGMLParser was partly inspired by Mark ++ This extension of html.parser.HTMLParser was partly inspired by Mark + Pilgrim's 'Dive Into Python' examples. + + AUTHORS: +@@ -111,14 +111,14 @@ WARNING: + ############################################################################# + from __future__ import unicode_literals + +-from sgmllib import SGMLParser ++from html.parser import HTMLParser + from htmlentitydefs import entitydefs + + from flask import Markup + from sagenb.misc.misc import unicode_str + + +-class genericHTMLProcessor(SGMLParser): ++class genericHTMLProcessor(HTMLParser): + r""" + This class gathers the methods that are common to both classes + :class:`sagenb.notebook.SphinxHTMLProcessor` and +@@ -155,16 +155,16 @@ class genericHTMLProcessor(SGMLParser): + u'

Title

\n\n

nSome text

\n\n\n\n' + + """ +- # self.feed() is a SGMLParser method and starts everything ++ # self.feed() is an HTMLParser method and starts everything + # off; Most of the functions here are extensions to +- # SGMLParser, and may never actually be visibly called here. ++ # HTMLParser, and may never actually be visibly called here. + + # This module works with unicode literals. In case that input data is + # ascii, exceptions may occur. So, input data must be converted to + # unicode if it were not. + doc_in = unicode_str(doc_in) +- self.feed(doc_in) #SGMLParser call +- self.close() #SGMLParser call ++ self.feed(doc_in) #HTMLParser call ++ self.close() #HTMLParser call + self.hand_off_temp_pieces('to_doc_pieces') + return self.all_pieces.replace('\\(', '').replace('\\)', '').replace('\\[', '').replace('\\]', '') + +@@ -390,7 +390,7 @@ class genericHTMLProcessor(SGMLParser): + else: + # first occurrence of an output string + # write /// denoting output +- if output_flag == False: ++ if output_flag is False: + piece += '///' + if p: + piece += '\n' + p +@@ -400,7 +400,29 @@ class genericHTMLProcessor(SGMLParser): + piece += p + piece += '\n}}}\n\n' + return Markup(piece).unescape() +- ++ ++ def handle_starttag(self, tag, attrs): ++ """ ++ introduced when replacing SGMLParser by HTMLParser ++ """ ++ try: ++ method = getattr(self, 'start_' + tag) ++ except AttributeError: ++ self.unknown_starttag(tag, attrs) ++ else: ++ method(attrs) ++ ++ def handle_endtag(self, tag): ++ """ ++ introduced when replacing SGMLParser by HTMLParser ++ """ ++ try: ++ method = getattr(self, 'end_' + tag) ++ except AttributeError: ++ self.unknown_endtag(tag) ++ else: ++ method() ++ + ############################################## + ## General tag handlers + ## These just append their HTML to self.temp_pieces. +@@ -473,6 +495,7 @@ class genericHTMLProcessor(SGMLParser): + """ + if self.keep_data: + self.temp_pieces.append(data) ++ + def handle_charref(self, ref): + r""" + INPUT: +@@ -540,6 +563,7 @@ class genericHTMLProcessor(SGMLParser): + """ + if self.keep_data: + self.temp_pieces.append("" % locals()) ++ + def handle_pi(self, text): + r""" + Handle processing instructions +@@ -585,7 +609,7 @@ class genericHTMLProcessor(SGMLParser): + """ + if self.keep_data: + self.temp_pieces.append("" % locals()) +- ++ + ############################################## + ## Specific tag handlers + def start_body(self, attrs): +@@ -634,6 +658,7 @@ class genericHTMLProcessor(SGMLParser): + ['bunch ', 'of ', 'tmp ', 'strings'] + """ + pass ++ + def end_html(self): + r""" + INPUT: +@@ -658,7 +683,7 @@ class SphinxHTMLProcessor(genericHTMLPro + def reset(self): + r""" + Initialize necessary variables. Called by +- :meth:`SGMLParser.__init__`. ++ :meth:`HTMLParser.__init__`. + + EXAMPLES:: + +@@ -685,8 +710,8 @@ class SphinxHTMLProcessor(genericHTMLPro + + # counters + self.cellcount = 0 +- +- SGMLParser.reset(self) ++ ++ HTMLParser.reset(self) + + def false_positive_input_output_cell(self, cell_piece): + r""" +@@ -733,7 +758,7 @@ class SphinxHTMLProcessor(genericHTMLPro + Once we hit the
tag in a highlighted block, + hand of all of the pieces we've encountered so far + and ignore the tag. +- ++ + INPUT: + + - ``attrs`` - list of tuple +@@ -835,7 +860,7 @@ class SphinxHTMLProcessor(genericHTMLPro + self.hand_off_temp_pieces('to_cell_pieces') + return + self.temp_pieces.append("
") +- ++ + def start_pre(self, attrs): + r""" + Ignore tag
 when inside highligh div.
+@@ -1000,6 +1025,7 @@ class SphinxHTMLProcessor(genericHTMLPro
+         if self.in_highlight_div:
+             return
+         self.unknown_starttag('span', attrs)
++
+     def end_span(self):
+         r"""
+         Ignore all spans that occur within highlighted blocks
+@@ -1095,7 +1121,7 @@ class docutilsHTMLProcessor(genericHTMLP
+     def reset(self):
+         r"""
+         Initialize necessary variables.  Called by
+-        :meth:`SGMLParser.__init__`.
++        :meth:`HTMLParser.__init__`.
+ 
+         EXAMPLES::
+ 
+@@ -1125,8 +1151,8 @@ class docutilsHTMLProcessor(genericHTMLP
+ 
+         # counters
+         self.cellcount = 0
+-                
+-        SGMLParser.reset(self)
++
++        HTMLParser.reset(self)
+ 
+     def false_positive_input_output_cell(self, cell_piece):
+         r"""
+@@ -1162,7 +1188,7 @@ class docutilsHTMLProcessor(genericHTMLP
+         piece = piece.replace('}','} ')
+         piece += '\n
' + return piece +- ++ + ############################################# + ## Specific tag handlers + ## +--- build/pkgs/sagenb/src/sagenb/notebook/notebook.py.orig 2018-05-22 10:16:28.000000000 -0600 ++++ build/pkgs/sagenb/src/sagenb/notebook/notebook.py 2018-10-25 13:35:37.122921027 -0600 +@@ -1268,7 +1268,7 @@ class Notebook(object): + W.set_not_computing() + + def quit(self): +- for W in self.__worksheets.values(): ++ for W in list(self.__worksheets.values()): + W.quit() + + def update_worksheet_processes(self): +--- build/pkgs/sagetex/src/extractsagecode.py.orig 2015-08-26 17:28:42.000000000 -0600 ++++ build/pkgs/sagetex/src/extractsagecode.py 2018-10-25 13:36:23.465787905 -0600 +@@ -45,8 +45,8 @@ See the SageTeX documentation for more d + + try: + opts, args = getopt.getopt(sys.argv[1:], 'ho', ['help', 'overwrite']) +-except getopt.GetoptError, err: +- print str(err) ++except getopt.GetoptError as err: ++ print(str(err)) + usage() + sys.exit(2) + +--- build/pkgs/sagetex/src/makestatic.py.orig 2015-08-26 17:28:42.000000000 -0600 ++++ build/pkgs/sagetex/src/makestatic.py 2018-10-25 13:36:41.193736977 -0600 +@@ -45,8 +45,8 @@ See the SageTeX documentation for more d + + try: + opts, args = getopt.getopt(sys.argv[1:], 'ho', ['help', 'overwrite']) +-except getopt.GetoptError, err: +- print str(err) ++except getopt.GetoptError as err: ++ print(str(err)) + usage() + sys.exit(2) + +--- build/pkgs/sagetex/src/remote-sagetex.py.orig 2015-08-26 17:28:42.000000000 -0600 ++++ build/pkgs/sagetex/src/remote-sagetex.py 2018-10-25 13:38:40.218395127 -0600 +@@ -24,12 +24,11 @@ + ## You should have received a copy of the GNU General Public License along + ## with this program. If not, see . + ## +-from __future__ import print_function + import json + import sys + import time + import re +-import urllib ++import urllib.request, urllib.parse, urllib.error + import hashlib + import os + import os.path +@@ -156,7 +155,7 @@ class RemoteSage: + '\n*(?P.*)', re.DOTALL) + self._404 = re.compile('404 Not Found') + self._session = self._get_url('login', +- urllib.urlencode({'username': user, ++ urllib.parse.urlencode({'username': user, + 'password': + password}))['session'] + self._codewrap = """try: +@@ -176,18 +175,18 @@ except: + _p_.save(filename=plotfilename, **kwargs)""") + + def _encode(self, d): +- return 'session={0}&'.format(self._session) + urllib.urlencode(d) ++ return 'session={0}&'.format(self._session) + urllib.parse.urlencode(d) + + def _get_url(self, action, u): +- with closing(urllib.urlopen(self._srv + '/simple/' + action + +- '?' + u)) as h: ++ with closing(urllib.request.urlopen(self._srv + '/simple/' + action + ++ '?' + u)) as h: + data = self._response.match(h.read()) + result = json.loads(data.group('header')) + result['output'] = data.group('output').rstrip() + return result + + def _get_file(self, fn, cell, ofn=None): +- with closing(urllib.urlopen(self._srv + '/simple/' + 'file' + '?' + ++ with closing(urllib.request.urlopen(self._srv + '/simple/' + 'file' + '?' + + self._encode({'cell': cell, 'file': fn}))) as h: + myfn = ofn if ofn else fn + data = h.read() +@@ -277,13 +276,13 @@ if login_info_file: + password = get_val(line) + + if not server: +- server = raw_input('Enter server: ') ++ server = input('Enter server: ') + + if not server.startswith('http'): + server = 'https://' + server + + if not username: +- username = raw_input('Enter username: ') ++ username = input('Enter username: ') + + if not password: + from getpass import getpass +--- build/pkgs/sagetex/src/run-sagetex-if-necessary.py.orig 2015-08-26 17:28:42.000000000 -0600 ++++ build/pkgs/sagetex/src/run-sagetex-if-necessary.py 2018-10-25 13:39:39.506224849 -0600 +@@ -58,7 +58,7 @@ with open(src + '.tex') as texf: + break + + if not uses_sagetex: +- print src + ".tex doesn't seem to use SageTeX, exiting." ++ print(src + ".tex doesn't seem to use SageTeX, exiting.") + sys.exit(0) + + # if something goes wrong, assume we need to run Sage +@@ -72,7 +72,7 @@ try: + if not re.search(ignore, line): + h.update(line) + except IOError: +- print '{0}.sagetex.sage not found, I think you need to typeset {0}.tex first.'.format(src) ++ print('{0}.sagetex.sage not found, I think you need to typeset {0}.tex first.'.format(src)) + sys.exit(1) + + try: +@@ -80,8 +80,8 @@ try: + for line in outf: + m = re.match('%([0-9a-f]+)% md5sum', line) + if m: +- print 'computed md5:', h.hexdigest() +- print 'sagetex.sout md5:', m.group(1) ++ print('computed md5:', h.hexdigest()) ++ print('sagetex.sout md5:', m.group(1)) + if h.hexdigest() == m.group(1): + run_sage = False + break +@@ -89,7 +89,7 @@ except IOError: + pass + + if run_sage: +- print 'Need to run Sage on {0}.'.format(src) ++ print('Need to run Sage on {0}.'.format(src)) + sys.exit(subprocess.call([path_to_sage, src + '.sagetex.sage'])) + else: +- print 'Not necessary to run Sage on {0}.'.format(src) ++ print('Not necessary to run Sage on {0}.'.format(src)) +--- build/pkgs/sagetex/src/sagetexparse.py.orig 2015-08-26 17:28:42.000000000 -0600 ++++ build/pkgs/sagetex/src/sagetexparse.py 2018-10-25 13:40:02.522158738 -0600 +@@ -52,7 +52,7 @@ class SoutParser(): + try: + OneOrMore(parselabel).parseFile(fn) + except IOError: +- print 'Error accessing %s; exiting. Does your .sout file exist?' % fn ++ print('Error accessing %s; exiting. Does your .sout file exist?' % fn) + sys.exit(1) + def newlabel(self, s, l, t): + self.label.append(t.result[1:-1]) +--- build/pkgs/sagetex/src/sagetex.py.orig 2015-08-26 17:28:42.000000000 -0600 ++++ build/pkgs/sagetex/src/sagetex.py 2018-10-25 13:42:20.168763355 -0600 +@@ -73,10 +73,10 @@ from your current version of Sage; see + http://www.sagemath.org/doc/installation/sagetex.html.""".format(jobname, + version, pyversion) + if version_check: +- raise VersionError, errstr ++ raise VersionError(errstr) + else: +- print '**** WARNING! Skipping version check for .sty and .py files, and' +- print errstr ++ print('**** WARNING! Skipping version check for .sty and .py files, and') ++ print(errstr) + if ' ' in jobname: + jobname = jobname.strip('"') + self.progress('Processing Sage code for {0}.tex...'.format(jobname)) +@@ -116,7 +116,7 @@ http://www.sagemath.org/doc/installation + elif labelname == 'sagecmdline': + pass # output message already printed + else: +- raise ValueError, 'inline() got a bad labelname "{0}"'.format(labelname) ++ raise ValueError('inline() got a bad labelname "{0}"'.format(labelname)) + self.souttmp.write(r'\newlabel{@' + labelname + str(counter) + + '}{{%\n' + s.rstrip() + '}{}{}{}{}}\n') + def savecmd(self, s): +@@ -178,7 +178,7 @@ http://www.sagemath.org/doc/installation + latex(result), + r' \end{displaymath}'] + except SyntaxError: +- exec preparse(splitup[i][2]) in globals, locals ++ exec(preparse(splitup[i][2]), globals, locals) + self.inline(counter, '\n'.join(tex_strs)) + def commandline(self, counter, s, globals, locals, text_output): + self.progress('Sage commandline {0} (line {1})'.format(counter, self.current_tex_line)) +@@ -208,7 +208,7 @@ http://www.sagemath.org/doc/installation + latex(result) + + r'\end{displaymath}') + except SyntaxError: +- exec preparse(splitup[i][2]) in globals, locals ++ exec(preparse(splitup[i][2]), globals, locals) + if 'displaymath' not in tex_strs[-1]: + tex_strs.append(skip) + self.inline(counter, '\n'.join(tex_strs), labelname='sagecmdline') +@@ -233,8 +233,8 @@ http://www.sagemath.org/doc/installation + except ValueError as inst: + if re.match('filetype .*not supported by save', str(inst)): + newfilename = plotfilename[:-3] + 'png' +- print ' saving {0} failed; saving to {1} instead.'.format( +- plotfilename, newfilename) ++ print(' saving {0} failed; saving to {1} instead.'.format( ++ plotfilename, newfilename)) + _p_.save(filename=newfilename, **kwargs) + break + else: +--- src/doc/common/conf.py.orig 2018-10-17 17:13:34.000000000 -0600 ++++ src/doc/common/conf.py 2018-10-25 13:43:39.882534395 -0600 +@@ -490,7 +490,7 @@ skip_picklability_check_modules = [ + #'sage.misc.nested_class_test', # for test only + 'sage.misc.latex', + 'sage.misc.explain_pickle', +- '__builtin__', ++ 'builtins', + ] + + def check_nested_class_picklability(app, what, name, obj, skip, options): +@@ -539,7 +539,7 @@ def skip_member(app, what, name, obj, sk + if 'SAGE_CHECK_NESTED' in os.environ: + check_nested_class_picklability(app, what, name, obj, skip, options) + +- if getattr(obj, '__module__', None) == '__builtin__': ++ if getattr(obj, '__module__', None) == 'builtins': + return True + + objname = getattr(obj, "__name__", None) +--- src/sage/arith/long.pxd.orig 2018-10-17 17:13:35.000000000 -0600 ++++ src/sage/arith/long.pxd 2018-10-25 13:46:00.073131738 -0600 +@@ -19,7 +19,7 @@ from cpython.object cimport Py_SIZE + from cpython.int cimport PyInt_AS_LONG + from cpython.long cimport PyLong_AsLong + from cpython.number cimport PyNumber_Index, PyIndex_Check +-from cpython.longintrepr cimport PyLongObject, PyLong_SHIFT, digit ++from cpython.longintrepr cimport py_long, PyLong_SHIFT, digit + + from sage.libs.gmp.mpz cimport mpz_fits_slong_p, mpz_get_si + from sage.rings.integer_fake cimport is_Integer, Integer_AS_MPZ +@@ -208,7 +208,7 @@ cdef inline bint integer_check_long_py(x + return 0 + + # x is a Python "long" (called "int" on Python 3) +- cdef const digit* D = (x).ob_digit ++ cdef const digit* D = (x).ob_digit + cdef Py_ssize_t size = Py_SIZE(x) + + # We assume that PyLong_SHIFT is 15 on a 32-bit system and 30 on a +--- src/sage/combinat/finite_state_machine.py.orig 2018-10-17 17:13:35.000000000 -0600 ++++ src/sage/combinat/finite_state_machine.py 2018-10-25 13:47:08.277935821 -0600 +@@ -937,7 +937,7 @@ from six.moves import range + from six import itervalues + from six.moves import zip_longest + +-import collections ++import collections.abc + import itertools + + import sage +@@ -14140,7 +14140,7 @@ def is_FSMProcessIterator(PI): + + + class FSMProcessIterator(sage.structure.sage_object.SageObject, +- collections.Iterator): ++ collections.abc.Iterator): + """ + This class takes an input, feeds it into a finite state machine + (automaton or transducer, in particular), tests whether this was +--- src/sage/cpython/dict_del_by_value.pyx.orig 2018-10-17 17:13:36.000000000 -0600 ++++ src/sage/cpython/dict_del_by_value.pyx 2018-10-25 13:48:05.887770337 -0600 +@@ -347,8 +347,8 @@ ELIF PY_VERSION_HEX>=0x03060000: + cdef MyPyDictKeysObject * keys = (mp.ma_keys) + cdef size_t perturb + cdef size_t mask = keys.dk_size-1 +- cdef PyDictKeyEntry *entries, *ep +- entries = DK_ENTRIES(keys) ++ cdef PyDictKeyEntry *ep ++ cdef PyDictKeyEntry *entries = DK_ENTRIES(keys) + + if mp.ma_values != NULL: + print ("del_dictitem_by_exact_value cannot be applied to a shared key dict") +--- src/sage/libs/gap/util.pyx.orig 2018-10-17 17:13:52.000000000 -0600 ++++ src/sage/libs/gap/util.pyx 2018-10-25 13:50:51.168295628 -0600 +@@ -171,7 +171,7 @@ def gap_root(): + return GAP_ROOT_DIR + print('The gap-4.5.5.spkg (or later) seems to be not installed!') + gap_sh = open(os.path.join(SAGE_LOCAL, 'bin', 'gap')).read().splitlines() +- gapdir = filter(lambda dir:dir.strip().startswith('GAP_DIR'), gap_sh)[0] ++ gapdir = next(filter(lambda dir:dir.strip().startswith('GAP_DIR'), gap_sh)) + gapdir = gapdir.split('"')[1] + gapdir = gapdir.replace('$SAGE_LOCAL', SAGE_LOCAL) + return gapdir +--- src/sage/libs/gmp/pylong.pyx.orig 2018-10-17 17:13:52.000000000 -0600 ++++ src/sage/libs/gmp/pylong.pyx 2018-10-25 13:52:12.296063129 -0600 +@@ -28,7 +28,7 @@ AUTHORS: + from cpython.object cimport Py_SIZE + from cpython.int cimport PyInt_FromLong + from cpython.long cimport PyLong_FromLong +-from cpython.longintrepr cimport _PyLong_New, PyLongObject, digit, PyLong_SHIFT ++from cpython.longintrepr cimport _PyLong_New, py_long, digit, PyLong_SHIFT + from .mpz cimport * + + cdef extern from *: +@@ -54,7 +54,7 @@ cdef mpz_get_pylong_large(mpz_srcptr z): + cdef size_t nbits = mpz_sizeinbase(z, 2) + cdef size_t pylong_size = (nbits + PyLong_SHIFT - 1) // PyLong_SHIFT + L = _PyLong_New(pylong_size) +- mpz_export((L).ob_digit, NULL, ++ mpz_export(L.ob_digit, NULL, + -1, sizeof(digit), 0, PyLong_nails, z) + if mpz_sgn(z) < 0: + # Set correct size (use a pointer to hack around Cython's +@@ -91,7 +91,7 @@ cdef int mpz_set_pylong(mpz_ptr z, L) ex + if pylong_size < 0: + pylong_size = -pylong_size + mpz_import(z, pylong_size, -1, sizeof(digit), 0, PyLong_nails, +- (L).ob_digit) ++ (L).ob_digit) + if Py_SIZE(L) < 0: + mpz_neg(z, z) + +--- src/sage/misc/parser.pyx.orig 2018-10-17 17:13:54.000000000 -0600 ++++ src/sage/misc/parser.pyx 2018-10-25 13:57:47.183108335 -0600 +@@ -96,7 +96,7 @@ def token_to_str(int token): + + + cdef inline bint is_alphanumeric(char c): +- return 'a' <= c <= 'z' or 'A' <= c <= 'Z' or '0' <= c <= '9' or c == '_' ++ return c'a' <= c <= c'z' or c'A' <= c <= c'Z' or c'0' <= c <= c'9' or c == c'_' + + cdef inline bint is_whitespace(char c): + return (c != 0) & (strchr(" \t\n\r", c) != NULL) +@@ -247,23 +247,23 @@ cdef class Tokenizer: + return EOS + + # dipthongs +- if s[pos+1] == '=': +- if s[pos] == '<': ++ if s[pos+1] == c'=': ++ if s[pos] == c'<': + self.pos += 2 + return LESS_EQ +- elif s[pos] == '>': ++ elif s[pos] == c'>': + self.pos += 2 + return GREATER_EQ +- elif s[pos] == '!': ++ elif s[pos] == c'!': + self.pos += 2 + return NOT_EQ +- elif s[pos] == '=': ++ elif s[pos] == c'=': + self.pos += 2 +- return '=' ++ return c'=' + +- elif s[pos] == '*' and s[pos+1] == '*': ++ elif s[pos] == c'*' and s[pos+1] == c'*': + self.pos += 2 +- return '^' ++ return c'^' + + # simple tokens + if strchr("+-*/^()=<>,[]{}!", s[pos]): +@@ -272,29 +272,29 @@ cdef class Tokenizer: + return type + + # numeric literals +- if '0' <= s[pos] <= '9' or s[pos] == '.': ++ if c'0' <= s[pos] <= c'9' or s[pos] == c'.': + type = INT + seen_exp = False + seen_decimal = False + while True: +- if '0' <= s[pos] <= '9': ++ if c'0' <= s[pos] <= c'9': + pass +- elif s[pos] == '.': ++ elif s[pos] == c'.': + if seen_decimal or seen_exp: + self.pos = pos + return type + else: + type = FLOAT + seen_decimal = True +- elif s[pos] == 'e' or s[pos] == 'E': ++ elif s[pos] == c'e' or s[pos] == c'E': + if seen_exp: + self.pos = pos + return type + else: + type = FLOAT + seen_exp = True +- elif s[pos] == '+' or s[pos] == '-': +- if not (seen_exp and (s[pos-1] == 'e' or s[pos-1] == 'E')): ++ elif s[pos] == c'+' or s[pos] == c'-': ++ if not (seen_exp and (s[pos-1] == c'e' or s[pos-1] == c'E')): + self.pos = pos + return type + else: +@@ -573,13 +573,13 @@ cdef class Parser: + """ + cdef int token + all = [] +- if tokens.next() == '(': +- token = ',' +- while token == ',': ++ if tokens.next() == c'(': ++ token = c',' ++ while token == c',': + all.append(self.p_list(tokens)) + token = tokens.next() + +- if token == ')': ++ if token == c')': + from sage.matrix.constructor import matrix + return matrix(all) + else: +@@ -601,8 +601,8 @@ cdef class Parser: + [(1, 2, 3), [a + 1, b + 2, c + 3, (d + 4,)]] + """ + all = [] +- cdef int token = ',' +- while token == ',': ++ cdef int token = c',' ++ while token == c',': + token = tokens.peek() + if token == MATRIX: + tokens.next() +@@ -615,14 +615,14 @@ cdef class Parser: + else: + tokens.backtrack() + obj = self.p_eqn(tokens) +- elif token == '[': ++ elif token == c'[': + obj = self.p_list(tokens) +- elif token == '(': ++ elif token == c'(': + obj = self.p_tuple(tokens) + elif token == EOS: + return all +- elif token == ']' or token == ')': +- tokens.token = ',' ++ elif token == c']' or token == c')': ++ tokens.token = c',' + return all + else: + obj = self.p_eqn(tokens) +@@ -646,11 +646,11 @@ cdef class Parser: + [] + """ + cdef int token = tokens.next() +- if token != '[': ++ if token != c'[': + self.parse_error(tokens, "Malformed list") + all = self.p_sequence(tokens) + token = tokens.next() +- if token != ']': ++ if token != c']': + self.parse_error(tokens, "Malformed list") + return all + +@@ -668,20 +668,20 @@ cdef class Parser: + cdef int start = tokens.pos + cdef int token = tokens.next() + cdef bint real_tuple = True +- if token != '(': ++ if token != c'(': + self.parse_error(tokens, "Malformed tuple") + all = self.p_sequence(tokens) + if len(all) == 1: + if tokens.last() != c',': + real_tuple = False + token = tokens.next() +- if token != ')': ++ if token != c')': + self.parse_error(tokens, "Malformed tuple") + if real_tuple: + return tuple(all) + else: + token = tokens.peek() +- if token == ',' or token == EOS: ++ if token == c',' or token == EOS: + return all[0] + else: + # we have to reparse the entire thing as an expression +@@ -717,15 +717,15 @@ cdef class Parser: + """ + lhs = self.p_expr(tokens) + cdef int op = tokens.next() +- if op == '=': ++ if op == c'=': + return lhs == self.p_expr(tokens) + elif op == NOT_EQ: + return lhs != self.p_expr(tokens) +- elif op == '<': ++ elif op == c'<': + return lhs < self.p_expr(tokens) + elif op == LESS_EQ: + return lhs <= self.p_expr(tokens) +- elif op == '>': ++ elif op == c'>': + return lhs > self.p_expr(tokens) + elif op == GREATER_EQ: + return lhs >= self.p_expr(tokens) +@@ -757,9 +757,9 @@ cdef class Parser: + cdef int op + operand1 = self.p_term(tokens) + op = tokens.next() +- while op == '+' or op == '-': ++ while op == c'+' or op == c'-': + operand2 = self.p_term(tokens) +- if op == '+': ++ if op == c'+': + operand1 = operand1 + operand2 + else: + operand1 = operand1 - operand2 +@@ -792,17 +792,17 @@ cdef class Parser: + operand1 = self.p_factor(tokens) + op = tokens.next() + if op == NAME and self.implicit_multiplication: +- op = '*' ++ op = c'*' + tokens.backtrack() +- while op == '*' or op == '/': ++ while op == c'*' or op == c'/': + operand2 = self.p_factor(tokens) +- if op == '*': ++ if op == c'*': + operand1 = operand1 * operand2 + else: + operand1 = operand1 / operand2 + op = tokens.next() + if op == NAME and self.implicit_multiplication: +- op = '*' ++ op = c'*' + tokens.backtrack() + tokens.backtrack() + return operand1 +@@ -826,9 +826,9 @@ cdef class Parser: + t^11 + """ + cdef int token = tokens.next() +- if token == '+': ++ if token == c'+': + return self.p_factor(tokens) +- elif token == '-': ++ elif token == c'-': + return -self.p_factor(tokens) + else: + tokens.backtrack() +@@ -862,13 +862,13 @@ cdef class Parser: + """ + operand1 = self.p_atom(tokens) + cdef int token = tokens.next() +- if token == '^': ++ if token == c'^': + operand2 = self.p_factor(tokens) + return operand1 ** operand2 +- elif token == "!": ++ elif token == c'!': + from sage.functions.all import factorial + operand1 = factorial(operand1) +- if tokens.peek() == '^': ++ if tokens.peek() == c'^': + tokens.next() + operand2 = self.p_factor(tokens) + return operand1 ** operand2 +@@ -913,20 +913,20 @@ cdef class Parser: + elif token == NAME: + name = tokens.last_token_string() + token = tokens.next() +- if token == '(': ++ if token == c'(': + func = self.callable_constructor(name) + args, kwds = self.p_args(tokens) + token = tokens.next() +- if token != ')': ++ if token != c')': + self.parse_error(tokens, "Bad function call") + return func(*args, **kwds) + else: + tokens.backtrack() + return self.variable_constructor(name) +- elif token == '(': ++ elif token == c'(': + expr = self.p_expr(tokens) + token = tokens.next() +- if token != ')': ++ if token != c')': + self.parse_error(tokens, "Mismatched parentheses") + return expr + else: +@@ -948,10 +948,10 @@ cdef class Parser: + """ + args = [] + kwds = {} +- if tokens.peek() == ')': ++ if tokens.peek() == c')': + return args, kwds +- cdef int token = ',' +- while token == ',': ++ cdef int token = c',' ++ while token == c',': + arg = self.p_arg(tokens) + if isinstance(arg, tuple): + name, value = arg +@@ -993,11 +993,11 @@ cdef class Parser: + + """ + cdef int token = tokens.next() +- if token == NAME and tokens.peek() == '=': ++ if token == NAME and tokens.peek() == c'=': + name = tokens.last_token_string() + tokens.next() + return name, self.p_expr(tokens) +- if token == "[" : ++ if token == c'[' : + tokens.backtrack() + return self.p_list(tokens) + else: +--- src/sage/plot/plot3d/plot3d.py.orig 2018-10-17 17:14:08.000000000 -0600 ++++ src/sage/plot/plot3d/plot3d.py 2018-10-25 13:58:48.502933505 -0600 +@@ -194,7 +194,8 @@ class _Coordinates(object): + Arbitrary Coordinates coordinate transform (z in terms of x, y) + """ + import inspect +- all_vars = getargspec(self.transform).args[1:] ++ args, varargs, varkw, defaults, kwonlyargs, kwonlydefaults, ann = inspect.getfullargspec(self.transform) ++ all_vars=args[1:] + if set(all_vars) != set(indep_vars + [dep_var]): + raise ValueError('variables were specified incorrectly for this coordinate system; incorrect variables were %s'%list(set(all_vars).symmetric_difference(set(indep_vars+[dep_var])))) + self.dep_var = dep_var +--- src/sage/plot/point.py.orig 2018-10-17 17:14:09.000000000 -0600 ++++ src/sage/plot/point.py 2018-10-25 13:59:15.278857161 -0600 +@@ -29,7 +29,7 @@ TESTS:: + from sage.misc.decorators import options, rename_keyword + from sage.plot.colors import to_mpl_color + from sage.plot.primitive import GraphicPrimitive_xydata +-import collections ++import collections.abc + + + # TODO: create _allowed_options for 3D point classes to +@@ -343,7 +343,7 @@ def point(points, **kwds): + sage: point(iter([(1,2),(3,5)])) + Graphics object consisting of 1 graphics primitive + """ +- if isinstance(points, collections.Iterator): ++ if isinstance(points, collections.abc.Iterator): + points = list(points) + + try: +--- src/sage/repl/display/fancy_repr.py.orig 2018-10-17 17:14:09.000000000 -0600 ++++ src/sage/repl/display/fancy_repr.py 2018-10-25 14:00:10.301700282 -0600 +@@ -15,7 +15,7 @@ Representations of objects. + import types + + from IPython.lib.pretty import ( +- _safe_getattr, _baseclass_reprs, ++ _safe_getattr, + _type_pprinters, + ) + +@@ -264,7 +264,7 @@ class PlainPythonRepr(ObjectReprABC): + """ + klass = _safe_getattr(obj, '__class__', None) or type(obj) + klass_repr = _safe_getattr(klass, '__repr__', None) +- if klass_repr in _baseclass_reprs: ++ if klass_repr is object.__repr__: + p.text(klass_repr(obj)) + else: + # A user-provided repr. Find newlines and replace them with p.break_() +--- src/sage/repl/ipython_kernel/interact.py.orig 2018-10-17 17:14:09.000000000 -0600 ++++ src/sage/repl/ipython_kernel/interact.py 2018-10-25 14:00:53.038578439 -0600 +@@ -36,7 +36,7 @@ EXAMPLES:: + from ipywidgets.widgets import SelectionSlider, ValueWidget, ToggleButtons + from ipywidgets.widgets.interaction import interactive, signature + from copy import copy +-from collections import Iterable, Iterator ++from collections.abc import Iterable, Iterator + from .widgets import EvalText, SageColorPicker + from sage.structure.element import parent + from sage.symbolic.ring import SR +--- src/sage/rings/integer.pyx.orig 2018-10-17 17:14:11.000000000 -0600 ++++ src/sage/rings/integer.pyx 2018-10-25 14:01:31.320469294 -0600 +@@ -6940,7 +6940,7 @@ cdef int mpz_set_str_python(mpz_ptr z, c + while x[0] == c' ': x += 1 # Strip spaces + + # Disallow a sign here +- if x[0] == '-' or x[0] == '+': ++ if x[0] == c'-' or x[0] == c'+': + x = "" # Force an error below + + assert base >= 2 +--- src/sage/rings/real_mpfi.pyx.orig 2018-10-17 17:14:17.000000000 -0600 ++++ src/sage/rings/real_mpfi.pyx 2018-10-25 14:02:07.823365223 -0600 +@@ -1951,12 +1951,12 @@ cdef class RealIntervalFieldElement(Ring + + cdef long digits + digits = strlen(lower_s) +- if lower_s[0] == '-': ++ if lower_s[0] == c'-': + digits -= 1 + lower_expo -= digits + + digits = strlen(upper_s) +- if upper_s[0] == '-': ++ if upper_s[0] == c'-': + digits -= 1 + upper_expo -= digits + +@@ -2125,7 +2125,7 @@ cdef class RealIntervalFieldElement(Ring + raise MemoryError("Unable to allocate memory for the mantissa of an interval") + mpz_get_str(tmp_cstr, base, lower_mpz) + digits = strlen(tmp_cstr) +- if tmp_cstr[0] == '-': ++ if tmp_cstr[0] == c'-': + digits -= 1 + mant_string = bytes_to_str(tmp_cstr+1) + sign_string = bytes_to_str(b'-') +--- src/sage/symbolic/expression.pyx.orig 2018-10-17 17:14:17.000000000 -0600 ++++ src/sage/symbolic/expression.pyx 2018-10-25 14:03:50.129073537 -0600 +@@ -12955,7 +12955,7 @@ cdef class hold_class: + sage: SR(2)^5 + 32 + """ +- g_set_state('hold', True) ++ g_set_state(b'hold', True) + + def __exit__(self, *args): + """ +@@ -12968,7 +12968,7 @@ cdef class hold_class: + sage: SR(2)^5 + 32 + """ +- g_set_state('hold', False) ++ g_set_state(b'hold', False) + + def start(self): + """ +--- src/setup.py.orig 2018-10-25 11:40:44.402943434 -0600 ++++ src/setup.py 2018-10-25 14:04:15.582000968 -0600 +@@ -284,6 +284,7 @@ class sage_build_cython(Command): + cdivision=True, + embedsignature=True, + fast_getattr=True, ++ language_level=3, + preliminary_late_includes_cy28=True, + profile=self.profile, + ) diff --git a/sagemath-sagedoc.patch b/sagemath-sagedoc.patch index 44e0f49..00a98c8 100644 --- a/sagemath-sagedoc.patch +++ b/sagemath-sagedoc.patch @@ -1,7 +1,7 @@ diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py ---- src/sage/doctest/control.py.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/doctest/control.py 2018-08-29 08:36:07.805487927 -0600 -@@ -102,7 +102,6 @@ class DocTestDefaults(SageObject): +--- src/sage/doctest/control.py.orig 2018-10-17 17:13:36.000000000 -0600 ++++ src/sage/doctest/control.py 2018-10-25 11:40:58.936908341 -0600 +@@ -106,7 +106,6 @@ class DocTestDefaults(SageObject): self.valgrind = False self.massif = False self.cachegrind = False @@ -9,7 +9,7 @@ diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py self.failed = False self.new = False self.show_skipped = False -@@ -292,7 +291,7 @@ class DocTestController(SageObject): +@@ -308,7 +307,7 @@ class DocTestController(SageObject): if options.gdb or options.debug: # Interactive debuggers: "infinite" timeout options.timeout = 0 @@ -18,7 +18,7 @@ diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py # Non-interactive debuggers: 48 hours options.timeout = int(os.getenv('SAGE_TIMEOUT_VALGRIND', 48 * 60 * 60)) elif options.long: -@@ -1071,13 +1070,8 @@ class DocTestController(SageObject): +@@ -1094,13 +1093,8 @@ class DocTestController(SageObject): elif opt.cachegrind: toolname = "cachegrind" flags = os.getenv("SAGE_CACHEGRIND_FLAGS", "") @@ -32,8 +32,8 @@ diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py if "%s" in flags: flags %= toolname + ".%p" # replace %s with toolname cmd += flags + sage_cmd -@@ -1137,10 +1131,10 @@ class DocTestController(SageObject): - 0 +@@ -1185,10 +1179,10 @@ class DocTestController(SageObject): + """ opt = self.options - L = (opt.gdb, opt.valgrind, opt.massif, opt.cachegrind, opt.omega) @@ -46,20 +46,32 @@ diff -up src/sage/doctest/control.py.orig src/sage/doctest/control.py return self.run_val_gdb() else: diff -up src/sage/interfaces/singular.py.orig src/sage/interfaces/singular.py ---- src/sage/interfaces/singular.py.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/sage/interfaces/singular.py 2018-08-29 08:36:07.818487766 -0600 -@@ -2262,7 +2262,7 @@ def generate_docstring_dictionary(): - nodes.clear() +--- src/sage/interfaces/singular.py.orig 2018-10-25 11:40:58.937908339 -0600 ++++ src/sage/interfaces/singular.py 2018-10-25 13:11:10.256190334 -0600 +@@ -2264,7 +2264,7 @@ def generate_docstring_dictionary(): node_names.clear() -- singular_docdir = SAGE_LOCAL+"/share/info/" -+ singular_docdir = os.environ["SINGULAR_BIN_DIR"]+"/info/" + import os +- singular_docdir = os.environ['SINGULARPATH']+"/../info/" ++ singular_docdir = "/usr/share/info/" - new_node = re.compile("File: singular\.hlp, Node: ([^,]*),.*") - new_lookup = re.compile("\* ([^:]*):*([^.]*)\..*") + new_node = re.compile(r"File: singular\.hlp, Node: ([^,]*),.*") + new_lookup = re.compile(r"\* ([^:]*):*([^.]*)\..*") +@@ -2272,8 +2272,9 @@ def generate_docstring_dictionary(): + L, in_node, curr_node = [], False, None + + # singular.hlp contains a few iso-5559-1 encoded special characters +- with io.open(os.path.join(singular_docdir, 'singular.hlp'), +- encoding='latin-1') as f: ++ import gzip ++ with gzip.open(os.path.join(singular_doctir, 'singular.hlp.gz'), ++ encoding='latin-1') as f: + for line in f: + m = re.match(new_node,line) + if m: diff -up src/sage_setup/docbuild/ext/multidocs.py.orig src/sage_setup/docbuild/ext/multidocs.py ---- src/sage_setup/docbuild/ext/multidocs.py.orig 2018-08-03 05:10:09.000000000 -0600 -+++ src/sage_setup/docbuild/ext/multidocs.py 2018-08-29 08:36:07.829487630 -0600 +--- src/sage_setup/docbuild/ext/multidocs.py.orig 2018-10-17 17:14:18.000000000 -0600 ++++ src/sage_setup/docbuild/ext/multidocs.py 2018-10-25 11:40:58.937908339 -0600 @@ -84,8 +84,11 @@ def merge_environment(app, env): for ind in newalldoc: # treat subdocument source as orphaned file and don't complain @@ -75,22 +87,22 @@ diff -up src/sage_setup/docbuild/ext/multidocs.py.orig src/sage_setup/docbuild/e newcite = {} citations = docenv.domaindata["std"]["citations"] diff -up src/sage_setup/docbuild/__init__.py.orig src/sage_setup/docbuild/__init__.py ---- src/sage_setup/docbuild/__init__.py.orig 2018-08-03 05:10:09.000000000 -0600 -+++ src/sage_setup/docbuild/__init__.py 2018-08-29 08:36:07.837487531 -0600 -@@ -272,13 +272,14 @@ if NUM_THREADS > 1: - # map_async handles KeyboardInterrupt correctly. Plain map and - # apply_async does not, so don't use it. - x = pool.map_async(target, args, 1) -+ ret = [] - try: -- ret = x.get(99999) -+ ret = x.get(3600) - pool.close() - pool.join() - except Exception: -- pool.terminate() - if ABORT_ON_ERROR: -+ pool.terminate() - raise - return ret - else: +--- src/sage_setup/docbuild/__init__.py.orig 2018-10-25 11:40:58.938908336 -0600 ++++ src/sage_setup/docbuild/__init__.py 2018-10-25 13:12:56.110881282 -0600 +@@ -279,13 +279,14 @@ def build_many(target, args): + # map_async handles KeyboardInterrupt correctly. Plain map and + # apply_async does not, so don't use it. + x = pool.map_async(target, args, 1) ++ ret = [] + try: +- ret = x.get(99999) ++ ret = x.get(3600) + pool.close() + pool.join() + except Exception: +- pool.terminate() + if ABORT_ON_ERROR: ++ pool.terminate() + raise + return ret + diff --git a/sagemath-scripts.patch b/sagemath-scripts.patch index 2cafa7d..c5c91f0 100644 --- a/sagemath-scripts.patch +++ b/sagemath-scripts.patch @@ -1,6 +1,6 @@ diff -up src/bin/sage.orig src/bin/sage ---- src/bin/sage.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/bin/sage 2018-08-29 08:32:06.325478480 -0600 +--- src/bin/sage.orig 2018-10-17 17:13:34.000000000 -0600 ++++ src/bin/sage 2018-10-24 15:19:11.805131334 -0600 @@ -26,13 +26,10 @@ usage() { echo " file.[sage|py|spyx] -- run given .sage, .py or .spyx file" echo " -advanced -- list all command line options" @@ -131,7 +131,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -startuptime [module] -- display how long each component of Sage takes to" echo " start up; optionally specify a module to get more" echo " details about that particular module" -@@ -220,7 +152,6 @@ usage_advanced() { +@@ -223,7 +155,6 @@ usage_advanced() { echo " -coverage -- give info about doctest coverage of files" echo " -coverageall -- give summary info about doctest coverage of all" echo " files in the Sage library" @@ -139,7 +139,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -search_src -- search through all the Sage library code for string" echo " -search_doc -- search through the Sage documentation for string" echo " -grep -- same as -search_src" -@@ -244,16 +175,6 @@ usage_advanced() { +@@ -249,16 +180,6 @@ usage_advanced() { echo #### 1.......................26..................................................78 #### |.....................--.|...................................................| @@ -156,7 +156,7 @@ diff -up src/bin/sage.orig src/bin/sage echo "Valgrind memory debugging:" echo " -cachegrind -- run Sage using Valgrind's cachegrind tool. The log" echo " files are named sage-cachegrind.PID can be found in" -@@ -267,9 +188,6 @@ usage_advanced() { +@@ -272,9 +193,6 @@ usage_advanced() { echo " -memcheck -- run Sage using Valgrind's memcheck tool. The log" echo " files are named sage-memcheck.PID can be found in" echo " $DOT_SAGE" @@ -166,7 +166,7 @@ diff -up src/bin/sage.orig src/bin/sage echo " -valgrind -- this is an alias for -memcheck" echo echo "You can also use -- before a long option, e.g., 'sage --optional'." -@@ -279,115 +197,6 @@ usage_advanced() { +@@ -284,115 +202,6 @@ usage_advanced() { ##################################################################### @@ -282,7 +282,7 @@ diff -up src/bin/sage.orig src/bin/sage # Report information about the Sage environment ##################################################################### -@@ -416,35 +225,8 @@ if [ $# -gt 0 ]; then +@@ -421,35 +230,8 @@ if [ $# -gt 0 ]; then fi @@ -318,7 +318,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ ! -d "$IPYTHONDIR" ]; then # make sure that $DOT_SAGE exists so that ipython will happily # create its config directories there. If DOT_SAGE doesn't -@@ -455,20 +237,6 @@ sage_setup() { +@@ -460,20 +242,6 @@ sage_setup() { } @@ -339,7 +339,7 @@ diff -up src/bin/sage.orig src/bin/sage # Start an interactive Sage session, this function never returns. interactive_sage() { sage_setup -@@ -552,16 +320,6 @@ if [ "$1" = '-lisp' -o "$1" = '--lisp' ] +@@ -557,16 +325,6 @@ if [ "$1" = '-lisp' -o "$1" = '--lisp' ] exec ecl "$@" fi @@ -356,8 +356,8 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = '-maxima' -o "$1" = '--maxima' ]; then shift exec maxima "$@" -@@ -587,11 +345,6 @@ if [ "$1" = '-pip' -o "$1" = '--pip' ]; - exec pip "$@" +@@ -592,11 +350,6 @@ if [ "$1" = '-pip' -o "$1" = '--pip' ]; + exec sage-python23 -m pip "$@" fi -if [ "$1" = '-fix-pkg-checksums' -o "$1" = '--fix-pkg-checksums' ]; then @@ -368,7 +368,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = '-python' -o "$1" = '--python' ]; then shift if [ "$SAGE_PYTHON3" = 'yes' ]; then -@@ -626,16 +379,6 @@ if [ "$1" = '-ipython3' -o "$1" = '--ipy +@@ -631,16 +384,6 @@ if [ "$1" = '-ipython3' -o "$1" = '--ipy exec ipython3 "$@" fi @@ -385,7 +385,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = '-sh' -o "$1" = '--sh' ]; then # AUTHORS: # - Carl Witty and William Stein: initial version -@@ -755,20 +498,6 @@ EOF +@@ -760,20 +503,6 @@ EOF fi ##################################################################### @@ -406,7 +406,7 @@ diff -up src/bin/sage.orig src/bin/sage # File conversion ##################################################################### -@@ -796,11 +525,6 @@ fi +@@ -804,11 +533,6 @@ fi # Run Sage's versions of the standard Algebra/Geometry etc. software ##################################################################### @@ -418,7 +418,7 @@ diff -up src/bin/sage.orig src/bin/sage if [[ "$1" =~ ^--notebook=.* || "$1" =~ ^-n=.* || "$1" =~ ^-notebook=.* ]] ; then sage-cleaner &>/dev/null & exec sage-notebook "$@" -@@ -811,13 +535,6 @@ if [ "$1" = "-notebook" -o "$1" = '--not +@@ -819,13 +543,6 @@ if [ "$1" = "-notebook" -o "$1" = '--not exec sage-notebook "$@" fi @@ -432,7 +432,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = "-inotebook" -o "$1" = '--inotebook' ]; then shift sage-cleaner &>/dev/null & -@@ -836,34 +553,15 @@ if [ "$1" = '-grepdoc' -o "$1" = "--grep +@@ -844,34 +561,15 @@ if [ "$1" = '-grepdoc' -o "$1" = "--grep exit 0 fi @@ -469,7 +469,7 @@ diff -up src/bin/sage.orig src/bin/sage shift exec sage-runtests -p "$@" else -@@ -872,10 +570,7 @@ if [ "$1" = '-t' -o "$1" = '-bt' -o "$1" +@@ -880,10 +578,7 @@ if [ "$1" = '-t' -o "$1" = '-bt' -o "$1" fi fi @@ -481,7 +481,7 @@ diff -up src/bin/sage.orig src/bin/sage shift sage_setup export PYTHONIOENCODING="utf-8" # Fix encoding for doctests -@@ -896,122 +591,6 @@ if [ "$1" = '-c' ]; then +@@ -904,122 +599,6 @@ if [ "$1" = '-c' ]; then exec sage-eval "$@" fi @@ -604,7 +604,7 @@ diff -up src/bin/sage.orig src/bin/sage if [ "$1" = '-gdb' -o "$1" = "--gdb" ]; then shift sage_setup -@@ -1061,12 +640,6 @@ if [ "$1" = '-callgrind' -o "$1" = "--ca +@@ -1069,12 +648,6 @@ if [ "$1" = '-callgrind' -o "$1" = "--ca exec sage-callgrind "$@" fi @@ -618,9 +618,9 @@ diff -up src/bin/sage.orig src/bin/sage exec sage-startuptime.py "$@" fi diff -up src/bin/sage-runtests.orig src/bin/sage-runtests ---- src/bin/sage-runtests.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/bin/sage-runtests 2018-08-29 08:27:37.703807389 -0600 -@@ -67,10 +67,6 @@ if __name__ == "__main__": +--- src/bin/sage-runtests.orig 2018-10-17 17:13:34.000000000 -0600 ++++ src/bin/sage-runtests 2018-10-24 15:19:11.805131334 -0600 +@@ -76,10 +76,6 @@ if __name__ == "__main__": help="run doctests using Valgrind's cachegrind tool. The log " "files are named sage-cachegrind.PID and can be found in " + os.path.join(DOT_SAGE, "valgrind")) @@ -632,8 +632,8 @@ diff -up src/bin/sage-runtests.orig src/bin/sage-runtests parser.add_option("-f", "--failed", action="store_true", default=False, help="doctest only those files that failed in the previous run") diff -up src/bin/sage-valgrind.orig src/bin/sage-valgrind ---- src/bin/sage-valgrind.orig 2018-08-03 05:10:08.000000000 -0600 -+++ src/bin/sage-valgrind 2018-08-29 08:27:37.703807389 -0600 +--- src/bin/sage-valgrind.orig 2018-10-17 17:13:34.000000000 -0600 ++++ src/bin/sage-valgrind 2018-10-24 15:19:11.805131334 -0600 @@ -1,16 +1,6 @@ #!/usr/bin/env bash diff --git a/sagemath.spec b/sagemath.spec index 5846bb3..a386d27 100644 --- a/sagemath.spec +++ b/sagemath.spec @@ -1,6 +1,6 @@ %global __provides_exclude_from .*/site-packages/.*\\.so -# This package install python files in nonstandard places +# This package installs python files in nonstandard places %global _python_bytecompile_extra 0 %bcond_with bundled_pexpect @@ -44,21 +44,21 @@ %global flintqs_pkg flintqs-1.0 %global graphs_pkg graphs-20161026 %if %{with bundled_ipython} -%global ipython_pkg ipython-5.5.0 +%global ipython_pkg ipython-5.8.0 %endif %if %{with bundled_ipywidgets} %global ipywidgets_pkg ipywidgets-7.2.0 %endif %if %{with bundled_pexpect} -%global pexpect_pkg pexpect-4.1.0 +%global pexpect_pkg pexpect-4.6.0 %endif %global polytopes_db_pkg polytopes_db-20170220 %global rubiks_pkg rubiks-20070912 %global sagenb_pkg sagenb-1.0.3 %global sagenb_export_pkg sagenb_export-3.2 %global sagetex_pkg sagetex-3.0 -%global Sphinx_pkg Sphinx-1.7.5 -%global singular_pkg singular-4.1.0p3 +%global Sphinx_pkg Sphinx-1.7.6 +%global singular_pkg singular-4.1.1p3 %if %{with bundled_thebe} %global thebe_pkg thebe-9624e0a0 %endif @@ -72,7 +72,7 @@ # Spkg equivalents of required rpms; we pretend they are installed as spkgs. # The version numbers shown are those of the latest released spkg, if the Fedora # version is not behind. -%global SAGE_REQUIRED_PKGS 4ti2-1.6.7 cbc-2.9.4 CoCoALib-0.99564 cryptominisat-5.0.1 gap_packages-4.8.6new2 gmp-6.1.2 gmpy2-2.1.0a1 lrslib-062+autotools-2017-03-03 qepcad-B.1.69 saclib-2.2.6 surf-1.0.6-gcc6 +%global SAGE_REQUIRED_PKGS 4ti2-1.6.7 cbc-2.9.4 CoCoALib-0.99564 cryptominisat-5.0.1 gap_packages-4.8.6new2 gmp-6.1.2 gmpy2-2.1.0a1 lrslib-062+autotools-2017-03-03 qepcad-B.1.71 saclib-2.2.7 sirocco-2.0 surf-1.0.6-gcc6 %global SAGE_ROOT %{_libdir}/sagemath %global SAGE_LOCAL %{SAGE_ROOT}/local @@ -85,7 +85,7 @@ Name: sagemath Summary: A free open-source mathematics software system -Version: 8.3 +Version: 8.4 Release: 1%{?dist} # The file ${SAGE_ROOT}/COPYING.txt is the upstream license breakdown file # Additionally, every $files section has a comment with the license name @@ -97,9 +97,6 @@ Source1: gprc.expect # Follow maxima's ExclusiveArch ExclusiveArch: aarch64 %{arm} %{ix86} x86_64 ppc sparcv9 -# Upstream uses mpir not gmp, but the rpm package is tailored to use gmp -Patch1: %{name}-gmp.patch - # Set of patches to work with system wide packages Patch2: %{name}-scripts.patch @@ -140,11 +137,17 @@ Patch10: %{name}-jmol.patch # FIXME actually it should be already available in pari-elldata Patch11: %{name}-cremona.patch +# adapt to python 3 and cython running in python 3 mode +Patch12: %{name}-python3.patch + # correct path to the nauty geng program # http://cs.anu.edu.au/~bdm/nauty/ # http://pallini.di.uniroma1.it/ Patch13: %{name}-nauty.patch +# remove the buildroot path from Cython output +Patch14: %{name}-buildroot.patch + # correct path to Lfunction include # update c++ standard to fix FTBFS Patch15: %{name}-lcalc.patch @@ -174,21 +177,19 @@ Patch22: %{name}-qepcad.patch # Correct path to arb headers Patch23: %{name}-arb.patch -# No support for f" notation -Patch24: %{name}-nofstring.patch +# Add missing escapes, or convert strings to raw strings +Patch24: %{name}-escape.patch # Add missing include paths Patch25: %{name}-includes.patch -# Use atlas blas -Patch26: %{name}-atlas.patch +# Use openblas +Patch26: %{name}-openblas.patch -# Adapt to recent versions of eclib -Patch27: %{name}-eclib.patch +BuildRequires: gdb BuildRequires: 4ti2 BuildRequires: arb-devel -BuildRequires: atlas-devel BuildRequires: boost-devel BuildRequires: brial-devel BuildRequires: cddlib-tools @@ -231,8 +232,10 @@ BuildRequires: jsmol BuildRequires: L-function-devel BuildRequires: lapack-devel BuildRequires: latte-integrale +BuildRequires: libbraiding-devel BuildRequires: libfplll-devel BuildRequires: libgap-devel +BuildRequires: libhomfly-devel BuildRequires: libmpc-devel BuildRequires: libpng-devel BuildRequires: linbox-devel @@ -245,6 +248,7 @@ BuildRequires: maxima-runtime-ecl BuildRequires: mpfi-devel BuildRequires: nauty BuildRequires: ntl-devel +BuildRequires: openblas-devel BuildRequires: openssl BuildRequires: palp BuildRequires: pari-devel @@ -254,77 +258,74 @@ BuildRequires: pari-seadata BuildRequires: planarity-devel BuildRequires: ppl-devel BuildRequires: pynac-devel -BuildRequires: python2-devel -%if %{with bundled_ipython} -BuildRequires: python2-backports-shutil_get_terminal_size -%endif -BuildRequires: python2-brial +BuildRequires: python3-devel +BuildRequires: python3-cypari2-devel +BuildRequires: python3-cysignals-devel +BuildRequires: python3-pillow-devel +BuildRequires: python3dist(brial) %if %{with sphinx_hack} -BuildRequires: python2-configparser +BuildRequires: python3dist(configparser) %endif -BuildRequires: python2-cypari2-devel -BuildRequires: python2-cysignals-devel -BuildRequires: python2-Cython -BuildRequires: python2-crypto -BuildRequires: python2-cryptominisat -BuildRequires: python2-cvxopt -BuildRequires: python2-docutils -BuildRequires: python2-flask-autoindex -BuildRequires: python2-flask-babel -BuildRequires: python2-flask-openid -BuildRequires: python2-flask-silk -BuildRequires: python2-fpylll -BuildRequires: python2-future -BuildRequires: python2-gmpy2 +BuildRequires: python3dist(cvxopt) +BuildRequires: python3dist(cython) +BuildRequires: python3dist(docutils) +BuildRequires: python3dist(flask-autoindex) +BuildRequires: python3dist(flask-babel) +BuildRequires: python3dist(flask-openid) +BuildRequires: python3dist(flask-silk) +BuildRequires: python3dist(fpylll) +BuildRequires: python3dist(future) +BuildRequires: python3dist(gmpy2) %if %{with sphinx_hack} -BuildRequires: python2-html5lib -BuildRequires: python2-imagesize +BuildRequires: python3dist(html5lib) +BuildRequires: python3dist(imagesize) %endif -BuildRequires: python2-ipykernel +BuildRequires: python3dist(ipykernel) %if %{without bundled_ipython} -BuildRequires: python2-ipython +BuildRequires: python3dist(ipython) %endif -BuildRequires: python2-matplotlib -BuildRequires: python2-networkx -BuildRequires: python2-notebook +BuildRequires: python3dist(kiwisolver) +BuildRequires: python3dist(matplotlib) +BuildRequires: python3dist(networkx) +BuildRequires: python3dist(notebook) %if %{with bundled_ipython} -BuildRequires: python2-path +BuildRequires: python3dist(path.py) %endif -BuildRequires: python2-pathlib2 +BuildRequires: python3dist(pathlib2) %if %{without bundled_pexpect} -BuildRequires: python2-pexpect +BuildRequires: python3dist(pexpect) %endif -BuildRequires: python2-pickleshare -BuildRequires: python2-pillow-devel -BuildRequires: python2-pip -BuildRequires: python2-prompt_toolkit -BuildRequires: python2-pkgconfig -BuildRequires: python2-psutil -BuildRequires: python2-ptyprocess -BuildRequires: python2-scipy -BuildRequires: python2-send2trash -BuildRequires: python2-setuptools +BuildRequires: python3dist(pickleshare) +BuildRequires: python3dist(pip) +BuildRequires: python3dist(prompt-toolkit) +BuildRequires: python3dist(pkgconfig) +BuildRequires: python3dist(psutil) +BuildRequires: python3dist(ptyprocess) +BuildRequires: python3dist(pycryptosat) %if %{with bundled_ipython} -BuildRequires: python2-simplegeneric +BuildRequires: python3dist(pyzmq) %endif -BuildRequires: python2-six -BuildRequires: python2-speaklater -BuildRequires: python2-sphinx -BuildRequires: python2-sympy -BuildRequires: python2-twisted +BuildRequires: python3dist(rpy2) +BuildRequires: python3dist(scipy) +BuildRequires: python3dist(scons) +BuildRequires: python3dist(send2trash) +BuildRequires: python3dist(setuptools) %if %{with bundled_ipython} -BuildRequires: python2-zmq +BuildRequires: python3dist(simplegeneric) %endif -BuildRequires: python2-ZODB3 -BuildRequires: python3-Cython +BuildRequires: python3dist(six) +BuildRequires: python3dist(speaklater) +BuildRequires: python3dist(sphinx) +BuildRequires: python3dist(sympy) +BuildRequires: python3dist(twisted) +BuildRequires: python3dist(zodb3) BuildRequires: qepcad-B BuildRequires: R BuildRequires: ratpoints-devel BuildRequires: readline-devel -BuildRequires: rpy BuildRequires: rw-devel -BuildRequires: scons BuildRequires: Singular-devel +BuildRequires: sirocco-devel BuildRequires: stix-math-fonts BuildRequires: symmetrica-devel BuildRequires: sympow @@ -368,67 +369,64 @@ Requires: palp Requires: pari-galdata Requires: pari-gp Requires: pari-seadata -%if %{with bundled_ipython} -Requires: python2-backports-shutil_get_terminal_size -%endif -Requires: python2-brial +Requires: python3dist(brial) %if %{with sphinx_hack} -Requires: python2-configparser +Requires: python3dist(configparser) %endif -Requires: python2-cypari2 -Requires: python2-cysignals -Requires: python2-crypto -Requires: python2-cryptominisat -Requires: python2-cvxopt -Requires: python2-Cython -Requires: python2-docutils -Requires: python2-flask-autoindex -Requires: python2-flask-babel -Requires: python2-flask-openid -Requires: python2-flask-silk -Requires: python2-fpylll -Requires: python2-future -Requires: python2-gmpy2 +Requires: python3dist(cypari2) +Requires: python3dist(cysignals) +Requires: python3dist(cvxopt) +Requires: python3dist(cython) +Requires: python3dist(docutils) +Requires: python3dist(flask-autoindex) +Requires: python3dist(flask-babel) +Requires: python3dist(flask-openid) +Requires: python3dist(flask-silk) +Requires: python3dist(fpylll) +Requires: python3dist(future) +Requires: python3dist(gmpy2) %if %{with sphinx_hack} -Requires: python2-html5lib -Requires: python2-imagesize +Requires: python3dist(html5lib) +Requires: python3dist(imagesize) %endif -Requires: python2-ipykernel +Requires: python3dist(ipykernel) %if %{without bundled_ipython} -Requires: python2-ipython +Requires: python3dist(ipython) %endif -Requires: python2-matplotlib -Requires: python2-networkx -Requires: python2-notebook +Requires: python3dist(kiwisolver) +Requires: python3dist(matplotlib) +Requires: python3dist(networkx) +Requires: python3dist(notebook) %if %{with bundled_ipython} -Requires: python2-path +Requires: python3dist(path) %endif -Requires: python2-pathlib2 +Requires: python3dist(pathlib2) %if %{without bundled_pexpect} -Requires: python2-pexpect +Requires: python3dist(pexpect) %endif -Requires: python2-pickleshare -Requires: python2-pillow -Requires: python2-prompt_toolkit -Requires: python2-psutil -Requires: python2-ptyprocess -Requires: python2-scipy -Requires: python2-send2trash +Requires: python3dist(pickleshare) +Requires: python3dist(pillow) +Requires: python3dist(prompt-toolkit) +Requires: python3dist(psutil) +Requires: python3dist(ptyprocess) +Requires: python3dist(pycryptosat) +Requires: python3dist(rpy2) +Requires: python3dist(scipy) +Requires: python3dist(send2trash) %if %{with bundled_ipython} -BuildRequires: python2-simplegeneric +BuildRequires: python3dist(simplegeneric) %endif -Requires: python2-six -Requires: python2-speaklater -Requires: python2-sphinx -Requires: python2-sympy -Requires: python2-twisted +Requires: python3dist(six) +Requires: python3dist(speaklater) +Requires: python3dist(sphinx) +Requires: python3dist(sympy) +Requires: python3dist(twisted) %if %{with bundled_ipython} -Requires: python2-zmq +Requires: python3dist(zmq) %endif -Requires: python2-ZODB3 +Requires: python3dist(zodb3) Requires: qepcad-B Requires: R -Requires: rpy Requires: %{name}-core Requires: %{name}-data %if %{with docs} @@ -825,7 +823,6 @@ pushd build/pkgs/widgetsnbextension popd %endif -%patch1 %patch2 %patch3 %patch4 @@ -836,7 +833,9 @@ popd %patch9 %patch10 %patch11 +%patch12 %patch13 +%patch14 %patch15 %patch16 %patch17 @@ -854,13 +853,13 @@ popd %patch24 %patch25 %patch26 -%patch27 sed -e 's|@@SAGE_ROOT@@|%{SAGE_ROOT}|' \ -e 's|@@SAGE_DOC@@|%{SAGE_DOC}|' \ -i src/sage/env.py -sed -e 's|@@CYSIGNALS@@|%{python2_sitearch}/cysignals|' \ +sed -e 's|@@CYSIGNALS@@|%{python3_sitearch}/cysignals|' \ + -e 's|@@BUILDROOT@@|%{buildroot}|' \ -i src/setup.py sed -e "/flask-oldsessions/d" \ @@ -886,31 +885,39 @@ sed -e "s,\(SINGULAR_SO = \)SAGE.*,\1'%{_libdir}/libSingular-$singver.so'," \ # fix shebangs; some paths contains spaces, so use the null byte facility grep -FrlZ '#!%{_bindir}/env python' | \ - xargs -0 sed -i 's,#!%{_bindir}/env python,#!%{__python2},' + xargs -0 sed -i 's,#!%{_bindir}/env python,#!%{__python3},' grep -FrlZ '#!%{_bindir}/env sage-python23' | \ - xargs -0 sed -i 's,#!%{_bindir}/env sage-python23,#!%{__python2},' + xargs -0 sed -i 's,#!%{_bindir}/env sage-python23,#!%{__python3},' grep -FrlZ '#!%{_bindir}/env' | \ xargs -0 sed -i 's,#!%{_bindir}/env ,#!%{_bindir}/,' -grep -rlZ '#!%{_bindir}/python$' | xargs -0 sed -i 's,#!%{_bindir}/python$,&2,' -sed -i 's,%{_bindir}/env python,%{__python2},' \ +grep -rlZ '#!%{_bindir}/python$' | xargs -0 sed -i 's,#!%{_bindir}/python$,&3,' +sed -i 's,%{_bindir}/env python,%{__python3},' \ %if %{with bundled_pexpect} build/pkgs/pexpect/src/examples/python.py \ %endif build/pkgs/sagetex/src/sagetex.ins -sed -i 's,%{_bindir}/python,&2,' src/sage/misc/dev_tools.py +sed -i 's,%{_bindir}/python,&3,' src/sage/misc/dev_tools.py sed -e 's,local/bin/python,bin/python,' \ - -e 's,#!%{_bindir}/python,&2,' \ + -e 's,#!%{_bindir}/python,&3,' \ -i src/sage/repl/preparse.py %if %{with bundled_ipython} sed -e "s|'%{_bindir}/env', 'which'|'%{_bindir}/which'|" \ -i build/pkgs/ipython/src/IPython/utils/_process_posix.py %endif +# fix path to pip for python 3 +sed -i 's/"pip",/"pip3",/' src/sage/misc/package.py + +# GAP does not have enough memory to load the entire workspace +sed -i 's/64m/128m/' src/sage/libs/gap/util.pyx + + ######################################################################## %build export CC=%{__cc} export CFLAGS="%{optflags}" export CXXFLAGS="%{optflags}" +export SAGE_PYTHON_VERSION=3 export SAGE_ROOT=%{buildroot}%{SAGE_ROOT} export SAGE_LOCAL=%{buildroot}%{SAGE_LOCAL} # Avoid buildroot in gcc command line (use _builddir instead) @@ -934,8 +941,8 @@ ln -sf %{_includedir} $SAGE_LOCAL/include ln -sf %{_datadir} $SAGE_LOCAL/share export PATH=%{buildroot}%{_bindir}:$PATH -export PYTHON=%{_bindir}/python2 -export PYTHONPATH=%{buildroot}%{python2_sitearch}:$PYTHONPATH +export PYTHON=%{_bindir}/python3 +export PYTHONPATH=%{buildroot}%{python3_sitearch}:$PYTHONPATH #------------------------------------------------------------------------ # Save and update environment to generate bundled interfaces @@ -946,29 +953,29 @@ export SAGE_LOCAL=%{_builddir} %if %{with bundled_ipython} pushd build/pkgs/ipython/src - %__python2 setup.py build - %__python2 setup.py install --root %{_builddir} + %__python3 setup.py build + %__python3 setup.py install --root %{_builddir} popd %endif %if %{with bundled_ipywidgets} pushd build/pkgs/ipywidgets/src - %__python2 setup.py build - %__python2 setup.py install --root %{_builddir} + %__python3 setup.py build + %__python3 setup.py install --root %{_builddir} popd %endif %if %{with bundled_widgetsnbextension} pushd build/pkgs/widgetsnbextension/src - %__python2 setup.py build - %__python2 setup.py install --root %{_builddir} + %__python3 setup.py build + %__python3 setup.py install --root %{_builddir} popd %endif %if %{with cython_hack} - cp -far %{python2_sitearch}/Cython %{_builddir}%{python2_sitearch} + cp -far %{python3_sitearch}/Cython %{_builddir}%{python3_sitearch} BASE=$PWD/build/pkgs/cython/patches/ - pushd %{_builddir}%{python2_sitearch} + pushd %{_builddir}%{python3_sitearch} for PATCH in pxi_sys_path.patch do patch -p1 < $BASE/$PATCH @@ -983,16 +990,16 @@ mkdir -p %{buildroot}%{SAGE_SPKG_INST} mkdir -p %{buildroot}%{_libdir}/sagemath/build/pkgs pushd src - %__python2 -u ./setup.py build + %__python3 -u ./setup.py build popd #------------------------------------------------------------------------ pushd build/pkgs/sagenb/src - %__python2 ./setup.py build + %__python3 ./setup.py build popd pushd build/pkgs/sagenb_export/src - %__python2 ./setup.py build + %__python3 ./setup.py build popd #------------------------------------------------------------------------ @@ -1005,16 +1012,6 @@ pushd build/pkgs/rubiks/src make %{?_smp_mflags} CC="gcc -fPIC" CXX="g++ -fPIC" CFLAGS="%{optflags}" CXXFLAGS="%{optflags}" popd -# Remove buildroot reference from cython comments -perl -pi -e 's|%{buildroot}||g;' `find src/build/cythonized -type f` - -# Try hard to remove buildroot from binaries -rm -f `grep -lr "%{buildroot}" src/build/lib.linux-*/` -rm -f `grep -lr "%{buildroot}" src/build/temp.linux-*/` -pushd src - %__python2 ./setup.py build -popd - # last build command rm -fr $DOT_SAGE @@ -1039,9 +1036,9 @@ export DOT_SAGE=/tmp/sage$$ mkdir -p $DOT_SAGE/tmp export PATH=%{buildroot}%{_bindir}:$PATH -export PYTHON=%{_bindir}/python2 -export PYTHONPATH=%{buildroot}%{python2_sitearch}:$PYTHONPATH -export PYTHONPATH=%{_builddir}%{python2_sitearch}:$PYTHONPATH +export PYTHON=%{_bindir}/python3 +export PYTHONPATH=%{buildroot}%{python3_sitearch}:$PYTHONPATH +export PYTHONPATH=%{_builddir}%{python3_sitearch}:$PYTHONPATH #------------------------------------------------------------------------ mkdir -p %{buildroot}%{_bindir} @@ -1076,10 +1073,10 @@ popd #------------------------------------------------------------------------ pushd src %if %{without install_hack} - %py2_install + %py3_install %else - mkdir -p %{buildroot}%{python2_sitearch} - cp -far build/lib.linux-*/sage %{buildroot}%{python2_sitearch} + mkdir -p %{buildroot}%{python3_sitearch} + cp -far build/lib.linux-*/sage %{buildroot}%{python3_sitearch} %endif %if %{with docs} # install documentation sources @@ -1090,23 +1087,23 @@ popd #------------------------------------------------------------------------ pushd build/pkgs/sagenb/src - rm -f %{buildroot}%{python2_sitearch}/sagenb/data/sage3d/sage3d - %py2_install "--install-purelib=%{python2_sitearch}" + rm -f %{buildroot}%{python3_sitearch}/sagenb/data/sage3d/sage3d + %py3_install "--install-purelib=%{python3_sitearch}" # jsmol ln -sf %{_jsdir}/jsmol $SAGE_SHARE/jsmol # sage3d rm -f %{buildroot}%{_bindir}/sage3d %if %{with sage3d} - ln -sf %{SAGE_LOCAL}/bin/sage3d %{buildroot}%{python2_sitearch}/sagenb/data/sage3d/sage3d + ln -sf %{SAGE_LOCAL}/bin/sage3d %{buildroot}%{python3_sitearch}/sagenb/data/sage3d/sage3d %endif - ln -sf %{python2_sitearch}/sagenb %{buildroot}%{SAGE_SRC}/sagenb + ln -sf %{python3_sitearch}/sagenb %{buildroot}%{SAGE_SRC}/sagenb # use system mathjax - ln -sf %{_jsdir}/mathjax %{buildroot}%{python2_sitearch}/sagenb/data/mathjax + ln -sf %{_jsdir}/mathjax %{buildroot}%{python3_sitearch}/sagenb/data/mathjax popd #------------------------------------------------------------------------ pushd build/pkgs/sagenb_export/src - %py2_install + %py3_install popd #------------------------------------------------------------------------ @@ -1123,8 +1120,8 @@ pushd src/bin cp -fa sage-* $SAGE_LOCAL/bin pushd $SAGE_LOCAL/bin ln -sf %{_bindir}/jmol jmol - ln -sf %{_bindir}/python sage.bin - ln -sf %{_bindir}/python python + ln -sf %{_bindir}/python3 sage.bin + ln -sf %{_bindir}/python3 python ln -sf %{_bindir}/gp sage_pari ln -sf %{_bindir}/gap gap ln -sf %{_bindir}/gmp-ecm ecm @@ -1200,7 +1197,7 @@ popd #------------------------------------------------------------------------ pushd build/pkgs/conway_polynomials - %__python2 ./spkg-install.py + %__python3 ./spkg-install.py popd #------------------------------------------------------------------------ @@ -1211,7 +1208,7 @@ pushd build/pkgs/elliptic_curves tar jxf ../../../upstream/%{elliptic_curves_pkg}.tar.bz2 mv %{elliptic_curves_pkg} src fi - %__python2 ./spkg-install.py + %__python3 ./spkg-install.py popd #------------------------------------------------------------------------ @@ -1228,7 +1225,7 @@ popd #------------------------------------------------------------------------ pushd build/pkgs/sagetex/src - %py2_install "--install-purelib=%{python2_sitearch}" + %py3_install "--install-purelib=%{python3_sitearch}" mv %{buildroot}%{_texmf_main}/tex/latex/sagetex/CONTRIBUTORS \ %{buildroot}%{_docdir}/sagetex for file in PKG-INFO README; do @@ -1238,13 +1235,13 @@ popd #------------------------------------------------------------------------ %if %{with bundled_ipython} -mv %{_builddir}%{python2_sitelib}/IPython %{buildroot}%{SAGE_PYTHONPATH} +mv %{_builddir}%{python3_sitelib}/IPython %{buildroot}%{SAGE_PYTHONPATH} mv %{_builddir}%{_bindir}/ip* %{buildroot}%{SAGE_LOCAL}/bin %endif #------------------------------------------------------------------------ %if %{with bundled_ipywidgets} -mv %{_builddir}%{python2_sitelib}/ipywidgets %{buildroot}%{SAGE_PYTHONPATH} +mv %{_builddir}%{python3_sitelib}/ipywidgets %{buildroot}%{SAGE_PYTHONPATH} %endif #------------------------------------------------------------------------ @@ -1265,7 +1262,7 @@ popd #------------------------------------------------------------------------ %if %{with bundled_widgetsnbextension} pushd build/pkgs/widgetsnbextension/src - %py2_install "--install-purelib=%{python2_sitelib}" + %py3_install "--install-purelib=%{python3_sitelib}" mv %{buildroot}%{_prefix}%{_sysconfdir} %{buildroot}%{_sysconfdir} popd %endif @@ -1324,17 +1321,17 @@ chmod +x %{buildroot}%{SAGE_LOCAL}/bin/sage3d # o install .pxi and .pxd files pushd src for f in `find sage \( -name \*.pxi -o -name \*.pxd -o -name \*.pyx \)`; do - install -p -D -m 0644 $f %{buildroot}%{python2_sitearch}/$f + install -p -D -m 0644 $f %{buildroot}%{python3_sitearch}/$f done # need this or will not "find" the files in the directory, and # fail to link with gmp - touch %{buildroot}%{python2_sitearch}/sage/libs/gmp/__init__.py + touch %{buildroot}%{python3_sitearch}/sage/libs/gmp/__init__.py popd %if %{with docs} #------------------------------------------------------------------------ %if %{with bundled_pexpect} -cp -fa $SAGE_PYTHONPATH/pexpect %{buildroot}%{python2_sitearch} +cp -fa $SAGE_PYTHONPATH/pexpect %{buildroot}%{python3_sitearch} %endif # Build documentation, using %#{buildroot} environment @@ -1344,13 +1341,12 @@ pushd src/doc export PATH=%{buildroot}%{_bindir}:$SAGE_LOCAL/bin:$PATH export SINGULARPATH=%{_datadir}/singular/LIB export SINGULAR_BIN_DIR=%{_libdir}/Singular - export LD_LIBRARY_PATH=%{_libdir}/atlas:$LD_LIBRARY_PATH - export PYTHONPATH=$SAGE_SETUP:%{buildroot}%{python2_sitearch}:$SAGE_PYTHONPATH:$SAGE_DOC + export PYTHONPATH=$SAGE_SETUP:%{buildroot}%{python3_sitearch}:$SAGE_PYTHONPATH:$SAGE_DOC %if %{with sphinx_hack} pushd ../../build/pkgs/sphinx/src - %py2_build - %py2_install "--install-purelib=%{python2_sitearch}" + %py3_build + %py3_install "--install-purelib=%{python3_sitearch}" rm -f %{buildroot}%{_bindir}/sphinx* popd %endif @@ -1362,7 +1358,7 @@ pushd src/doc # python -m sage_setup.docbuild # Build with an X server running, required by some doc builders SAGE_NUM_THREADS=2 LANGUAGES="ca de en fr hu it ja pt ru tr" \ - xvfb-run -a -n 1 %__python2 -m docbuild --no-pdf-links -k all html -j + xvfb-run -a -n 1 %__python3 -m docbuild --no-pdf-links -k all html -j rm -f %{buildroot}%{SAGE_SRC}/doc ln -sf %{SAGE_DOC} %{buildroot}%{SAGE_SRC}/doc @@ -1380,12 +1376,12 @@ sed -i 's|%{buildroot}||g' $SAGE_DOC/test.log %endif %if %{with bundled_pexpect} - rm -f %{buildroot}%{python2_sitearch}/pexpect + rm -f %{buildroot}%{python3_sitearch}/pexpect %endif %if %{with sphinx_hack} - rm -fr %{buildroot}%{python2_sitearch}/sphinx \ - %{buildroot}%{python2_sitearch}/Sphinx* + rm -fr %{buildroot}%{python3_sitearch}/sphinx \ + %{buildroot}%{python3_sitearch}/Sphinx* %endif # More wrong buildroot references @@ -1403,8 +1399,8 @@ perl -pi -e 's|%{buildroot}||g;s|^##||g;' %{buildroot}%{_bindir}/sage export SAGE_SRC=%{buildroot}%{SAGE_SRC} rm -fr $SAGE_SRC/sage $SAGE_ETC/sage $SAGE_ROOT/doc $SAGE_SRC/doc rm -fr $SAGE_ROOT/share $SAGE_ROOT/devel -ln -sf %{python2_sitearch}/sage $SAGE_SRC/sage -ln -sf %{python2_sitearch} $SAGE_ETC/sage +ln -sf %{python3_sitearch}/sage $SAGE_SRC/sage +ln -sf %{python3_sitearch} $SAGE_ETC/sage ln -sf %{SAGE_DOC} $SAGE_ROOT/doc %if %{with docs} ln -sf %{SAGE_DOC} $SAGE_SRC/doc @@ -1452,10 +1448,10 @@ find %{buildroot}%{SAGE_DOC} -type d -name _sources -exec rm -fr {} \+ %endif # remove .po files -rm %{buildroot}%{python2_sitearch}/sagenb/translations/*/LC_MESSAGES/*.po +rm %{buildroot}%{python3_sitearch}/sagenb/translations/*/LC_MESSAGES/*.po %if %{without sage3d} -rm -r %{buildroot}%{python2_sitearch}/sagenb/data/sage3d +rm -r %{buildroot}%{python3_sitearch}/sagenb/data/sage3d %endif # remove build directory in buildroot @@ -1464,7 +1460,7 @@ rm -r %{buildroot}%{python2_sitearch}/sagenb/data/sage3d %if %{without install_hack} # remove sage_setup -rm -r %{buildroot}%{python2_sitearch}/sage_setup +rm -r %{buildroot}%{python3_sitearch}/sage_setup %endif # pretend sagemath spkgs are installed to reduce number of errors @@ -1517,7 +1513,7 @@ chmod +x %{buildroot}%{SAGE_LOCAL}/bin/sage-list-packages #------------------------------------------------------------------------ # Byte compile python files in nonstandard places -%py_byte_compile %{__python2} %{buildroot}%{_texmf_main}/tex/latex/sagetex +%py_byte_compile %{__python3} %{buildroot}%{_texmf_main}/tex/latex/sagetex # last install command rm -fr $DOT_SAGE @@ -1545,6 +1541,7 @@ rm -fr $DOT_SAGE %{SAGE_LOCAL}/include %{SAGE_LOCAL}/lib %{SAGE_LOCAL}/share +%{SAGE_LOCAL}/var %{SAGE_ROOT}/doc %{SAGE_ROOT}/devel %{SAGE_ROOT}/share @@ -1558,7 +1555,6 @@ rm -fr $DOT_SAGE %{_bindir}/sage %{_datadir}/pixmaps/%{name}.png %{_datadir}/applications/%{name}.desktop -%{SAGE_SPKG_INST} %if %{with bundled_thebe} # MIT %{SAGE_SHARE}/thebe @@ -1571,9 +1567,9 @@ rm -fr $DOT_SAGE #------------------------------------------------------------------------ %files core # GPLv2+ -%{python2_sitearch}/sage +%{python3_sitearch}/sage %if %{without install_hack} -%{python2_sitearch}/sage-*.egg-info +%{python3_sitearch}/sage-*.egg-info %endif %if %{with bundled_ipython} %{SAGE_PYTHONPATH}/IPython @@ -1587,7 +1583,7 @@ rm -fr $DOT_SAGE %dir %{_sysconfdir}/jupyter/nbconfig/notebook.d %config(noreplace) %{_sysconfdir}/jupyter/nbconfig/notebook.d/*.json %{_datadir}/jupyter/ -%{python2_sitelib}/widgetsnbextension* +%{python3_sitelib}/widgetsnbextension* %endif #------------------------------------------------------------------------ @@ -1702,76 +1698,79 @@ rm -fr $DOT_SAGE %{SAGE_ETC}/notebook-ipython # GPLv2+ %{SAGE_SRC}/sagenb -%dir %{python2_sitearch}/sagenb -%{python2_sitearch}/sagenb/*.py* -%{python2_sitearch}/sagenb-*.egg-info -%dir %{python2_sitearch}/sagenb/data +%dir %{python3_sitearch}/sagenb +%{python3_sitearch}/sagenb/*.py* +%{python3_sitearch}/sagenb/__pycache__/ +%{python3_sitearch}/sagenb/data/__pycache__/ +%{python3_sitearch}/sagenb/testing/__pycache__/ +%{python3_sitearch}/sagenb-*.egg-info +%dir %{python3_sitearch}/sagenb/data # BSD -%{python2_sitearch}/sagenb/data/codemirror +%{python3_sitearch}/sagenb/data/codemirror # MIT -%{python2_sitearch}/sagenb/data/graph_editor +%{python3_sitearch}/sagenb/data/graph_editor # ASL 2.0 -%{python2_sitearch}/sagenb/data/highlight +%{python3_sitearch}/sagenb/data/highlight # LGPLv2+ %{SAGE_SHARE}/jsmol # (MIT or GPLv2) and (MIT and BSD and GPL) -%{python2_sitearch}/sagenb/data/jquery +%{python3_sitearch}/sagenb/data/jquery # (MIT or GPLv2) and (MIT and BSD and GPL) -%{python2_sitearch}/sagenb/data/jqueryui +%{python3_sitearch}/sagenb/data/jqueryui # Public Domain -%{python2_sitearch}/sagenb/data/json +%{python3_sitearch}/sagenb/data/json # Symbolic link to $_jsdir/mathjax -%{python2_sitearch}/sagenb/data/mathjax -%ghost %{python2_sitearch}/sagenb/data/mathjax.rpmmoved +%{python3_sitearch}/sagenb/data/mathjax +%ghost %{python3_sitearch}/sagenb/data/mathjax.rpmmoved # Empty (do not run doctests flag file) -%{python2_sitearch}/sagenb/data/nodoctest.py* +%{python3_sitearch}/sagenb/data/nodoctest.py* # BSD -%{python2_sitearch}/sagenb/data/openid-realselector +%{python3_sitearch}/sagenb/data/openid-realselector # GPLv2+ -%{python2_sitearch}/sagenb/data/sage +%{python3_sitearch}/sagenb/data/sage %if %{with sage3d} # GPLv2+ -%{python2_sitearch}/sagenb/data/sage3d +%{python3_sitearch}/sagenb/data/sage3d %endif # LGPLv2+ -%{python2_sitearch}/sagenb/data/tiny_mce +%{python3_sitearch}/sagenb/data/tiny_mce # LGPLv2+ -%{python2_sitearch}/sagenb/data/zorn +%{python3_sitearch}/sagenb/data/zorn # GPLv2+ -%{python2_sitearch}/sagenb/flask_version +%{python3_sitearch}/sagenb/flask_version # GPLv2+ -%{python2_sitearch}/sagenb/interfaces +%{python3_sitearch}/sagenb/interfaces # GPLv2+ -%{python2_sitearch}/sagenb/misc +%{python3_sitearch}/sagenb/misc # GPLv2+ -%{python2_sitearch}/sagenb/notebook +%{python3_sitearch}/sagenb/notebook # GPLv2+ -%{python2_sitearch}/sagenb/simple +%{python3_sitearch}/sagenb/simple # GPLv2+ -%{python2_sitearch}/sagenb/storage +%{python3_sitearch}/sagenb/storage # GPLv2+ -%dir %{python2_sitearch}/sagenb/testing -%{python2_sitearch}/sagenb/testing/*.py* -%{python2_sitearch}/sagenb/testing/tests +%dir %{python3_sitearch}/sagenb/testing +%{python3_sitearch}/sagenb/testing/*.py* +%{python3_sitearch}/sagenb/testing/tests # ASL 2.0 -%{python2_sitearch}/sagenb/testing/selenium +%{python3_sitearch}/sagenb/testing/selenium # GPLv2+ -%dir %{python2_sitearch}/sagenb/translations -%lang(cs_CZ) %{python2_sitearch}/sagenb/translations/cs_CZ -%lang(de_AT) %{python2_sitearch}/sagenb/translations/de_AT -%lang(de_AT) %{python2_sitearch}/sagenb/translations/en_US -%lang(de_AT) %{python2_sitearch}/sagenb/translations/es_ES -%lang(de_AT) %{python2_sitearch}/sagenb/translations/fr_FR -%lang(pt_BR) %{python2_sitearch}/sagenb/translations/pt_BR -%lang(ru_RU) %{python2_sitearch}/sagenb/translations/ru_RU -%lang(uk_UA) %{python2_sitearch}/sagenb/translations/uk_UA +%dir %{python3_sitearch}/sagenb/translations +%lang(cs_CZ) %{python3_sitearch}/sagenb/translations/cs_CZ +%lang(de_AT) %{python3_sitearch}/sagenb/translations/de_AT +%lang(de_AT) %{python3_sitearch}/sagenb/translations/en_US +%lang(de_AT) %{python3_sitearch}/sagenb/translations/es_ES +%lang(de_AT) %{python3_sitearch}/sagenb/translations/fr_FR +%lang(pt_BR) %{python3_sitearch}/sagenb/translations/pt_BR +%lang(ru_RU) %{python3_sitearch}/sagenb/translations/ru_RU +%lang(uk_UA) %{python3_sitearch}/sagenb/translations/uk_UA #------------------------------------------------------------------------ %files notebook-export # GPL+ %{_bindir}/sagenb-export -%{python2_sitelib}/sagenb_export -%{python2_sitelib}/sagenb_export-*.egg-info +%{python3_sitelib}/sagenb_export +%{python3_sitelib}/sagenb_export-*.egg-info #------------------------------------------------------------------------ %files rubiks @@ -1788,12 +1787,21 @@ rm -fr $DOT_SAGE #------------------------------------------------------------------------ %files sagetex # GPLv2+ -%{python2_sitearch}/sagetex* +%{python3_sitearch}/sagetex* %{_texmf_main}/tex/latex/sagetex %doc %{_docdir}/sagetex ######################################################################## %changelog +* Thu Oct 25 2018 Jerry James - 8.4-1 +- Update to sagemath 8.4 +- Build for python 3 instead of python 2 due to upcoming python 2 removal +- Add -python3 and -escape patches to fix problems with python 3 +- Drop -nofstring patch, only needed for python 2 +- Drop upstreamed -eclib patch +- Switch from atlas to openblas and rename -atlas patch to -openblas +- Add -buildroot patch and only build cython interfaces once + * Sat Sep 22 2018 Jerry James - 8.3-1 - Update to sagemath 8.3 (bz 1612867) - Drop -lrslib, -gap-hap, and -flask patches diff --git a/sources b/sources index b65bb9d..f7792fd 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (sage-8.3.tar.gz) = d0b971896738adc6604e51a00ff38f41b5c2e7595e8d257346fd975106519a1b3a1734a07229e7bf6e9373073d0cc0ca45c259dece1e7c97a3debd12914485d6 +SHA512 (sage-8.4.tar.gz) = 500c5005420c226993b79e89b761a3c9fe57d5ff6d6d71abedaf347ab2fd16b2f5e3b2caa660c4a0d984ba07038f9b4ffce8eb7b6cb28d2448c62d5e18acd871