Skip to content

Update prompt-toolkit to 3.0.52#739

Open
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-prompt-toolkit-2.0.9-to-3.0.52
Open

Update prompt-toolkit to 3.0.52#739
pyup-bot wants to merge 1 commit intomasterfrom
pyup-update-prompt-toolkit-2.0.9-to-3.0.52

Conversation

@pyup-bot
Copy link
Collaborator

This PR updates prompt-toolkit from 2.0.9 to 3.0.52.

Changelog

3.0.52

------------------

New features:
- Add `choice()` shortcut for selecting an option amongst a list of choices
(see documentation for examples).
- Add support for ANSI dim text formatting.
- Add `frame=...` option for `prompt()` and `choice()` shortcuts to allow for
displaying a frame around the input prompt.

Fixes:
- Fix button width when non English characters are displayed.
- Implement flushing in Windows VT100 input.
- Fix signal handling for GraalPy.
- Fix handling of zero sized dimensions.

3.0.51

------------------

New features:
- Use pyproject.toml instead of setup.py.

Fixes:
- Fix edge case in `formatted_text.split_lines` when the input starts with a
line ending.

3.0.50

------------------

Fixes:
- Fixes non user impacting regression on the output rendering. Don't render
cursor hide/show ANSI escape codes if not needed.

3.0.49

------------------

New features:
- On Windows, use virtual terminal input when available.
- Support for multiline suggestions.

Fixes:
- Handle `InvalidStateError` during termination when using
`run_in_terminal`/`patch_stdout`. This can happen in some cases during
cancellation, probably when using anyio.
- Fix cursor that remains in hidden state when the application exits. This can
happen when the application doesn't show the cursor and `erase_when_done` is
being used.

Breaking changes:
- Drop support for Python 3.7:

3.0.48

------------------

Fixes:
- Typing improvements:
* Add `overload` to `contrib.regular_languages.compiler.Variables.get`.
* Use `Sequence` instead of `list` for `words` argument in completers.
- Improve `ModalCursorShapeConfig`:
* Display an "underscore" cursor in Vi's "replace single" mode, like
 "replace" mode.
* Display an "beam" cursor in Emacs (insert) mode.

3.0.47

------------------

New features:
- Allow passing exception classes for `KeyboardInterrupt` and `EOFError` in
`PromptSession`.

Fixes:
- Compute padding parameters for `Box` widget lazily.

3.0.46

------------------

Fixes:
- Fix pytest capsys fixture compatibility.

3.0.45

------------------

Fixes:
- Improve performance of `GrammarCompleter` (faster deduplication of completions).

3.0.44

------------------

New features:
- Accept `os.PathLike` in `FileHistory` (typing fix).

Fixes:
- Fix memory leak in filters.
- Improve performance of progress bar formatters.
- Fix compatibility when a SIGINT handler is installed by non-Python (Rust, C).
- Limit number of completions in buffer to 10k by default (for performance).

3.0.43

------------------

Fixes:
- Fix regression on Pypy: Don't use `ctypes.pythonapi` to restore SIGINT if not
available.

3.0.42

------------------

Fixes:
- Fix line wrapping in `patch_stdout` on Windows.
- Make `formatted_text.split_lines()` accept an iterable instead of lists only.
- Disable the IPython workaround (from 3.0.41) for IPython >= 8.18.
- Restore signal.SIGINT handler between prompts.

3.0.41

------------------

Fixes:
- Fix regression regarding IPython input hook (%gui) integration.

3.0.40

------------------

Fixes:
- Improved Python 3.12 support (fixes event loop `DeprecationWarning`).

New features:
- Vi key bindings: `control-t` and `control-d` for indent/unindent in insert
mode.
- Insert partial suggestion when `control+right` is pressed, similar to Fish.
- Use sphinx-nefertiti theme for the docs.

3.0.39

------------------

Fixes:
- Fix `RuntimeError` when `__breakpointhook__` is called from another thread.
- Fix memory leak in filters usage.
- Ensure that key bindings are handled in the right context (when using
contextvars).

New features:
- Accept `in_thread` keyword in `prompt_toolkit.shortcuts.prompt()`.
- Support the `NO_COLOR` environment variable.

3.0.38

------------------

Fixes:
- Fix regression in filters. (Use of `WeakValueDictionary` caused filters to
not be cached).

New features:
- Use 24-bit true color now by default on Windows 10/11.

3.0.37

------------------

Bug fixes:
- Fix `currentThread()` deprecation warning.
- Fix memory leak in filters.
- Make VERSION tuple numeric.

