Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade ipython to 8.17.x #35251

Closed
wants to merge 18 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions build/pkgs/asttokens/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=asttokens-VERSION.tar.gz
sha1=cca6058c6c23195148be93bfa32c0a0ca9b2f873
md5=67b269e359fcb404cd8626985f3676ae
cksum=3749309047
sha1=eda0bf8bf38ecd475e8358d6ce15968c8679ae86
md5=a9ae6ae0f85398e511bcb9ec87695eed
cksum=1688343887
upstream_url=https://pypi.io/packages/source/a/asttokens/asttokens-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/asttokens/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.1.0
2.2.1
18 changes: 18 additions & 0 deletions build/pkgs/comm/SPKG.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
comm: Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc.
==================================================================================

Description
-----------

Jupyter Python Comm implementation, for usage in ipykernel, xeus-python etc.

License
-------

BSD 3-Clause License

Upstream Contact
----------------

https://pypi.org/project/comm/

5 changes: 5 additions & 0 deletions build/pkgs/comm/checksums.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
tarball=comm-VERSION-py3-none-any.whl
sha1=e7e20f9c1524a9fe059c0b6df90a68e1cd2115a9
md5=165e29c257c70498b61c7a31916727f2
cksum=2011044045
upstream_url=https://pypi.io/packages/py3/c/comm/comm-VERSION-py3-none-any.whl
4 changes: 4 additions & 0 deletions build/pkgs/comm/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
$(PYTHON) | $(PYTHON_TOOLCHAIN)

----------
All lines of this file are ignored except the first.
1 change: 1 addition & 0 deletions build/pkgs/comm/install-requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
comm
1 change: 1 addition & 0 deletions build/pkgs/comm/package-version.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1.4
1 change: 1 addition & 0 deletions build/pkgs/comm/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
standard
6 changes: 3 additions & 3 deletions build/pkgs/ipython/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=ipython-VERSION.tar.gz
sha1=e0dd247f29befed1159d9bdca987d90c2ee0d34a
md5=8c98f6def0622ea32975cb779247c3d7
cksum=2860792697
sha1=62afbe2e62e713ee89bfe5303809bdcd2affb2a3
md5=ac2ff5bad97aa09befdf7f0f27323699
cksum=413345511
upstream_url=https://pypi.io/packages/source/i/ipython/ipython-VERSION.tar.gz
3 changes: 1 addition & 2 deletions build/pkgs/ipython/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
ipython >=7.13.0, <8.9.0
# ipython >= 8.9.0 requires prompt_toolkit too new for Sage
ipython >=7.13.0
2 changes: 1 addition & 1 deletion build/pkgs/ipython/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.6.0
8.17.2
6 changes: 3 additions & 3 deletions build/pkgs/ipywidgets/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=ipywidgets-VERSION.tar.gz
sha1=b2c8adf4fefc012adfb61e03a2e957bddbbb7597
md5=c976de164b782eac9e5dfc933e8da295
cksum=305610881
sha1=95f7ec13e8ce75e2da40c1789b4af291946a6d99
md5=2809d1668037606caac588cab329bece
cksum=1839869422
upstream_url=https://pypi.io/packages/source/i/ipywidgets/ipywidgets-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/ipywidgets/dependencies
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
widgetsnbextension jupyterlab_widgets | $(PYTHON_TOOLCHAIN) ipykernel ipython traitlets $(PYTHON)
widgetsnbextension jupyterlab_widgets comm ipykernel ipython traitlets | $(PYTHON_TOOLCHAIN) $(PYTHON)

