diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2024-10-17 11:21:34 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2024-10-17 11:31:31 +0300 |
commit | 09691831380ca7c15cfed3445465e27837c4130d (patch) | |
tree | 230283a3041728afefff825e1e5fb6da019eeb3e | |
parent | 68f2bcc600fc15fb8400346624c43d6be3ec81b2 (diff) | |
download | ydb-09691831380ca7c15cfed3445465e27837c4130d.tar.gz |
Intermediate changes
commit_hash:2d9a1d3a3501b70a635f24b69a195c83059b71da
11 files changed, 78 insertions, 20 deletions
diff --git a/contrib/python/ipython/py3/.dist-info/METADATA b/contrib/python/ipython/py3/.dist-info/METADATA index db0f29ac01..b3a405d51d 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.27.0 +Version: 8.28.0 Summary: IPython: Productive Interactive Computing Author: The IPython Development Team Author-email: ipython-dev@python.org diff --git a/contrib/python/ipython/py3/IPython/core/debugger.py b/contrib/python/ipython/py3/IPython/core/debugger.py index a858972bb5..e7a0b8fb55 100644 --- a/contrib/python/ipython/py3/IPython/core/debugger.py +++ b/contrib/python/ipython/py3/IPython/core/debugger.py @@ -14,14 +14,35 @@ Among other things, this subclass of PDB: - hide frames in tracebacks based on `__tracebackhide__` - allows to skip frames based on `__debuggerskip__` + +Global Configuration +-------------------- + +The IPython debugger will by read the global ``~/.pdbrc`` file. +That is to say you can list all comands supported by ipdb in your `~/.pdbrc` +configuration file, to globally configure pdb. + +Example:: + + # ~/.pdbrc + skip_predicates debuggerskip false + skip_hidden false + context 25 + +Features +-------- + +The IPython debugger can hide and skip frames when printing or moving through +the stack. This can have a performance impact, so can be configures. + The skipping and hiding frames are configurable via the `skip_predicates` command. By default, frames from readonly files will be hidden, frames containing -``__tracebackhide__=True`` will be hidden. +``__tracebackhide__ = True`` will be hidden. -Frames containing ``__debuggerskip__`` will be stepped over, frames who's parent -frames value of ``__debuggerskip__`` is ``True`` will be skipped. +Frames containing ``__debuggerskip__`` will be stepped over, frames whose parent +frames value of ``__debuggerskip__`` is ``True`` will also be skipped. >>> def helpers_helper(): ... pass @@ -1070,7 +1091,9 @@ class Pdb(OldPdb): raise ValueError() self.context = new_context except ValueError: - self.error("The 'context' command requires a positive integer argument.") + self.error( + f"The 'context' command requires a positive integer argument (current value {self.context})." + ) class InterruptiblePdb(Pdb): diff --git a/contrib/python/ipython/py3/IPython/core/display.py b/contrib/python/ipython/py3/IPython/core/display.py index 20e2e34b8f..5c4557b150 100644 --- a/contrib/python/ipython/py3/IPython/core/display.py +++ b/contrib/python/ipython/py3/IPython/core/display.py @@ -41,7 +41,11 @@ from warnings import warn def __getattr__(name): if name in _deprecated_names: - warn(f"Importing {name} from IPython.core.display is deprecated since IPython 7.14, please import from IPython display", DeprecationWarning, stacklevel=2) + warn( + f"Importing {name} from IPython.core.display is deprecated since IPython 7.14, please import from IPython.display", + DeprecationWarning, + stacklevel=2, + ) return getattr(display_functions, name) if name in globals().keys(): diff --git a/contrib/python/ipython/py3/IPython/core/magics/packaging.py b/contrib/python/ipython/py3/IPython/core/magics/packaging.py index 093b0a2ec1..09d4117270 100644 --- a/contrib/python/ipython/py3/IPython/core/magics/packaging.py +++ b/contrib/python/ipython/py3/IPython/core/magics/packaging.py @@ -9,6 +9,7 @@ #----------------------------------------------------------------------------- import functools +import os import re import shlex import sys @@ -41,6 +42,16 @@ def _get_conda_like_executable(command): executable: string Value should be: conda, mamba or micromamba """ + # Check for a environment variable bound to the base executable, both conda and mamba + # set these when activating an environment. + base_executable = "CONDA_EXE" + if "mamba" in command.lower(): + base_executable = "MAMBA_EXE" + if base_executable in os.environ: + executable = Path(os.environ[base_executable]) + if executable.is_file(): + return str(executable.resolve()) + # Check if there is a conda executable in the same directory as the Python executable. # This is the case within conda's root environment. executable = Path(sys.executable).parent / command @@ -48,10 +59,12 @@ def _get_conda_like_executable(command): return str(executable) # Otherwise, attempt to extract the executable from conda history. - # This applies in any conda environment. + # This applies in any conda environment. Parsing this way is error prone because + # different versions of conda and mamba include differing cmd values such as + # `conda`, `conda-script.py`, or `path/to/conda`, here use the raw command provided. history = Path(sys.prefix, "conda-meta", "history").read_text(encoding="utf-8") match = re.search( - rf"^#\s*cmd:\s*(?P<command>.*{executable})\s[create|install]", + rf"^#\s*cmd:\s*(?P<command>.*{command})\s[create|install]", history, flags=re.MULTILINE, ) diff --git a/contrib/python/ipython/py3/IPython/core/release.py b/contrib/python/ipython/py3/IPython/core/release.py index c77f561096..fb5a54da6a 100644 --- a/contrib/python/ipython/py3/IPython/core/release.py +++ b/contrib/python/ipython/py3/IPython/core/release.py @@ -16,7 +16,7 @@ # release. 'dev' as a _version_extra string means this is a development # version _version_major = 8 -_version_minor = 27 +_version_minor = 28 _version_patch = 0 _version_extra = ".dev" # _version_extra = "rc1" diff --git a/contrib/python/ipython/py3/IPython/core/ultratb.py b/contrib/python/ipython/py3/IPython/core/ultratb.py index 15c835f4d2..e38ef29c7d 100644 --- a/contrib/python/ipython/py3/IPython/core/ultratb.py +++ b/contrib/python/ipython/py3/IPython/core/ultratb.py @@ -830,8 +830,8 @@ class VerboseTB(TBTools): traceback, to be used with alternate interpreters (because their own code would appear in the traceback).""" - _tb_highlight = "" - _tb_highlight_style = "default" + tb_highlight = "" + tb_highlight_style = "default" def __init__( self, @@ -1133,8 +1133,8 @@ class VerboseTB(TBTools): after = context // 2 before = context - after if self.has_colors: - style = get_style_by_name(self._tb_highlight_style) - style = stack_data.style_with_executing_node(style, self._tb_highlight) + style = get_style_by_name(self.tb_highlight_style) + style = stack_data.style_with_executing_node(style, self.tb_highlight) formatter = Terminal256Formatter(style=style) else: formatter = None diff --git a/contrib/python/ipython/py3/IPython/external/qt_loaders.py b/contrib/python/ipython/py3/IPython/external/qt_loaders.py index 1486cf9d77..6058ee5a9a 100644 --- a/contrib/python/ipython/py3/IPython/external/qt_loaders.py +++ b/contrib/python/ipython/py3/IPython/external/qt_loaders.py @@ -302,13 +302,25 @@ def import_pyside6(): ImportErrors raised within this function are non-recoverable """ + + def get_attrs(module): + return { + name: getattr(module, name) + for name in dir(module) + if not name.startswith("_") + } + from PySide6 import QtGui, QtCore, QtSvg, QtWidgets, QtPrintSupport # Join QtGui and QtWidgets for Qt4 compatibility. QtGuiCompat = types.ModuleType("QtGuiCompat") QtGuiCompat.__dict__.update(QtGui.__dict__) - QtGuiCompat.__dict__.update(QtWidgets.__dict__) - QtGuiCompat.__dict__.update(QtPrintSupport.__dict__) + if QtCore.__version_info__ < (6, 7): + QtGuiCompat.__dict__.update(QtWidgets.__dict__) + QtGuiCompat.__dict__.update(QtPrintSupport.__dict__) + else: + QtGuiCompat.__dict__.update(get_attrs(QtWidgets)) + QtGuiCompat.__dict__.update(get_attrs(QtPrintSupport)) return QtCore, QtGuiCompat, QtSvg, QT_API_PYSIDE6 diff --git a/contrib/python/ipython/py3/IPython/utils/_sysinfo.py b/contrib/python/ipython/py3/IPython/utils/_sysinfo.py index 58edebdad2..304813b0f5 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 = "82690a067" +commit = "a9c7369d7" diff --git a/contrib/python/ipython/py3/IPython/utils/terminal.py b/contrib/python/ipython/py3/IPython/utils/terminal.py index b09cfe0d22..10d73fce58 100644 --- a/contrib/python/ipython/py3/IPython/utils/terminal.py +++ b/contrib/python/ipython/py3/IPython/utils/terminal.py @@ -80,7 +80,13 @@ def _set_term_title_xterm(title): def _restore_term_title_xterm(): # Make sure the restore has at least one accompanying set. global _xterm_term_title_saved - assert _xterm_term_title_saved + if not _xterm_term_title_saved: + warnings.warn( + "Expecting xterm_term_title_saved to be True, but is not; will not restore terminal title.", + stacklevel=1, + ) + return + sys.stdout.write('\033[23;0t') _xterm_term_title_saved = False diff --git a/contrib/python/ipython/py3/patches/03-dissable-backgroud-highlighting.patch b/contrib/python/ipython/py3/patches/03-dissable-backgroud-highlighting.patch index 73b189b863..4694b5b2e8 100644 --- a/contrib/python/ipython/py3/patches/03-dissable-backgroud-highlighting.patch +++ b/contrib/python/ipython/py3/patches/03-dissable-backgroud-highlighting.patch @@ -1,5 +1,5 @@ --- contrib/python/ipython/py3/IPython/core/ultratb.py (index) +++ contrib/python/ipython/py3/IPython/core/ultratb.py (working tree) @@ -613,1 +613,1 @@ class VerboseTB(TBTools): -- _tb_highlight = "bg:ansiyellow" -+ _tb_highlight = "" +- tb_highlight = "bg:ansiyellow" ++ tb_highlight = "" diff --git a/contrib/python/ipython/py3/ya.make b/contrib/python/ipython/py3/ya.make index ab2a7fb8f5..b13b8d1baa 100644 --- a/contrib/python/ipython/py3/ya.make +++ b/contrib/python/ipython/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(8.27.0) +VERSION(8.28.0) LICENSE(BSD-3-Clause) |