- 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
add a little detail to custom repr method docs (#13945)
These docs are a bit sparse, so I added a couple details that might help
implementers:
- explicitly state the return type, rather than only via example
- give some examples of PNG, HTML
- note that formatters shouldn't be sensitive to other formats
related to https://github.com/Textualize/rich/pull/2806 which didn't
follow the spec, in part I think because the docs weren't explicit
enough about exactly what a formatter should do.
FEAT: Fast TB.
Try to detect when one of the file we are trying to highlight is too
big, and fallback on pre-8.0 traceback code, that avoids stack_data.
You can configure the limit with:
>>> from IPython.core import ultratb
>>> ultratb.FAST_THRESHOLD = 200
We are trying to _guess_ whether the traceback we will render is in a
file that will require to parse more than FAST_THRESHOLD lines, though
it is actually difficult to get this value correctly, so in some case,
the slow path may be used, even if files are longer than FAST_THRESHOLD,
especially if the crashing code is at the beginning of the file.
Shaperilio/autoreload verbosity (#13774)
Worked on three things:
1. More descriptive parameter names for `%autoreload`; `now`, `off`,
`explicit`, `all`, `complete`. (This last one could probably use a
better name, but I couldn't think of anything better based on the
message in 1d3018a93e98ad55f41d4419f835b738de80e1b7)
2. New optional arguments for `%autoreload` allow displaying the names
of modules that are reloaded. Use `--print` or `-p` to use `print`
statements, or `--log` / `-l` to log at `INFO` level.
3. `%aimport` can parse whitelist/blacklist modules on the same line,
e.g. `%aimport os, -math` now works.
`%autoreload` and will also now raise a `ValueError` if the parameter is
invalid. I suppose a bit more verification could be done for input to
`%aimport`....
ENH: support for `PySide6` in `%gui` (#13864)
Addresses #13859
Changes here parallel the changes in
[ipykernel](https://github.com/ipython/ipykernel/pull/1054), i.e. prefer
`PyQt` over `PySide` and allow requesting explicit versions (e.g. 'qt5')
with one difference (see below).
I believe that, eventually, the Qt importing logic should be all here,
and `ipykernel` should defer to`ipython`. I chose not to do that at this
time since it would mean the latest `ipykernel` would require the latest
`IPython`; I'm happy to discuss further.
The only difference between `IPython` and `ipykernel`, after these two
pull requests, is that, in `IPython`, it's not possible to explicitly
request an event loop for Qt4. This is because an alias exists
[here](https://github.com/ipython/ipython/blob/5409de68d87ddd073a35111aca0cb8360ff63ca8/IPython/terminal/pt_inputhooks/__init__.py#L5)
which effectively makes "qt4" be "the latest Qt available". I did not
remove the alias because I don't know the history behind it.
add a little detail to custom repr method docs
- explicitly state the return type, rather than only via example
- give some examples of PNG, HTML
- note that formatters shouldn't be sensitive to other formats
Strip prefix in `attr_matches` result (#13943)
Fixes #13935
Reasoning behind implementation chosen:
- `a.b.c` prefix in `a.b.c.<tab>` needs to be preserved as otherwise the
completer will replace it with completion rather than appending (so we
cannot just use `.suffix`, we need to use `a.b.c.suffix` here)
- as in the issue we cannot use `a b.suffix` but need to use `b.suffix`
or `.suffix`
- `d['a b']` prefix cannot be split using space splitting so we need to
tokenize
- however, we can do either `a[0].suffix` or `.suffix`
Don't emit a trailng newline in base64-encoded data like 'image/png' (#13941)
This addresses the issue highlighted in
https://github.com/jupyter/jupyter_client/issues/930
Since, unlike the latest Jupyter, IPython aims to support python<3.6,
I'm using an approach that won't break this compatibility.
Quote jedi in type hint (#13944)
This just quotes the used of `jedi` in a type hint, so that it can
import without jedi being installed (or rather, removed, patched, or
otherwise made incomplete).
Allow to customise shortcuts using a traitlet (#13928)
This is a refactor of keybindings code aiming to enable users to modify,
disable, and add new shortcuts.
Closes #13878, relates to #13879.
## Code changes
- The filters are no longer defined as Python condition expression but
as strings. This ensures that all shortcuts that we define can be
unambiguously overridden by users from JSON config files.
- All filters were moved to a new `filters.py` module
- All commands previously defined in closure of
`create_ipython_shortcuts(shell)` were moved to globals (which ensures
nice identifier names and makes unit-testing easier)
- All bindings are now collected in `KEY_BINDINGS` global variable; in
future one could consider further splitting them up and moving bindings
definition to respective modules (e.g. `AUTO_MATCH_BINDINGS` to
`auto_match.py`).
## User-facing changes
- New configuration traitlet: `c.TerminalInteractiveShell.shortcuts`
- Accept single character in autosuggestion shortcut now uses
<kbd>alt</kbd> + <kbd>right</kbd> instead of <kbd>right</kbd> (which is
accepting the entire suggestion as in versions 8.8 and before).
After a few iterations I arrived to a specification that separates the
existing key/filter from the new key/filter and has a separate "create"
flag used to indicate that a new shortcut should be created (rather than
modifying an existing one):
> Each entry on the list should be a dictionary with ``command`` key
identifying the target function executed by the shortcut and at least
one of the following:
> - `match_keys`: list of keys used to match an existing shortcut,
> - `match_filter`: shortcut filter used to match an existing shortcut,
> - `new_keys`: list of keys to set,
> - `new_filter`: a new shortcut filter to set
>
> The filters have to be composed of pre-defined verbs and joined by one
of the following conjunctions: `&` (and), `|` (or), `~` (not). The
pre-defined verbs are: .....
>
> To disable a shortcut set `new_keys` to an empty list.
To add a shortcut add key `create` with value `True`. When
modifying/disabling shortcuts, `match_keys`/`match_filter` can
be omitted if the provided specification uniquely identifies a shortcut
to be overridden/disabled.
>
> When modifying a shortcut `new_filter` or `new_keys` can be omitted
which will result in reuse of the existing filter/keys.
>
> Only shortcuts defined in IPython (and not default prompt toolkit
shortcuts) can be modified or disabled.