A question for sage old-timers/historians/paleontologists

73 views
Skip to first unread message

Emmanuel Charpentier

unread,
Aug 25, 2020, 4:20:57 AM8/25/20
to sage-devel
Dear all,

9.2.beta8 introduced the use of IPython 7 in Sage, which broke the emacs interface sage-shell-mode ; I'm trying to fix it. 

This needs to account for three versions of IPython
  • "Antique" Sage : readline interface to IPython <5
  • "Modern" Sage, up to 9.2.beta7 : pseudo-terminal to IPython 5
  • "Newer" Sage, i. e. 9.2.beta9 and later :  readline, start sage with the --simple-prompt option introduced in 9.2.beta9.
[ Note that 9.2.beta8 is a lost cause : it would need --simple-prompt, but doesn't support it... ]

This can be done at startup, but is slow. I'd like to offer the possibility to configure that in init.el ; in order to offer useful guidelines to the user, I need to know the precise limit between "Antique" and "Modern" Sage. Hence my question :

What was the first version of Sage using IPython 5 ?

Thanks in advance, 

Dima Pasechnik

unread,
Aug 25, 2020, 4:35:11 AM8/25/20
to sage-devel
git is your friend here, telling you that it happened in commit
d55cb7744b6500619664f136c18c4b2bb70c8b70

$ git log -p build/pkgs/ipython/package-version.txt
....
commit d55cb7744b6500619664f136c18c4b2bb70c8b70
Author: Volker Braun <vbrau...@gmail.com>
Date: Tue Jul 12 00:32:45 2016 +0200

Update IPython 5.0

diff --git a/build/pkgs/ipython/package-version.txt
b/build/pkgs/ipython/package-version.txt
index fae6e3d04b..0062ac9718 100644
--- a/build/pkgs/ipython/package-version.txt
+++ b/build/pkgs/ipython/package-version.txt
@@ -1 +1 @@
-4.2.1
+5.0.0

searching this commit on trac gives you https://trac.sagemath.org/ticket/21006

HTH
Dima
> --
> You received this message because you are subscribed to the Google Groups "sage-devel" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to sage-devel+...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/sage-devel/6ea8a817-0c00-4775-a2d2-8c1c07a35a55n%40googlegroups.com.

Emmanuel Charpentier

unread,
Aug 25, 2020, 5:21:53 AM8/25/20
to sage-devel
Thank you Dima.

Do you happen to remember what was the firs Sage version including this ticket ?

Emmanuel Charpentier

unread,
Aug 25, 2020, 5:39:40 AM8/25/20
to sage-devel
That seems to be 7.3.beta8. But a confirmation would be welcome...

Dima Pasechnik

unread,
Aug 25, 2020, 6:19:07 AM8/25/20
to sage-devel
ticket milestone says 7.4

Samuel Lelievre

unread,
Aug 25, 2020, 7:55:23 AM8/25/20
to sage-devel
Given the ticket number, search sage-release:


And we find it was merged in Sage 7.4.beta0

    0a80508 Updated SageMath version to 7.4.beta0
    ...
    9831d4b Trac #21006: Upgrade to IPython 5.0
    ...
    b630b41 Updated SageMath version to 7.3

Given the commit number, use

    $ git tag --contains <commit_number>

In this case:

    $ git tag --contains d55cb7744b

also shows 7.4.beta0 is the earliest tag containing that commit.

Samuel Lelievre

unread,
Aug 25, 2020, 7:59:16 AM8/25/20
to sage-devel


2020-08-25 08:20:57 UTC, Emmanuel Charpentier:
9.2.beta8 introduced the use of IPython 7 in Sage, which broke
the emacs interface sage-shell-mode ; I'm trying to fix it.

The "fix" link got messed up. Correct link:

Emmanuel Charpentier

unread,
Aug 25, 2020, 7:59:57 AM8/25/20
to sage-devel
Thank you, Dima ! Thank you Samuel. Both of you learned me something new today. And that's a Good Thing (TM)....

Sébastien Labbé

unread,
Aug 25, 2020, 10:06:09 AM8/25/20
to sage-devel
Since the passage to IPython 5.0 in version 7.4 of Sage, I am using the option

c.TerminalInteractiveShell.display_completions = 'readlinelike'

in the file profile_default/ipython_config.py. See my answer in the question https://ask.sagemath.org/question/35826.

Can this option be useful for the problems with emacs with Ipython 7?

Sébastien

Emmanuel Charpentier

unread,
Aug 25, 2020, 2:08:43 PM8/25/20
to sage-devel
FWIW, I just submitted a pull request against sage-shell-mode to fix this issue (by reverting to readline and using --simple-prompt).

A better solution (manage CPR requests in emacs) is out of my abilities...

HTH

Emmanuel Charpentier

unread,
Aug 25, 2020, 2:23:20 PM8/25/20
to sage-devel
I think that this is a different issue. As far as I understand it (i. e. not much...), IPython insists to "talk" to a cursor-adressable terminal ; as far as I know, this has not (yet) been implemented in emacs buffers.

in Sage-in-a-terminal (under Linux + gnome-terminal),  tab-completion works as expected and the four arrow keys can be used to select the "right" completion. In a Sage session (using my proposed fix to sage-shell-mode), auto-complete works as expected.

HTH,
Reply all
Reply to author
Forward
0 new messages