diff options
author | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-05-02 12:04:00 +0300 |
---|---|---|
committer | arcadia-devtools <arcadia-devtools@yandex-team.ru> | 2022-05-02 12:04:00 +0300 |
commit | 6d4102c808d949679abef976da125ce9add38a4b (patch) | |
tree | 6860eab8f8f96155f1a6bb7ef7e8574bb539c5a1 | |
parent | 3d696cd6bae90f6dec92155deaef46752f4e5275 (diff) | |
download | ydb-6d4102c808d949679abef976da125ce9add38a4b.tar.gz |
intermediate changes
ref:7c966abfc0f8dc17181b1cb81dbfec353e66ba5e
10 files changed, 63 insertions, 44 deletions
diff --git a/contrib/python/ipython/py3/.dist-info/METADATA b/contrib/python/ipython/py3/.dist-info/METADATA index a3bc994a4e..998a98b150 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: 7.32.0 +Version: 7.33.0 Summary: IPython: Productive Interactive Computing Home-page: https://ipython.org Author: The IPython Development Team diff --git a/contrib/python/ipython/py3/.dist-info/entry_points.txt b/contrib/python/ipython/py3/.dist-info/entry_points.txt index 7795cb412a..30c576bd75 100644 --- a/contrib/python/ipython/py3/.dist-info/entry_points.txt +++ b/contrib/python/ipython/py3/.dist-info/entry_points.txt @@ -8,4 +8,3 @@ ipython3 = IPython:start_ipython ipython = IPython.lib.lexers:IPythonLexer ipython3 = IPython.lib.lexers:IPython3Lexer ipythonconsole = IPython.lib.lexers:IPythonConsoleLexer - diff --git a/contrib/python/ipython/py3/IPython/core/completer.py b/contrib/python/ipython/py3/IPython/core/completer.py index 776edeb52b..6c6fa7e7e5 100644 --- a/contrib/python/ipython/py3/IPython/core/completer.py +++ b/contrib/python/ipython/py3/IPython/core/completer.py @@ -41,7 +41,7 @@ or using unicode completion: Only valid Python identifiers will complete. Combining characters (like arrow or dots) are also available, unlike latex they need to be put after the their -counterpart that is to say, `F\\\\vec<tab>` is correct, not `\\\\vec<tab>F`. +counterpart that is to say, ``F\\\\vec<tab>`` is correct, not ``\\\\vec<tab>F``. Some browsers are known to display combining characters incorrectly. diff --git a/contrib/python/ipython/py3/IPython/core/inputtransformer.py b/contrib/python/ipython/py3/IPython/core/inputtransformer.py index afeca93cc0..14a351d40a 100644 --- a/contrib/python/ipython/py3/IPython/core/inputtransformer.py +++ b/contrib/python/ipython/py3/IPython/core/inputtransformer.py @@ -193,7 +193,7 @@ def assemble_logical_lines(): line = ''.join(parts) # Utilities -def _make_help_call(target, esc, lspace, next_input=None): +def _make_help_call(target, esc, lspace): """Prepares a pinfo(2)/psearch call from a target name and the escape (i.e. ? or ??)""" method = 'pinfo2' if esc == '??' \ @@ -203,12 +203,13 @@ def _make_help_call(target, esc, lspace, next_input=None): #Prepare arguments for get_ipython().run_line_magic(magic_name, magic_args) t_magic_name, _, t_magic_arg_s = arg.partition(' ') t_magic_name = t_magic_name.lstrip(ESC_MAGIC) - if next_input is None: - return '%sget_ipython().run_line_magic(%r, %r)' % (lspace, t_magic_name, t_magic_arg_s) - else: - return '%sget_ipython().set_next_input(%r);get_ipython().run_line_magic(%r, %r)' % \ - (lspace, next_input, t_magic_name, t_magic_arg_s) - + return "%sget_ipython().run_line_magic(%r, %r)" % ( + lspace, + t_magic_name, + t_magic_arg_s, + ) + + # These define the transformations for the different escape characters. def _tr_system(line_info): "Translate lines escaped with: !" @@ -349,10 +350,7 @@ def help_end(line): esc = m.group(3) lspace = _initial_space_re.match(line).group(0) - # If we're mid-command, put it back on the next prompt for the user. - next_input = line.rstrip('?') if line.strip() != m.group(0) else None - - return _make_help_call(target, esc, lspace, next_input) + return _make_help_call(target, esc, lspace) @CoroutineInputTransformer.wrap diff --git a/contrib/python/ipython/py3/IPython/core/inputtransformer2.py b/contrib/python/ipython/py3/IPython/core/inputtransformer2.py index 5b6f4a10b3..c0bb39979d 100644 --- a/contrib/python/ipython/py3/IPython/core/inputtransformer2.py +++ b/contrib/python/ipython/py3/IPython/core/inputtransformer2.py @@ -301,7 +301,7 @@ ESC_PAREN = '/' # Call first argument with rest of line as arguments ESCAPE_SINGLES = {'!', '?', '%', ',', ';', '/'} ESCAPE_DOUBLES = {'!!', '??'} # %% (cell magic) is handled separately -def _make_help_call(target, esc, next_input=None): +def _make_help_call(target, esc): """Prepares a pinfo(2)/psearch call from a target name and the escape (i.e. ? or ??)""" method = 'pinfo2' if esc == '??' \ @@ -311,11 +311,8 @@ def _make_help_call(target, esc, next_input=None): #Prepare arguments for get_ipython().run_line_magic(magic_name, magic_args) t_magic_name, _, t_magic_arg_s = arg.partition(' ') t_magic_name = t_magic_name.lstrip(ESC_MAGIC) - if next_input is None: - return 'get_ipython().run_line_magic(%r, %r)' % (t_magic_name, t_magic_arg_s) - else: - return 'get_ipython().set_next_input(%r);get_ipython().run_line_magic(%r, %r)' % \ - (next_input, t_magic_name, t_magic_arg_s) + return "get_ipython().run_line_magic(%r, %r)" % (t_magic_name, t_magic_arg_s) + def _tr_help(content): """Translate lines escaped with: ? @@ -456,13 +453,8 @@ class HelpEnd(TokenTransformBase): target = m.group(1) esc = m.group(3) - # If we're mid-command, put it back on the next prompt for the user. - next_input = None - if (not lines_before) and (not lines_after) \ - and content.strip() != m.group(0): - next_input = content.rstrip('?\n') - call = _make_help_call(target, esc, next_input=next_input) + call = _make_help_call(target, esc) new_line = indent + call + '\n' return lines_before + [new_line] + lines_after @@ -733,8 +725,10 @@ class MaybeAsyncCompile(Compile): super().__init__() self.flags |= extra_flags - def __call__(self, *args, **kwds): - return compile(*args, **kwds) + + if sys.version_info < (3,8): + def __call__(self, *args, **kwds): + return compile(*args, **kwds) class MaybeAsyncCommandCompiler(CommandCompiler): diff --git a/contrib/python/ipython/py3/IPython/core/interactiveshell.py b/contrib/python/ipython/py3/IPython/core/interactiveshell.py index e222e991c0..8fd546b847 100644 --- a/contrib/python/ipython/py3/IPython/core/interactiveshell.py +++ b/contrib/python/ipython/py3/IPython/core/interactiveshell.py @@ -297,19 +297,29 @@ class ExecutionInfo(object): store_history = False silent = False shell_futures = True + cell_id = None - def __init__(self, raw_cell, store_history, silent, shell_futures): + def __init__(self, raw_cell, store_history, silent, shell_futures, cell_id): self.raw_cell = raw_cell self.store_history = store_history self.silent = silent self.shell_futures = shell_futures + self.cell_id = cell_id def __repr__(self): name = self.__class__.__qualname__ - raw_cell = ((self.raw_cell[:50] + '..') - if len(self.raw_cell) > 50 else self.raw_cell) - return '<%s object at %x, raw_cell="%s" store_history=%s silent=%s shell_futures=%s>' %\ - (name, id(self), raw_cell, self.store_history, self.silent, self.shell_futures) + raw_cell = ( + (self.raw_cell[:50] + "..") if len(self.raw_cell) > 50 else self.raw_cell + ) + return '<%s object at %x, raw_cell="%s" store_history=%s silent=%s shell_futures=%s cell_id=%s>' % ( + name, + id(self), + raw_cell, + self.store_history, + self.silent, + self.shell_futures, + self.cell_id, + ) class ExecutionResult(object): @@ -2928,7 +2938,14 @@ class InteractiveShell(SingletonConfigurable): self.showtraceback() warn('Unknown failure executing module: <%s>' % mod_name) - def run_cell(self, raw_cell, store_history=False, silent=False, shell_futures=True): + def run_cell( + self, + raw_cell, + store_history=False, + silent=False, + shell_futures=True, + cell_id=None, + ): """Run a complete IPython cell. Parameters @@ -2955,14 +2972,22 @@ class InteractiveShell(SingletonConfigurable): result = None try: result = self._run_cell( - raw_cell, store_history, silent, shell_futures) + raw_cell, store_history, silent, shell_futures, cell_id + ) finally: self.events.trigger('post_execute') if not silent: self.events.trigger('post_run_cell', result) return result - def _run_cell(self, raw_cell:str, store_history:bool, silent:bool, shell_futures:bool): + def _run_cell( + self, + raw_cell: str, + store_history: bool, + silent: bool, + shell_futures: bool, + cell_id: str, + ) -> ExecutionResult: """Internal method to run a complete IPython cell.""" # we need to avoid calling self.transform_cell multiple time on the same thing @@ -2982,6 +3007,7 @@ class InteractiveShell(SingletonConfigurable): shell_futures=shell_futures, transformed_cell=transformed_cell, preprocessing_exc_tuple=preprocessing_exc_tuple, + cell_id=cell_id, ) # run_cell_async is async, but may not actually need an eventloop. @@ -3002,7 +3028,9 @@ class InteractiveShell(SingletonConfigurable): try: return runner(coro) except BaseException as e: - info = ExecutionInfo(raw_cell, store_history, silent, shell_futures) + info = ExecutionInfo( + raw_cell, store_history, silent, shell_futures, cell_id + ) result = ExecutionResult(info) result.error_in_exec = e self.showtraceback(running_compiled_code=True) @@ -3060,7 +3088,8 @@ class InteractiveShell(SingletonConfigurable): shell_futures=True, *, transformed_cell: Optional[str] = None, - preprocessing_exc_tuple: Optional[Any] = None + preprocessing_exc_tuple: Optional[Any] = None, + cell_id=None, ) -> ExecutionResult: """Run a complete IPython cell asynchronously. @@ -3091,8 +3120,7 @@ class InteractiveShell(SingletonConfigurable): .. versionadded:: 7.0 """ - info = ExecutionInfo( - raw_cell, store_history, silent, shell_futures) + info = ExecutionInfo(raw_cell, store_history, silent, shell_futures, cell_id) result = ExecutionResult(info) if (not raw_cell) or raw_cell.isspace(): diff --git a/contrib/python/ipython/py3/IPython/core/magic.py b/contrib/python/ipython/py3/IPython/core/magic.py index 63b6bec685..b41a651f50 100644 --- a/contrib/python/ipython/py3/IPython/core/magic.py +++ b/contrib/python/ipython/py3/IPython/core/magic.py @@ -319,7 +319,7 @@ class MagicsManager(Configurable): For example:: - c.MagicsManger.lazy_magics = { + c.MagicsManager.lazy_magics = { "my_magic": "slow.to.import", "my_other_magic": "also.slow", } diff --git a/contrib/python/ipython/py3/IPython/core/release.py b/contrib/python/ipython/py3/IPython/core/release.py index 8faabe871f..879d8cc4f8 100644 --- a/contrib/python/ipython/py3/IPython/core/release.py +++ b/contrib/python/ipython/py3/IPython/core/release.py @@ -20,7 +20,7 @@ name = 'ipython' # release. 'dev' as a _version_extra string means this is a development # version _version_major = 7 -_version_minor = 32 +_version_minor = 33 _version_patch = 0 _version_extra = '.dev' # _version_extra = 'b1' diff --git a/contrib/python/ipython/py3/IPython/terminal/ipapp.py b/contrib/python/ipython/py3/IPython/terminal/ipapp.py index b2b8d5f964..1a3c6c791b 100644 --- a/contrib/python/ipython/py3/IPython/terminal/ipapp.py +++ b/contrib/python/ipython/py3/IPython/terminal/ipapp.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # encoding: utf-8 """ -The :class:`~IPython.core.application.Application` object for the command +The :class:`~traitlets.config.application.Application` object for the command line :command:`ipython` program. """ diff --git a/contrib/python/ipython/py3/IPython/utils/_sysinfo.py b/contrib/python/ipython/py3/IPython/utils/_sysinfo.py index 950e8a10d6..6c996d02d4 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 = u"e84cee846" +commit = u"fd4cac190" |