----------
All lines of this file are ignored except the first.
2 changes: 1 addition & 1 deletion build/pkgs/ipywidgets/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.2
8.1.1
6 changes: 3 additions & 3 deletions build/pkgs/jedi/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=jedi-VERSION.tar.gz
sha1=e94444bd83b55247fd1f3d27d47cc0b148560134
md5=d8dba4a98a35530f7f5b461c20aff180
cksum=4093067035
sha1=8ff91cf4b06cd540108a4c69105770756f831020
md5=47e89a2b8bedcfeb1527fac37b9ba1b3
cksum=3224505263
upstream_url=https://pypi.io/packages/source/j/jedi/jedi-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/jedi/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.18.1
0.18.2
6 changes: 3 additions & 3 deletions build/pkgs/prompt_toolkit/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=prompt_toolkit-VERSION.tar.gz
sha1=77365bfc17ab577d80708a3395186ec68a7dbb2c
md5=214d36301eb139adba280793040d7755
cksum=3187933391
sha1=a45022d4b1b3bd827cb2e094de7ce40cc7b05337
md5=c5e321dd56e1ed8ed95c5fccffb8f3da
cksum=2595783299
upstream_url=https://pypi.io/packages/source/p/prompt_toolkit/prompt_toolkit-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/prompt_toolkit/distros/conda.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
prompt_toolkit>=3.0.5,<3.0.25
prompt_toolkit>=3.0.38
3 changes: 1 addition & 2 deletions build/pkgs/prompt_toolkit/install-requires.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
# https://github.com/sagemath/sage/issues/33428 - prompt_toolkit 3.0.25+ breaks Ctrl-C
prompt_toolkit >=3.0.5, <3.0.25
prompt_toolkit >=3.0.38
2 changes: 1 addition & 1 deletion build/pkgs/prompt_toolkit/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.24
3.0.38
6 changes: 3 additions & 3 deletions build/pkgs/pygments/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=Pygments-VERSION.tar.gz
sha1=adaf31bf13a7bcc210568537138e0984ecdea626
md5=6ccae578d28d18968b30a4711652fd9a
cksum=613387624
sha1=9a2a836e2acfbc2f83c6c40c379d1335c38fa451
md5=447be4afb076c8325a7dc659aff5b931
cksum=2352097018
upstream_url=https://pypi.io/packages/source/p/pygments/Pygments-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/pygments/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.13.0
2.14.0
6 changes: 3 additions & 3 deletions build/pkgs/stack_data/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=stack_data-VERSION.tar.gz
sha1=58ed9cb32a42e07dbc18356d06f8db96475bc0f2
md5=05c8c6c58c02280bc87b6851e40d38e6
cksum=1485401259
sha1=71d14defdfc9741bca4aaff049668197f01cd088
md5=bf86c3c81a0158e1e7f3979da5a0033b
cksum=3302525331
upstream_url=https://pypi.io/packages/source/s/stack_data/stack_data-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/stack_data/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6.1
0.6.2
6 changes: 3 additions & 3 deletions build/pkgs/wcwidth/checksums.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
tarball=wcwidth-VERSION.tar.gz
sha1=3822ed26dc70a4055827bc66cdc21126e51efd66
md5=a07a75f99d316e14838ac760c831ea37
cksum=497830371
sha1=ec98f6ba8ea7c5d2cec9d24d31539d39e2f90d17
md5=976b997f2ed155b5c2e9a4d50e528d90
cksum=2272376797
upstream_url=https://pypi.io/packages/source/w/wcwidth/wcwidth-VERSION.tar.gz
2 changes: 1 addition & 1 deletion build/pkgs/wcwidth/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.5
0.2.6
24 changes: 24 additions & 0 deletions src/sage/repl/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,18 @@
from IPython.terminal.ipapp import TerminalIPythonApp, IPAppCrashHandler
from IPython.core.crashhandler import CrashHandler

from ctypes import pythonapi, c_int, c_void_p
# The following functions are part of the stable ABI since python 3.2
# See: https://docs.python.org/3/c-api/sys.html#c.PyOS_getsig

# PyOS_sighandler_t PyOS_getsig(int i)
pythonapi.PyOS_getsig.restype = c_void_p
pythonapi.PyOS_getsig.argtypes = c_int,

# PyOS_sighandler_t PyOS_setsig(int i, PyOS_sighandler_t h)
pythonapi.PyOS_setsig.restype = c_void_p
pythonapi.PyOS_setsig.argtypes = c_int, c_void_p,


# TODO: This global variable _do_preparse should be associated with an
# IPython InteractiveShell as opposed to a global variable in this
Expand Down Expand Up @@ -287,6 +299,18 @@
backend = BackendIPythonCommandline()
backend.get_display_manager().switch_backend(backend, shell=self)

def prompt_for_code(self):
# save sigint handlers (python and os level)
# https://github.com/prompt-toolkit/python-prompt-toolkit/issues/1576
# https://github.com/sagemath/sage/issues/33428
# https://github.com/sagemath/sage/pull/35251
import signal
sigint = signal.getsignal(signal.SIGINT)
sigint_os = pythonapi.PyOS_getsig(signal.SIGINT)
text = TerminalInteractiveShell.prompt_for_code(self)
signal.signal(signal.SIGINT, sigint)
pythonapi.PyOS_setsig(signal.SIGINT, sigint_os)
return text

Check warning on line 313 in src/sage/repl/interpreter.py

View check run for this annotation

Codecov / codecov/patch

src/sage/repl/interpreter.py#L307-L313

Added lines #L307 - L313 were not covered by tests

class SageTestShell(SageShellOverride, TerminalInteractiveShell):
"""
Expand Down
Loading