- Use '/' key to quickly access this field.
- Enter a name of repository, or repository group for quick search.
- Prefix query to allow special search:
user:admin, to search for usernames, always global
user_group:devops, to search for user groups, always global
pr:303, to search for pull request number, title, or description, always global
commit:efced4, to search for commits, scoped to repositories or groups
file:models.py, to search for file paths, scoped to repositories or groups
For advanced full text search visit: repository search
Use environment variable to identify conda / mamba
Conda and mamba both set an environment variable which refers to the
base environment's executable path, use that in preference to less
reliable methods, but fall back on the other approaches if unable to
locate the executable this way.
Additionally, change the search to look for the bare command name rather
than the command within the top level of the active environment, I'm
dubious this approach works with any current conda / mamba version which
usually place their executable links in a `condabin` directory or
elsewhere not at the same level as the Python executable.
Fix use of pyside6 >= 6.7.0 (#14510)
Fixes #14463.
Using `pyside6 >= 6.7.0` as the `qt6` gui loop gives the following
error:
```
In [1]: %gui qt6
In [2]: Traceback (most recent call last):
File "/Users/iant/micromamba/envs/temp/bin/ipython", line 8, in <module>
sys.exit(start_ipython())
^^^^^^^^^^^^^^^
File "/Users/iant/github/ipython/IPython/__init__.py", line 130, in start_ipython
return launch_new_instance(argv=argv, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/iant/micromamba/envs/temp/lib/python3.12/site-packages/traitlets/config/application.py", line 1075, in launch_instance
app.start()
File "/Users/iant/github/ipython/IPython/terminal/ipapp.py", line 317, in start
self.shell.mainloop()
File "/Users/iant/github/ipython/IPython/terminal/interactiveshell.py", line 917, in mainloop
self.interact()
File "/Users/iant/github/ipython/IPython/terminal/interactiveshell.py", line 902, in interact
code = self.prompt_for_code()
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/iant/github/ipython/IPython/terminal/interactiveshell.py", line 845, in prompt_for_code
text = self.pt_app.prompt(
^^^^^^^^^^^^^^^^^^^
File "/Users/iant/micromamba/envs/temp/lib/python3.12/site-packages/prompt_toolkit/shortcuts/prompt.py", line 1035, in prompt
return self.app.run(
^^^^^^^^^^^^^
File "/Users/iant/micromamba/envs/temp/lib/python3.12/site-packages/prompt_toolkit/application/application.py", line 978, in run
result = loop.run_until_complete(coro)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/iant/micromamba/envs/temp/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
self.run_forever()
File "/Users/iant/micromamba/envs/temp/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
self._run_once()
File "/Users/iant/micromamba/envs/temp/lib/python3.12/asyncio/base_events.py", line 1948, in _run_once
event_list = self._selector.select(timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/Users/iant/micromamba/envs/temp/lib/python3.12/site-packages/prompt_toolkit/eventloop/inputhook.py", line 150, in select
self.inputhook(InputHookContext(self._r, input_is_ready))
File "/Users/iant/github/ipython/IPython/terminal/pt_inputhooks/qt.py", line 50, in inputhook
_appref = app = QtGui.QApplication([" "])
^^^^^^^^^^^^^^^^^^
AttributeError: module 'PySide6.QtPrintSupport' has no attribute 'QApplication'
If you suspect this is an IPython 8.28.0.dev bug, please report it at:
https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org
You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.
Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
%config Application.verbose_crash=True
```
This is because we use the imported module's `__dict__` to get the
classes and functions available in the module here:
https://github.com/ipython/ipython/blob/9b8cd4a397e5894ffeadad52477bb53e0fb664fc/IPython/external/qt_loaders.py#L309-L311
This no longer works as not all the classes and functions are in the
`__dict__`. The solution in this PR is to use `dir(module)` instead.
I have tested this locally using `pyside6` 6.6.3.1, 6.7.0, 6.7.1 and
6.7.2 and it works for me. It also successfully creates Matplotlib plots
using for example
```
In [1]: %matplotlib qt6
In [2]: import matplotlib.pyplot as plt
In [3]: plt.plot([1,3,2])
```
It would be good to get independent confirmation that this fixes other
downstream libraries as I tend to work directly with IPython and
IPyKernel.
`AssertionError`: `assert _xterm_term_title_saved` in WSL (#14480)
`AssertionError`: `assert _xterm_term_title_saved`
In some (unknown) situation, it is possible that the
`_xterm_term_title_saved` is unset,
but the code would make a call to `_restore_term_title_xterm`, resulting
in `AssertionError`.
At least on replicatable reproduction is
returning from `ipython` to `pudb` via `^D^D` on an empty cell.
See more details in https://github.com/ipython/ipython/pull/14480
Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
<details>
<summary><em>was:</em></summary>
In some (unknown) situation, it is possible that the
`_xterm_term_title_saved` is unset, but the code would make a call to
`_restore_term_title_xterm`, resulting in `AssertionError`.
As title stacking does not seem to be getting traction
(https://github.com/microsoft/terminal/issues/14575), do not set the
`xterm` variants of `_set_term_title` / `_restore_term_title`.
WSL detection: https://superuser.com/a/1749811/533196
Additionally, almost-`black` the file.
</details>
`AssertionError`: `assert _xterm_term_title_saved`
In some (unknown) situation, it is possible that the `_xterm_term_title_saved` is unset,
but the code would make a call to `_restore_term_title_xterm`, resulting in `AssertionError`.
At least on replicatable reproduction is
returning from `ipython` to `pudb` via `^D^D` on an empty cell.
See more details in https://github.com/ipython/ipython/pull/14480
Signed-off-by: Stavros Ntentos <133706+stdedos@users.noreply.github.com>
Don't force matplotlib backend names to be lowercase (#14475)
This is something I missed as part of moving the backend resolution to
Matplotlib. Since version 3.9.0 Matplotlib handles the case-sensitivity
of backend names, making them all lowercase for internal use. But since
matplotlib/matplotlib#28473 uppercase letters are allowed in backend
names of the form `module://soMe_moDule.sOmE_NAme`. Hence we need to not
force backend names to be lowercase in IPython when passing them to
Matplotlib. It is just a one line change that happens to make the code
simpler, plus a new test.
The Matplotlib change will be released in 3.9.1 which is due shortly,
possibly today. The new test checks the Matplotlib version to know
whether uppercase backend module names are allowed or not.
Fix showing SystemExit exception raise inside except handler (#14503)
Doing something like this:
```python
try:
5 / 0
except Exception as e:
raise SystemExit
```
was hitting an error inside UltraTB, creating a long traceback of its
internals (which, ironically, UltraTB itself then displays correctly
:-).
`ListTB.get_exception_only()` calls the `ListTB.structured_traceback()`
method *specifically* - even if `self` is a subclass, it won't use the
subclass's method. However, the exception chaining in that method uses
recursion by calling `self.structured_traceback()`, which will use a
subclass's method. Tuples were added as an option there to support
exception chaining, but not all of the machinery in connected classes
expects a tuple.
This just skips the exception chaining logic for the `etb=None` case,
when we're showing the exception only. I'm not sure this is necessarily
the best fix, but I didn't want to spend too much time following code
around a module that's old enough to vote.
Closes #12104
Fix some tests on Python 3.13 RC1 (#14504)
Random little odds and ends that have changed in 3.13 break the tests. I
think this should get the CI working again. :crossed_fingers:
Closes #14457
Closes #14458