New features:
- Add `.run()` method in `TelnetServer`. (To be used instead of
`.start()/.stop()`.

Breaking changes:
- Subclasses of `Filter` have to call `super()` in their `__init__`.
- Drop support for Python 3.6:
* This includes code cleanup for Python 3.6 compatibility.
* Use `get_running_loop()` instead of `get_event_loop()`.
* Use `asyncio.run()` instead of `asyncio.run_until_complete()`.

3.0.36

------------------

Fixes:
- Another Python 3.6 fix for a bug that was introduced in 3.0.34.

3.0.35

------------------

Fixes:
- Fix bug introduced in 3.0.34 for Python 3.6. Use asynccontextmanager
implementation from prompt_toolkit itself.

3.0.34

------------------

Fixes:
- Improve completion performance in various places.
- Improve renderer performance.
- Handle `KeyboardInterrupt` when the stacktrace of an unhandled error is
displayed.
- Use correct event loop in `Application.create_background_task()`.
- Fix `show_cursor` attribute in `ScrollablePane`.

3.0.33

------------------

Fixes:
- Improve termination of `Application`. Don't suppress `CancelledError`. This
fixes a race condition when an `Application` gets cancelled while we're
waiting for the background tasks to complete.
- Fixed typehint for `OneStyleAndTextTuple`.
- Small bugfix in `CombinedRegistry`. Fixed missing `property`.

3.0.32

------------------

Bug fixes:
- Use `DummyInput` by default in `create_input()` if `sys.stdin` does not have
a valid file descriptor. This fixes errors when `sys.stdin` is patched in
certain situations.
- Fix control-c key binding for `ProgressBar` when the progress bar was not
created from the main thread. The current code would try to kill the main
thread when control-c was pressed.

New features:
- Accept a `cancel_callback` in `ProgressBar` to specify the cancellation
behavior for when `control-c` is pressed.
- Small performance improvement in the renderer.

3.0.31

------------------

Fixes:
- Add `patch_stdout_raw` parameter to `embed()`.
- Fix repl.min_brightness and repl.max_brightness config in history.
- Fix positioning of exit confirmation (compatibilitiy with latest prompt_toolkit).

3.0.30

------------------

New features:
- Show exception cause/context when printing chained exceptions.
- Reworked project layout and use pyproject.toml instead of setup.py.

Breaking changes:
- Drop Python 3.7 support.

3.0.29

------------------

Fixes:
- Further improve performance of dictionary completions.

3.0.28

------------------

New features:
- Custom 'exit' function to return from REPL that
* doesn't terminate `sys.stdin` when `exit` is called (important for
 `embed()`).
* doesn't require to be called with parentheses.

Fixes:
- Clean up signatures on control-c.

3.0.27

------------------

- Limit number of completions to 5k (for performance).
- Several typing fixes.

3.0.26

------------------

Fixes:
- Handle `GeneratorExit` exception when leaving the paginator.

3.0.25

------------------

Fixes:
- Fix handling of 'config file does not exist' when embedding ptpython.

3.0.24

------------------

Fixes:
- Don't show "Impossible to read config file" warnings when no config file was
passed to `run_config()`.
- IPython integration fixes:
* Fix top-level await in IPython.
* Fix IPython `DeprecationWarning`.
- Output printing fixes:
* Paginate exceptions if pagination is enabled.
* Handle big outputs without running out of memory.
- Asyncio REPL improvements:
* From now on, passing `--asyncio` is required to activate the asyncio-REPL.
 This will ensure that an event loop is created at the start in which we can
 run top-level await statements.
* Use `get_running_loop()` instead of `get_event_loop()`.
* Better handling of `SystemExit` and control-c in the async REPL.

3.0.23

------------------

Fixes:
- Don't print exception messages twice for unhandled exceptions.
- Added cursor shape support.

Breaking changes:
- Drop Python 3.6 support.

3.0.22

------------------

New features:
- Improve rendering performance when there are many completions.

3.0.21

------------------

