diff options
author | robot-piglet <[email protected]> | 2025-05-01 00:00:40 +0300 |
---|---|---|
committer | robot-piglet <[email protected]> | 2025-05-01 00:11:29 +0300 |
commit | 0764e86815875f548fecbfe1e23e12655ab05c8a (patch) | |
tree | 42b3e0884639fccb7010a17776b86de5b0ea7940 /contrib | |
parent | cbdd1443ec0c6e62ead9f16d79a0b4d9494bc7fe (diff) |
Intermediate changes
commit_hash:b4e93de24dabfc523769bc504619e926eee6cafe
Diffstat (limited to 'contrib')
7 files changed, 23 insertions, 19 deletions
diff --git a/contrib/python/prompt-toolkit/py3/.dist-info/METADATA b/contrib/python/prompt-toolkit/py3/.dist-info/METADATA index 8d4f5d343d2..265fb8183bd 100644 --- a/contrib/python/prompt-toolkit/py3/.dist-info/METADATA +++ b/contrib/python/prompt-toolkit/py3/.dist-info/METADATA @@ -1,8 +1,7 @@ -Metadata-Version: 2.2 +Metadata-Version: 2.4 Name: prompt_toolkit -Version: 3.0.50 +Version: 3.0.51 Summary: Library for building powerful interactive command lines in Python -Home-page: https://github.com/prompt-toolkit/python-prompt-toolkit Author: Jonathan Slenders Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers @@ -18,19 +17,12 @@ Classifier: Programming Language :: Python :: 3.13 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python Classifier: Topic :: Software Development -Requires-Python: >=3.8.0 +Requires-Python: >=3.8 Description-Content-Type: text/x-rst License-File: LICENSE License-File: AUTHORS.rst Requires-Dist: wcwidth -Dynamic: author -Dynamic: classifier -Dynamic: description -Dynamic: description-content-type -Dynamic: home-page -Dynamic: requires-dist -Dynamic: requires-python -Dynamic: summary +Dynamic: license-file Python Prompt Toolkit ===================== diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/__init__.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/__init__.py index 94727e7cb22..ebaa57dc81b 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/__init__.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/__init__.py @@ -17,6 +17,7 @@ Probably, to get started, you might also want to have a look at from __future__ import annotations import re +from importlib import metadata # note: this is a bit more lax than the actual pep 440 to allow for a/b/rc/dev without a number pep440 = re.compile( @@ -28,7 +29,7 @@ from .formatted_text import ANSI, HTML from .shortcuts import PromptSession, print_formatted_text, prompt # Don't forget to update in `docs/conf.py`! -__version__ = "3.0.50" +__version__ = metadata.version("prompt_toolkit") assert pep440.match(__version__) diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/completion/nested.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/completion/nested.py index 8569bd2cff7..b72b69ee212 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/completion/nested.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/completion/nested.py @@ -69,7 +69,7 @@ class NestedCompleter(Completer): elif isinstance(value, dict): options[key] = cls.from_nested_dict(value) elif isinstance(value, set): - options[key] = cls.from_nested_dict({item: None for item in value}) + options[key] = cls.from_nested_dict(dict.fromkeys(value)) else: assert value is None options[key] = None diff --git a/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py b/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py index 43228c3cda1..a6f78cb4e06 100644 --- a/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py +++ b/contrib/python/prompt-toolkit/py3/prompt_toolkit/formatted_text/utils.py @@ -89,8 +89,7 @@ def split_lines( parts = string.split("\n") for part in parts[:-1]: - if part: - line.append(cast(OneStyleAndTextTuple, (style, part, *mouse_handler))) + line.append(cast(OneStyleAndTextTuple, (style, part, *mouse_handler))) yield line line = [] diff --git a/contrib/python/prompt-toolkit/py3/tests/test_filter.py b/contrib/python/prompt-toolkit/py3/tests/test_filter.py index f7184c286f2..70ddd5cdf59 100644 --- a/contrib/python/prompt-toolkit/py3/tests/test_filter.py +++ b/contrib/python/prompt-toolkit/py3/tests/test_filter.py @@ -16,7 +16,7 @@ def test_always(): def test_invert(): assert not (~Always())() - assert ~Never()() + assert (~Never())() c = ~Condition(lambda: False) assert c() diff --git a/contrib/python/prompt-toolkit/py3/tests/test_formatted_text.py b/contrib/python/prompt-toolkit/py3/tests/test_formatted_text.py index 843aac16191..60f9cdf459b 100644 --- a/contrib/python/prompt-toolkit/py3/tests/test_formatted_text.py +++ b/contrib/python/prompt-toolkit/py3/tests/test_formatted_text.py @@ -274,7 +274,7 @@ def test_split_lines_3(): lines = list(split_lines([("class:a", "\n")])) assert lines == [ - [], + [("class:a", "")], [("class:a", "")], ] @@ -284,3 +284,15 @@ def test_split_lines_3(): assert lines == [ [("class:a", "")], ] + + +def test_split_lines_4(): + "Edge cases: inputs starting and ending with newlines." + # -1- + lines = list(split_lines([("class:a", "\nline1\n")])) + + assert lines == [ + [("class:a", "")], + [("class:a", "line1")], + [("class:a", "")], + ] diff --git a/contrib/python/prompt-toolkit/py3/ya.make b/contrib/python/prompt-toolkit/py3/ya.make index 5eed9c2519b..fd9a72b9e6e 100644 --- a/contrib/python/prompt-toolkit/py3/ya.make +++ b/contrib/python/prompt-toolkit/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(3.0.50) +VERSION(3.0.51) LICENSE(BSD-3-Clause) |