From f25a001de9ff1ee3034498b0941d6083c4b93272 Mon Sep 17 00:00:00 2001 From: Tom Bocklisch Date: Thu, 28 Aug 2025 18:29:08 +0200 Subject: [PATCH 1/2] incremented version --- docs/pages/changelog.rst | 6 ++++++ pyproject.toml | 2 +- questionary/version.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/pages/changelog.rst b/docs/pages/changelog.rst index 3296309b..814b4101 100644 --- a/docs/pages/changelog.rst +++ b/docs/pages/changelog.rst @@ -4,6 +4,12 @@ Changelog ********* +2.1.1 (2025-08-28) +################### + +* Fixed compatibility with ``prompt_toolkit`` 3.0.52. Previously that version raised ability + ``AttributeError: 'VSplit' object has no attribute 'content'`` error. + 2.1.0 (2024-12-29) ################### diff --git a/pyproject.toml b/pyproject.toml index 91fe6b3a..948d1ca1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,7 +15,7 @@ warn_unused_ignores = true [tool.poetry] name = "questionary" -version = "2.1.0" +version = "2.1.1" description = "Python library to build pretty command line user prompts ⭐️" authors = [ "Tom Bocklisch ",] maintainers = [ "Tom Bocklisch ", "Kian Cross "] diff --git a/questionary/version.py b/questionary/version.py index 9aa3f903..58039f50 100644 --- a/questionary/version.py +++ b/questionary/version.py @@ -1 +1 @@ -__version__ = "2.1.0" +__version__ = "2.1.1" From e414c9132ff526658316eda8ca7e966cd9b74262 Mon Sep 17 00:00:00 2001 From: JunchengXue <97111055+JunchengXue@users.noreply.github.com> Date: Wed, 26 Nov 2025 13:59:00 +0800 Subject: [PATCH 2/2] feat(): allow specific the initial_choice --- questionary/prompts/select.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/questionary/prompts/select.py b/questionary/prompts/select.py index e41dbe56..b22f7688 100644 --- a/questionary/prompts/select.py +++ b/questionary/prompts/select.py @@ -39,6 +39,7 @@ def select( show_selected: bool = False, show_description: bool = True, instruction: Optional[str] = None, + initial_choice: Optional[str] = None, **kwargs: Any, ) -> Question: """A list of items to select **one** option from. @@ -162,6 +163,11 @@ def select( merged_style = merge_styles_default([style]) + if initial_choice is not None: + ic_initial_choice = initial_choice + else: + ic_initial_choice = default + ic = InquirerControl( choices, default, @@ -171,7 +177,7 @@ def select( show_selected=show_selected, show_description=show_description, use_arrow_keys=use_arrow_keys, - initial_choice=default, + initial_choice=ic_initial_choice, ) def get_prompt_tokens():