From a5cc23e0802b18cbaa20f7125b395cf43c093736 Mon Sep 17 00:00:00 2001 From: Mike Lin Date: Mon, 2 Jun 2025 19:21:46 -1000 Subject: [PATCH] switch CLI from bullet (unmaintained) to questionary --- WDL/CLI.py | 20 +++++++++++--------- pyproject.toml | 2 +- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/WDL/CLI.py b/WDL/CLI.py index f725e9fd..c1b1c0d6 100644 --- a/WDL/CLI.py +++ b/WDL/CLI.py @@ -1752,7 +1752,7 @@ def configure(cfg=None, show=False, force=False, **kwargs): die("`miniwdl configure` is for interactive use") from datetime import datetime - import bullet # type: ignore + import questionary # type: ignore from xdg import XDG_CONFIG_HOME miniwdl_version = pkg_version() @@ -1770,11 +1770,12 @@ def configure(cfg=None, show=False, force=False, **kwargs): cfg = os.path.join(XDG_CONFIG_HOME, "miniwdl.cfg") def yes(prompt): - return bullet.Bullet(prompt=prompt, choices=["No", "Yes"]).launch() == "Yes" + answer = questionary.confirm(prompt, qmark="").unsafe_ask() + return bool(answer) if os.path.exists(cfg): assert force - logger.warn("Proceeding will overwrite existing configuration file at " + cfg) + logger.warning("Proceeding will overwrite existing configuration file at " + cfg) sys.stderr.flush() if not yes("OVERWRITE?"): sys.exit(0) @@ -1799,9 +1800,9 @@ def yes(prompt): print("\nCall cache JSON file storage directory: ~/.cache/miniwdl/") if yes("OVERRIDE?"): - options["call_cache"]["dir"] = bullet.Input( - prompt="Call cache directory: ", strip=True - ).launch() + options["call_cache"]["dir"] = ( + questionary.text("Call cache directory: ").unsafe_ask().strip() + ) print( textwrap.dedent( @@ -1818,9 +1819,10 @@ def yes(prompt): print("\nDownload cache directory: /tmp/miniwdl_download_cache") if yes("OVERRIDE?"): - options["download_cache"]["dir"] = bullet.Input( - prompt="Download cache directory: ", strip=True - ).launch() + # use questionary text prompt for directory input + options["download_cache"]["dir"] = ( + questionary.text("Download cache directory: ").unsafe_ask().strip() + ) print() if yes("Configure non-public Amazon s3:// access?"): diff --git a/pyproject.toml b/pyproject.toml index a69bcae1..f424adcd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -32,7 +32,7 @@ dependencies = [ "coloredlogs>=15,<16", "python-json-logger>=2,<4", "lark~=1.2", - "bullet>=2,<3", + "questionary>=2,<3", "psutil>=5,<8" ]