summarylogtreecommitdiffstats
path: root/sagemath-ipython7.patch
diff options
context:
space:
mode:
authorAntonio Rojas2020-08-28 19:01:31 +0200
committerAntonio Rojas2020-08-28 19:01:31 +0200
commit9eed84753b7f9d3730c116e916b2c805433bba1c (patch)
treef7f2f0ee1867748b49a02e2461bd35d1dfb48c50 /sagemath-ipython7.patch
parent507810642f2a726a051ed51a0e384f8c70a190f3 (diff)
downloadaur-9eed84753b7f9d3730c116e916b2c805433bba1c.tar.gz
Rebase patches
Diffstat (limited to 'sagemath-ipython7.patch')
-rw-r--r--sagemath-ipython7.patch234
1 files changed, 0 insertions, 234 deletions
diff --git a/sagemath-ipython7.patch b/sagemath-ipython7.patch
deleted file mode 100644
index a8d0d375bd99..000000000000
--- a/sagemath-ipython7.patch
+++ /dev/null
@@ -1,234 +0,0 @@
-diff --git a/src/sage/repl/attach.py b/src/sage/repl/attach.py
-index 11967fbf96..ccb9c4e0c0 100644
---- a/src/sage/repl/attach.py
-+++ b/src/sage/repl/attach.py
-@@ -596,12 +596,7 @@ def reload_attached_files_if_modified():
- basename = os.path.basename(filename)
- timestr = time.strftime('%T', mtime)
- notice = '### reloading attached file {0} modified at {1} ###'.format(basename, timestr)
-- if ip and ip.pt_cli:
-- with ip.pt_cli.patch_stdout_context(raw=True):
-- print(notice)
-- code = load_wrap(filename, attach=True)
-- ip.run_cell(code)
-- elif ip:
-+ if ip:
- print(notice)
- code = load_wrap(filename, attach=True)
- ip.run_cell(code)
-diff --git a/src/sage/repl/display/fancy_repr.py b/src/sage/repl/display/fancy_repr.py
-index 818498fbae..af33f92126 100644
---- a/src/sage/repl/display/fancy_repr.py
-+++ b/src/sage/repl/display/fancy_repr.py
-@@ -16,10 +16,12 @@ Representations of objects.
- from io import StringIO
-
- from IPython.lib.pretty import (
-- _safe_getattr, _baseclass_reprs,
-+ _safe_getattr,
- _type_pprinters,
- )
-
-+_baseclass_reprs = (object.__repr__,)
-+
- from sage.repl.display.util import format_list
-
-
-diff --git a/src/sage/repl/display/formatter.py b/src/sage/repl/display/formatter.py
-index 5eece441c6..11db26b0db 100644
---- a/src/sage/repl/display/formatter.py
-+++ b/src/sage/repl/display/formatter.py
-@@ -175,8 +175,8 @@ class SageDisplayFormatter(DisplayFormatter):
- sage: shell.run_cell('ipython_image')
- <IPython.core.display.Image object>
- sage: shell.run_cell('get_ipython().display_formatter.format(ipython_image)')
-- ({u'image/png': ...'\x89PNG...',
-- u'text/plain': u'<IPython.core.display.Image object>'},
-+ ({'image/png': ...',
-+ 'text/plain': '<IPython.core.display.Image object>'},
- {})
-
- Test that IPython images still work even in latex output mode::
-diff --git a/src/sage/repl/interpreter.py b/src/sage/repl/interpreter.py
-index e843486e26..780cae264d 100644
---- a/src/sage/repl/interpreter.py
-+++ b/src/sage/repl/interpreter.py
-@@ -78,7 +78,7 @@ Check that Cython source code appears in tracebacks::
- dummy line
- ...
- ZeroDivisionError...Traceback (most recent call last)
-- <ipython-input-...> in <module>()
-+ <ipython-input-...> in <module>...
- ----> 1 Integer(1)/Integer(0)
- .../sage/rings/integer.pyx in sage.rings.integer.Integer...div... (.../cythonized/sage/rings/integer.c:...)()
- ...
-@@ -364,22 +364,19 @@ class SageTestShell(SageShellOverride, TerminalInteractiveShell):
- ###################################################################
- # Transformers used in the SageInputSplitter
- ###################################################################
--from IPython.core.inputtransformer import (CoroutineInputTransformer,
-- StatelessInputTransformer,
-- _strip_prompts)
-+from IPython.core.inputtransformer2 import PromptStripper
-
--@StatelessInputTransformer.wrap
--def SagePreparseTransformer(line):
-+def SagePreparseTransformer(lines):
- r"""
- EXAMPLES::
-
- sage: from sage.repl.interpreter import SagePreparseTransformer
-- sage: spt = SagePreparseTransformer()
-- sage: spt.push('1+1r+2.3^2.3r')
-- "Integer(1)+1+RealNumber('2.3')**2.3"
-+ sage: spt = SagePreparseTransformer
-+ sage: spt(['1+1r+2.3^2.3r'])
-+ ["Integer(1)+1+RealNumber('2.3')**2.3"]
- sage: preparser(False)
-- sage: spt.push('2.3^2')
-- '2.3^2'
-+ sage: spt(['2.3^2'])
-+ ['2.3^2']
-
- TESTS:
-
-@@ -400,57 +397,15 @@ def SagePreparseTransformer(line):
- <BLANKLINE>
- sage: shell.quit()
- """
-- if _do_preparse and not line.startswith('%'):
-- return preparse(line)
-- else:
-- return line
--
--@CoroutineInputTransformer.wrap
--def SagePromptTransformer():
-- r"""
-- Strip the sage:/....: prompts of Sage.
--
-- EXAMPLES::
--
-- sage: from sage.repl.interpreter import SagePromptTransformer
-- sage: spt = SagePromptTransformer()
-- sage: spt.push("sage: 2 + 2")
-- '2 + 2'
-- sage: spt.push('')
-- ''
-- sage: spt.push("....: 2+2")
-- '2+2'
--
-- This should strip multiple prompts: see :trac:`16297`::
--
-- sage: spt.push("sage: sage: 2+2")
-- '2+2'
-- sage: spt.push(" sage: ....: 2+2")
-- '2+2'
--
-- The prompt contains a trailing space. Extra spaces between the
-- last prompt and the remainder should not be stripped::
--
-- sage: spt.push(" sage: ....: 2+2")
-- ' 2+2'
--
-- We test that the input transformer is enabled on the Sage command
-- line::
--
-- sage: from sage.repl.interpreter import get_test_shell
-- sage: shell = get_test_shell()
-- sage: shell.run_cell('sage: a = 123') # single line
-- sage: shell.run_cell('sage: a = [\n... 123]') # old-style multi-line
-- sage: shell.run_cell('sage: a = [\n....: 123]') # new-style multi-line
--
-- We test that :trac:`16196` is resolved::
-+ lines_out = []
-+ for line in lines:
-+ if _do_preparse and not line.startswith('%'):
-+ lines_out += [preparse(line)]
-+ else:
-+ lines_out += [line]
-+ return lines_out
-
-- sage: shell.run_cell(' sage: 1+1')
-- 2
-- sage: shell.quit()
-- """
-- _sage_prompt_re = re.compile(r'^(\s*(:?sage: |\.\.\.\.: ))+')
-- return _strip_prompts(_sage_prompt_re)
-+SagePromptTransformer = PromptStripper(prompt_re=re.compile(r'^(\s*(:?sage: |\.\.\.\.: ))+'))
-
- ###################
- # Interface shell #
-@@ -612,7 +567,7 @@ def interface_shell_embed(interface):
- sage: shell = interface_shell_embed(gap)
- sage: shell.run_cell('List( [1..10], IsPrime )')
- [ false, true, true, false, true, false, true, false, false, false ]
-- <ExecutionResult object at ..., execution_count=None error_before_exec=None error_in_exec=None result=[ false, true, true, false, true, false, true, false, false, false ]>
-+ <ExecutionResult object at ..., execution_count=None error_before_exec=None error_in_exec=None ...result=[ false, true, true, false, true, false, true, false, false, false ]>
- """
- cfg = sage_ipython_config.copy()
- ipshell = InteractiveShellEmbed(config=cfg,
-diff --git a/src/sage/repl/ipython_extension.py b/src/sage/repl/ipython_extension.py
-index fd27b43fc4..a0a9f80dff 100644
---- a/src/sage/repl/ipython_extension.py
-+++ b/src/sage/repl/ipython_extension.py
-@@ -511,10 +511,8 @@ class SageCustomizations(object):
- from .interpreter import (SagePreparseTransformer,
- SagePromptTransformer)
-
-- for s in (self.shell.input_splitter, self.shell.input_transformer_manager):
-- s.physical_line_transforms.insert(1, SagePromptTransformer())
-- s.python_line_transforms.append(SagePreparseTransformer())
--
-+ self.shell.input_transformers_cleanup.insert(1, SagePromptTransformer)
-+ self.shell.input_transformers_post.append(SagePreparseTransformer)
-
- class SageJupyterCustomizations(SageCustomizations):
- @staticmethod
-diff --git a/src/sage/repl/ipython_tests.py b/src/sage/repl/ipython_tests.py
-index d342ba7fac..ab9504337e 100644
---- a/src/sage/repl/ipython_tests.py
-+++ b/src/sage/repl/ipython_tests.py
-@@ -42,6 +42,7 @@ Next, test the pinfo magic for Cython code::
- Init docstring: ...ee help(type(...)) for...signature...
- File: .../sage/tests/stl_vector.pyx
- Type: type
-+ ...
-
- Next, test the ``pinfo`` magic for ``R`` interface code, see :trac:`26906`::
-
-@@ -67,6 +68,7 @@ calls when you ask for the double-questionmark help, like `foo??` ::
- sage: shell.run_cell(u'from sage.repl.ipython_tests import dummy')
- sage: shell.run_cell(u'%pinfo2 dummy')
- Signature: dummy(argument, optional=None)
-+ ...
- Source:
- def dummy(argument, optional=None):
- """
-@@ -116,6 +118,7 @@ Next, test the pinfo2 magic for Cython code::
- ...
- File: .../sage/tests/stl_vector.pyx
- Type: type
-+ ...
-
- Next, test the ``pinfo2`` magic for ``R`` interface code, see :trac:`26906`::
-
-diff --git a/src/sage/rings/qqbar.py b/src/sage/rings/qqbar.py
-index 9c6ec027d0..4d3521c3e8 100644
---- a/src/sage/rings/qqbar.py
-+++ b/src/sage/rings/qqbar.py
-@@ -8094,13 +8094,13 @@ class ANBinaryExpr(ANDescr):
- decrease it before we return::
-
- sage: import sys; sys.getrecursionlimit()
-- 1000
-+ 3000
- sage: s = SymmetricFunctions(QQ).schur()
- sage: a=s([3,2]).expand(8)(flatten([[QQbar.zeta(3)^d for d in range(3)], [QQbar.zeta(5)^d for d in range(5)]]))
- sage: a.exactify(); a # long time
- 0
- sage: sys.getrecursionlimit()
-- 1000
-+ 3000
-
- """
- import sys