Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): Bump prompt-toolkit from 2.0.10 to 3.0.50 #3526

Merged
merged 6 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions acapy_agent/config/ledger.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import markdown
import prompt_toolkit
from prompt_toolkit.eventloop.defaults import use_asyncio_event_loop
from prompt_toolkit.formatted_text import HTML
from uuid_utils import uuid4

Expand Down Expand Up @@ -211,9 +210,6 @@ async def select_aml_tty(taa_info, provision: bool = False) -> Optional[str]:
+ taa_html
)

# setup for prompt_toolkit
use_asyncio_event_loop()

prompt_toolkit.print_formatted_text(HTML(taa_html))

opts = []
Expand Down
13 changes: 3 additions & 10 deletions acapy_agent/config/tests/test_ledger.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from unittest import IsolatedAsyncioTestCase

import pytest
Expand Down Expand Up @@ -634,9 +635,8 @@ async def test_ledger_accept_taa_not_tty_not_accept_config(self, mock_stdout):
None, self.profile, taa_info, provision=False
)

@mock.patch("sys.stdout")
async def test_ledger_accept_taa_tty(self, mock_stdout):
mock_stdout.isatty = mock.MagicMock(return_value=True)
async def test_ledger_accept_taa_tty(self):
sys.stdout.isatty = mock.MagicMock(return_value=True)
self.profile = await create_test_profile()

taa_info = {
Expand All @@ -645,7 +645,6 @@ async def test_ledger_accept_taa_tty(self, mock_stdout):
}

with (
mock.patch.object(test_module, "use_asyncio_event_loop", mock.MagicMock()),
mock.patch.object(
test_module.prompt_toolkit, "prompt", mock.CoroutineMock()
) as mock_prompt,
Expand All @@ -656,9 +655,6 @@ async def test_ledger_accept_taa_tty(self, mock_stdout):
)

with (
mock.patch.object(
test_module, "use_asyncio_event_loop", mock.MagicMock()
) as mock_use_aio_loop,
mock.patch.object(
test_module.prompt_toolkit, "prompt", mock.CoroutineMock()
) as mock_prompt,
Expand All @@ -669,9 +665,6 @@ async def test_ledger_accept_taa_tty(self, mock_stdout):
)

with (
mock.patch.object(
test_module, "use_asyncio_event_loop", mock.MagicMock()
) as mock_use_aio_loop,
mock.patch.object(
test_module.prompt_toolkit, "prompt", mock.CoroutineMock()
) as mock_prompt,
Expand Down
9 changes: 0 additions & 9 deletions demo/runners/support/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import prompt_toolkit
import pygments
from prompt_toolkit.application import run_in_terminal
from prompt_toolkit.eventloop.defaults import use_asyncio_event_loop
from prompt_toolkit.formatted_text import FormattedText, PygmentsTokens
from prompt_toolkit.patch_stdout import patch_stdout
from prompt_toolkit.shortcuts import ProgressBar
Expand Down Expand Up @@ -142,15 +141,7 @@ def flatten(args):
yield arg


def prompt_init():
if hasattr(prompt_init, "_called"):
return
prompt_init._called = True
use_asyncio_event_loop()


async def prompt(*args, **kwargs):
prompt_init()
with patch_stdout():
try:
while True:
Expand Down
Loading
Loading