aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python
diff options
context:
space:
mode:
authorrobot-contrib <robot-contrib@yandex-team.com>2023-12-09 08:18:12 +0300
committerrobot-contrib <robot-contrib@yandex-team.com>2023-12-09 08:35:25 +0300
commit1a5ddc956c05a593cbe2d043d5f4e190602d9b98 (patch)
tree7316ec45b1d291595bc6841b8e6416c3fddf1e93 /contrib/python
parent5f8da71fa8b7ccef2ff0900693a77069bf8b4eab (diff)
downloadydb-1a5ddc956c05a593cbe2d043d5f4e190602d9b98.tar.gz
Update contrib/python/ipython/py3 to 8.18.0
Diffstat (limited to 'contrib/python')
-rw-r--r--contrib/python/ipython/py3/.dist-info/METADATA3
-rw-r--r--contrib/python/ipython/py3/IPython/core/completerlib.py5
-rw-r--r--contrib/python/ipython/py3/IPython/core/interactiveshell.py2
-rw-r--r--contrib/python/ipython/py3/IPython/core/release.py4
-rw-r--r--contrib/python/ipython/py3/IPython/terminal/interactiveshell.py57
-rw-r--r--contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/qt.py4
-rw-r--r--contrib/python/ipython/py3/IPython/utils/_sysinfo.py2
-rw-r--r--contrib/python/ipython/py3/ya.make2
8 files changed, 32 insertions, 47 deletions
diff --git a/contrib/python/ipython/py3/.dist-info/METADATA b/contrib/python/ipython/py3/.dist-info/METADATA
index 7c42295cf6..732f97c10d 100644
--- a/contrib/python/ipython/py3/.dist-info/METADATA
+++ b/contrib/python/ipython/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: ipython
-Version: 8.17.2
+Version: 8.18.0
Summary: IPython: Productive Interactive Computing
Home-page: https://ipython.org
Author: The IPython Development Team
@@ -36,7 +36,6 @@ Requires-Dist: traitlets >=5
Requires-Dist: typing-extensions ; python_version < "3.10"
Requires-Dist: exceptiongroup ; python_version < "3.11"
Requires-Dist: pexpect >4.3 ; sys_platform != "win32"
-Requires-Dist: appnope ; sys_platform == "darwin"
Requires-Dist: colorama ; sys_platform == "win32"
Provides-Extra: all
Requires-Dist: black ; extra == 'all'
diff --git a/contrib/python/ipython/py3/IPython/core/completerlib.py b/contrib/python/ipython/py3/IPython/core/completerlib.py
index 74252dcfad..a970ba6968 100644
--- a/contrib/python/ipython/py3/IPython/core/completerlib.py
+++ b/contrib/python/ipython/py3/IPython/core/completerlib.py
@@ -164,7 +164,10 @@ def get_root_modules():
# Don't try to scan for modules every time.
return list(sys.builtin_module_names)
- rootmodules_cache = ip.db.get('rootmodules_cache', {})
+ if getattr(ip.db, "_mock", False):
+ rootmodules_cache = {}
+ else:
+ rootmodules_cache = ip.db.get("rootmodules_cache", {})
rootmodules = list(sys.builtin_module_names)
start_time = time()
store = False
diff --git a/contrib/python/ipython/py3/IPython/core/interactiveshell.py b/contrib/python/ipython/py3/IPython/core/interactiveshell.py
index 0a528c51f2..67727404f9 100644
--- a/contrib/python/ipython/py3/IPython/core/interactiveshell.py
+++ b/contrib/python/ipython/py3/IPython/core/interactiveshell.py
@@ -42,6 +42,8 @@ try:
except ModuleNotFoundError:
class PickleShareDB: # type: ignore [no-redef]
+ _mock = True
+
def __init__(self, path):
pass
diff --git a/contrib/python/ipython/py3/IPython/core/release.py b/contrib/python/ipython/py3/IPython/core/release.py
index 8a349a17c6..f79a43ab3b 100644
--- a/contrib/python/ipython/py3/IPython/core/release.py
+++ b/contrib/python/ipython/py3/IPython/core/release.py
@@ -16,8 +16,8 @@
# release. 'dev' as a _version_extra string means this is a development
# version
_version_major = 8
-_version_minor = 17
-_version_patch = 2
+_version_minor = 18
+_version_patch = 0
_version_extra = ".dev"
# _version_extra = "rc1"
_version_extra = "" # Uncomment this for full releases
diff --git a/contrib/python/ipython/py3/IPython/terminal/interactiveshell.py b/contrib/python/ipython/py3/IPython/terminal/interactiveshell.py
index 9b63159dfa..997fd82250 100644
--- a/contrib/python/ipython/py3/IPython/terminal/interactiveshell.py
+++ b/contrib/python/ipython/py3/IPython/terminal/interactiveshell.py
@@ -631,7 +631,7 @@ class TerminalInteractiveShell(InteractiveShell):
editing_mode = getattr(EditingMode, self.editing_mode.upper())
- self.pt_loop = asyncio.new_event_loop()
+ self._use_asyncio_inputhook = False
self.pt_app = PromptSession(
auto_suggest=self.auto_suggest,
editing_mode=editing_mode,
@@ -798,24 +798,23 @@ class TerminalInteractiveShell(InteractiveShell):
# If we don't do this, people could spawn coroutine with a
# while/true inside which will freeze the prompt.
- policy = asyncio.get_event_loop_policy()
- old_loop = get_asyncio_loop()
-
- # FIXME: prompt_toolkit is using the deprecated `asyncio.get_event_loop`
- # to get the current event loop.
- # This will probably be replaced by an attribute or input argument,
- # at which point we can stop calling the soon-to-be-deprecated `set_event_loop` here.
- if old_loop is not self.pt_loop:
- policy.set_event_loop(self.pt_loop)
- try:
- with patch_stdout(raw=True):
+ with patch_stdout(raw=True):
+ if self._use_asyncio_inputhook:
+ # When we integrate the asyncio event loop, run the UI in the
+ # same event loop as the rest of the code. don't use an actual
+ # input hook. (Asyncio is not made for nesting event loops.)
+ asyncio_loop = get_asyncio_loop()
+ text = asyncio_loop.run_until_complete(
+ self.pt_app.prompt_async(
+ default=default, **self._extra_prompt_options()
+ )
+ )
+ else:
text = self.pt_app.prompt(
default=default,
- **self._extra_prompt_options())
- finally:
- # Restore the original event loop.
- if old_loop is not None and old_loop is not self.pt_loop:
- policy.set_event_loop(old_loop)
+ inputhook=self._inputhook,
+ **self._extra_prompt_options(),
+ )
return text
@@ -950,29 +949,7 @@ class TerminalInteractiveShell(InteractiveShell):
else:
self.active_eventloop = self._inputhook = None
- # For prompt_toolkit 3.0. We have to create an asyncio event loop with
- # this inputhook.
- if PTK3:
- import asyncio
- from prompt_toolkit.eventloop import new_eventloop_with_inputhook
-
- if gui == 'asyncio':
- # When we integrate the asyncio event loop, run the UI in the
- # same event loop as the rest of the code. don't use an actual
- # input hook. (Asyncio is not made for nesting event loops.)
- self.pt_loop = get_asyncio_loop()
- print("Installed asyncio event loop hook.")
-
- elif self._inputhook:
- # If an inputhook was set, create a new asyncio event loop with
- # this inputhook for the prompt.
- self.pt_loop = new_eventloop_with_inputhook(self._inputhook)
- print(f"Installed {self.active_eventloop} event loop hook.")
- else:
- # When there's no inputhook, run the prompt in a separate
- # asyncio event loop.
- self.pt_loop = asyncio.new_event_loop()
- print("GUI event loop hook disabled.")
+ self._use_asyncio_inputhook = gui == "asyncio"
# Run !system commands directly, not through pipes, so terminal programs
# work correctly.
diff --git a/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/qt.py b/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/qt.py
index cf6d11ea6c..2f3f491ef9 100644
--- a/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/qt.py
+++ b/contrib/python/ipython/py3/IPython/terminal/pt_inputhooks/qt.py
@@ -84,3 +84,7 @@ def inputhook(context):
_exec(event_loop)
finally:
notifier.setEnabled(False)
+
+ # This makes sure that the event loop is garbage collected.
+ # See issue 14240.
+ event_loop.setParent(None)
diff --git a/contrib/python/ipython/py3/IPython/utils/_sysinfo.py b/contrib/python/ipython/py3/IPython/utils/_sysinfo.py
index 602452db2d..35828a83e6 100644
--- a/contrib/python/ipython/py3/IPython/utils/_sysinfo.py
+++ b/contrib/python/ipython/py3/IPython/utils/_sysinfo.py
@@ -1,2 +1,2 @@
# GENERATED BY setup.py
-commit = "ef3bae307"
+commit = "928881c53"
diff --git a/contrib/python/ipython/py3/ya.make b/contrib/python/ipython/py3/ya.make
index eefe3a62cc..debdff6419 100644
--- a/contrib/python/ipython/py3/ya.make
+++ b/contrib/python/ipython/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(8.17.2)
+VERSION(8.18.0)
LICENSE(BSD-3-Clause)