Skip to content

Commit 0969183

Browse files
committed
Intermediate changes
commit_hash:2d9a1d3a3501b70a635f24b69a195c83059b71da
1 parent 68f2bcc commit 0969183

File tree

11 files changed

+78
-20
lines changed

11 files changed

+78
-20
lines changed

contrib/python/ipython/py3/.dist-info/METADATA

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Metadata-Version: 2.1
22
Name: ipython
3-
Version: 8.27.0
3+
Version: 8.28.0
44
Summary: IPython: Productive Interactive Computing
55
Author: The IPython Development Team
66
Author-email: ipython-dev@python.org

contrib/python/ipython/py3/IPython/core/debugger.py

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,35 @@
1414
- hide frames in tracebacks based on `__tracebackhide__`
1515
- allows to skip frames based on `__debuggerskip__`
1616
17+
18+
Global Configuration
19+
--------------------
20+
21+
The IPython debugger will by read the global ``~/.pdbrc`` file.
22+
That is to say you can list all comands supported by ipdb in your `~/.pdbrc`
23+
configuration file, to globally configure pdb.
24+
25+
Example::
26+
27+
# ~/.pdbrc
28+
skip_predicates debuggerskip false
29+
skip_hidden false
30+
context 25
31+
32+
Features
33+
--------
34+
35+
The IPython debugger can hide and skip frames when printing or moving through
36+
the stack. This can have a performance impact, so can be configures.
37+
1738
The skipping and hiding frames are configurable via the `skip_predicates`
1839
command.
1940
2041
By default, frames from readonly files will be hidden, frames containing
21-
``__tracebackhide__=True`` will be hidden.
42+
``__tracebackhide__ = True`` will be hidden.
2243
23-
Frames containing ``__debuggerskip__`` will be stepped over, frames who's parent
24-
frames value of ``__debuggerskip__`` is ``True`` will be skipped.
44+
Frames containing ``__debuggerskip__`` will be stepped over, frames whose parent
45+
frames value of ``__debuggerskip__`` is ``True`` will also be skipped.
2546
2647
>>> def helpers_helper():
2748
... pass
@@ -1070,7 +1091,9 @@ def do_context(self, context):
10701091
raise ValueError()
10711092
self.context = new_context
10721093
except ValueError:
1073-
self.error("The 'context' command requires a positive integer argument.")
1094+
self.error(
1095+
f"The 'context' command requires a positive integer argument (current value {self.context})."
1096+
)
10741097

10751098

10761099
class InterruptiblePdb(Pdb):

contrib/python/ipython/py3/IPython/core/display.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,11 @@
4141

4242
def __getattr__(name):
4343
if name in _deprecated_names:
44-
warn(f"Importing {name} from IPython.core.display is deprecated since IPython 7.14, please import from IPython display", DeprecationWarning, stacklevel=2)
44+
warn(
45+
f"Importing {name} from IPython.core.display is deprecated since IPython 7.14, please import from IPython.display",
46+
DeprecationWarning,
47+
stacklevel=2,
48+
)
4549
return getattr(display_functions, name)
4650

4751
if name in globals().keys():

contrib/python/ipython/py3/IPython/core/magics/packaging.py

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#-----------------------------------------------------------------------------
1010

1111
import functools
12+
import os
1213
import re
1314
import shlex
1415
import sys
@@ -41,17 +42,29 @@ def _get_conda_like_executable(command):
4142
executable: string
4243
Value should be: conda, mamba or micromamba
4344
"""
45+
# Check for a environment variable bound to the base executable, both conda and mamba
46+
# set these when activating an environment.
47+
base_executable = "CONDA_EXE"
48+
if "mamba" in command.lower():
49+
base_executable = "MAMBA_EXE"
50+
if base_executable in os.environ:
51+
executable = Path(os.environ[base_executable])
52+
if executable.is_file():
53+
return str(executable.resolve())
54+
4455
# Check if there is a conda executable in the same directory as the Python executable.
4556
# This is the case within conda's root environment.
4657
executable = Path(sys.executable).parent / command
4758
if executable.is_file():
4859
return str(executable)
4960

5061
# Otherwise, attempt to extract the executable from conda history.
51-
# This applies in any conda environment.
62+
# This applies in any conda environment. Parsing this way is error prone because
63+
# different versions of conda and mamba include differing cmd values such as
64+
# `conda`, `conda-script.py`, or `path/to/conda`, here use the raw command provided.
5265
history = Path(sys.prefix, "conda-meta", "history").read_text(encoding="utf-8")
5366
match = re.search(
54-
rf"^#\s*cmd:\s*(?P<command>.*{executable})\s[create|install]",
67+
rf"^#\s*cmd:\s*(?P<command>.*{command})\s[create|install]",
5568
history,
5669
flags=re.MULTILINE,
5770
)

contrib/python/ipython/py3/IPython/core/release.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# release. 'dev' as a _version_extra string means this is a development
1717
# version
1818
_version_major = 8
19-
_version_minor = 27
19+
_version_minor = 28
2020
_version_patch = 0
2121
_version_extra = ".dev"
2222
# _version_extra = "rc1"

contrib/python/ipython/py3/IPython/core/ultratb.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -830,8 +830,8 @@ class VerboseTB(TBTools):
830830
traceback, to be used with alternate interpreters (because their own code
831831
would appear in the traceback)."""
832832

833-
_tb_highlight = ""
834-
_tb_highlight_style = "default"
833+
tb_highlight = ""
834+
tb_highlight_style = "default"
835835

836836
def __init__(
837837
self,
@@ -1133,8 +1133,8 @@ def get_records(
11331133
after = context // 2
11341134
before = context - after
11351135
if self.has_colors:
1136-
style = get_style_by_name(self._tb_highlight_style)
1137-
style = stack_data.style_with_executing_node(style, self._tb_highlight)
1136+
style = get_style_by_name(self.tb_highlight_style)
1137+
style = stack_data.style_with_executing_node(style, self.tb_highlight)
11381138
formatter = Terminal256Formatter(style=style)
11391139
else:
11401140
formatter = None

contrib/python/ipython/py3/IPython/external/qt_loaders.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -302,13 +302,25 @@ def import_pyside6():
302302
303303
ImportErrors raised within this function are non-recoverable
304304
"""
305+
306+
def get_attrs(module):
307+
return {
308+
name: getattr(module, name)
309+
for name in dir(module)
310+
if not name.startswith("_")
311+
}
312+
305313
from PySide6 import QtGui, QtCore, QtSvg, QtWidgets, QtPrintSupport
306314

307315
# Join QtGui and QtWidgets for Qt4 compatibility.
308316
QtGuiCompat = types.ModuleType("QtGuiCompat")
309317
QtGuiCompat.__dict__.update(QtGui.__dict__)
310-
QtGuiCompat.__dict__.update(QtWidgets.__dict__)
311-
QtGuiCompat.__dict__.update(QtPrintSupport.__dict__)
318+
if QtCore.__version_info__ < (6, 7):
319+
QtGuiCompat.__dict__.update(QtWidgets.__dict__)
320+
QtGuiCompat.__dict__.update(QtPrintSupport.__dict__)
321+
else:
322+
QtGuiCompat.__dict__.update(get_attrs(QtWidgets))
323+
QtGuiCompat.__dict__.update(get_attrs(QtPrintSupport))
312324

313325
return QtCore, QtGuiCompat, QtSvg, QT_API_PYSIDE6
314326

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# GENERATED BY setup.py
2-
commit = "82690a067"
2+
commit = "a9c7369d7"

contrib/python/ipython/py3/IPython/utils/terminal.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ def _set_term_title_xterm(title):
8080
def _restore_term_title_xterm():
8181
# Make sure the restore has at least one accompanying set.
8282
global _xterm_term_title_saved
83-
assert _xterm_term_title_saved
83+
if not _xterm_term_title_saved:
84+
warnings.warn(
85+
"Expecting xterm_term_title_saved to be True, but is not; will not restore terminal title.",
86+
stacklevel=1,
87+
)
88+
return
89+
8490
sys.stdout.write('\033[23;0t')
8591
_xterm_term_title_saved = False
8692

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--- contrib/python/ipython/py3/IPython/core/ultratb.py (index)
22
+++ contrib/python/ipython/py3/IPython/core/ultratb.py (working tree)
33
@@ -613,1 +613,1 @@ class VerboseTB(TBTools):
4-
- _tb_highlight = "bg:ansiyellow"
5-
+ _tb_highlight = ""
4+
- tb_highlight = "bg:ansiyellow"
5+
+ tb_highlight = ""

0 commit comments

Comments
 (0)