New features:
- Make ptipython respect more config changes.
(See: https://github.com/prompt-toolkit/ptpython/pull/110 )
- Improved performance of `DictionaryCompleter` for slow mappings.

Fixes:
- Call `super()` in `PythonInputFilter`. This will prevent potentially breakage
with an upcoming prompt_toolkit change.
(See: https://github.com/prompt-toolkit/python-prompt-toolkit/pull/1690 )
- Improved type annotations.
- Added `py.typed` to the `package_data`.

3.0.20

------------------

New features:
- For `DictionaryCompleter`: show parentheses after methods.

Fixes:
- Don't crash when trying to complete broken mappings in `DictionaryCompleter`.
- Don't crash when an older version of `black` is installed that is not
compatible.

3.0.19

------------------

Fixes:
- Fix handling of `SystemExit` (fixes "ValueError: I/O operation on closed
file").
- Allow usage of `await` in assignment expressions or for-loops.

3.0.18

------------------

Fixes:
- Made "black" an optional dependency.

3.0.17

------------------

Fixes:
- Fix leaking file descriptors due to not closing the asyncio event loop after
reading input in a thread.
- Fix race condition during retrieval of signatures.

3.0.16

------------------

(Commit 7f619e was missing in previous release.)

Fixes:
- Several fixes to the completion code:
* Give dictionary completions priority over path completions.
* Always call non-fuzzy completer after fuzzy completer to prevent that some
 completions were missed out if the fuzzy completer doesn't find them.

3.0.15

------------------

New features:
- When pressing control-w, only delete characters until a punctuation.

Fixes:
- Fix `AttributeError` during retrieval of signatures with type annotations.

3.0.14

------------------

New features:
- Display of signature and completion drop down together.
- If `DictionaryCompleter` is enabled, also retrieve signatures when Jedi
fails, using the same logic.
- List function parameters first and private attributes at the end in the
completion menu.
- Cleanup of the completion code.

Fixes:
- Handle exceptions raised when `repr()` is called.
- Fix leakage of `exc_info` from eval to exec call.
- Fix handling of `KeyboardInterrupt` in REPL during evaluation of `__repr__`.
- Fix style for signature toolbar.
- Hide signature when sidebar is visible.

3.0.13

------------------

New features:
- Added 'print all' option to pager.
- Improve handling of indented code:
* Allow multiline input to be indented as a whole (we will unindent before
 executing).
* Correctly visualize tabs (instead of ^I, which happens when pasted in
 bracketed paste).

Fixes:
- Fix line ending bug in pager.

3.0.12

------------------

New features:
- Expose a `get_ptpython` function in the global namespace, to get programmatic
access to the REPL.
- Expose `embed()` at the top level of the package. Make it possible to do
`from ptpython import embed`.

Fixes:
- Properly handle exceptions when trying to access `__pt_repr__`.
- Properly handle `SystemExit`.

3.0.11

------------------

New features:
- Add support for top-level await.
- Refactoring of event loop usage:

* The ptpython input UI will now run in a separate thread. This makes it
 possible to properly embed ptpython in an asyncio application, without
 having to deal with nested event loops (which asyncio does not support).

* The "eval" part doesn't anymore take place within a ptpython coroutine, so
 it can spawn its own loop if needed. This also fixes `asyncio.run()` usage
 in the REPL, which was broken before.

- Added syntax highlighting and autocompletion for !-style system commands.

Fixes:
- Remove unexpected additional line after output.
- Fix system prompt. Accept !-style inputs again.
- Don't execute PYTHONSTARTUP when -i flag was given.

3.0.10

------------------

Fixes:
- Do dictionary completion on Sequence and Mapping objects (from
collections.abc). Note that dictionary completion is still turned off by
default.

3.0.9

-----------------

New features:
- Allow replacing `PythonInput.completer` at runtime (useful for tools build on
top of ptpython).
- Show REPL title in pager.

3.0.8

-----------------

New features:
- Optional output formatting using Black.
- Optional pager for displaying outputs that don't fit on the screen.
- Added --light-bg and --dark-bg flags to automatically optimize the brightness
of the colors according to the terminal background.
- Add `PTPYTHON_CONFIG_HOME` for explicitly setting the config directory.
- Show completion suffixes (like '(' for functions).

Fixes:
- Fix dictionary completion on Pandas objects.
- Stop using deprecated Jedi functions.

3.0.7

-----------------

New features:
- Option to show/hide private attributes during a completion
- Added `insert_blank_line_after_input` option similar to
`insert_blank_line_after_output`.

Fixes:
- Fixed some formatting issues of `__pt_repr__`.
- Abbreviate completion meta information for dictionary completer if needed.

3.0.6

-----------------

New features:
- (Experimental) support for `__pt_repr__` methods. If objects implement this
method, this will be used to print the result in the REPL instead of the
normal `__repr__`.
- Added py.typed file, to enable type checking for applications that are
embedding ptpython.

3.0.5

-----------------

Fixes:
- Handle bug in dictionary completion when numeric keys are used.

3.0.4

-----------------

New features:
- Allow leading whitespace before single line expressions.
- Show full syntax error in validator.
- Added `vi_start_in_navigation_mode` and `vi_keep_last_used_mode` options.

Fixes:
- Improved dictionary completion: handle keys that contain spaces and don't
recognize numbers as variable names.
- Fix in exit confirmation.

3.0.3

-----------------

Fixes:
- Sort attribute names for `DictionaryCompleter` and move underscored
attributes to the end.
- Handle unhandled exceptions in `get_compiler_flags`.
- Improved `run_async` code.
- Fix --version parameter.

3.0.2

-----------------

New features:
- Improved custom dictionary completion:
 * Also complete list indexes.
 * Also complete attributes after doing a dictionary lookup.
 * Also complete iterators in a for-loop.
- Added a 'title' option, so that applications embedding ptpython can set a
title in the status bar.

3.0.1

-----------------

- Fix backwards-compatibility of the `run_config` function. (used by
django-extensions).
- Fix input mode in status bar for block selection.

3.0.0

-----------------

Upgrade to prompt_toolkit 3.0.
Requires at least Python 3.6.

New features:
- Uses XDG base directory specification.
Links

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant