@@ -142,16 +142,13 @@ def __call__(self, parser, namespace, values, option_string=None):
142142 else :
143143 print ("miniwdl version unknown" )
144144
145- # show plugin versions
146- # importlib_metadata doesn't seem to provide EntryPoint.dist to get from an entry point to
147- # the metadata of the package providing it; continuing to use pkg_resources for this. Risk
148- # that they give inconsistent results?
149- import pkg_resources # type: ignore
145+ import importlib_metadata
150146
151147 for group in runtime .config .default_plugins ().keys ():
152148 group = f"miniwdl.plugin.{ group } "
153- for plugin in pkg_resources .iter_entry_points (group = group ):
154- print (f"{ group } \t { plugin } \t { plugin .dist } " )
149+ for plugin in importlib_metadata .entry_points (group = group ):
150+ plugin_info = f"{ plugin .dist .name } { plugin .dist .version } "
151+ print (f"{ group } \t { plugin .name } = { plugin .value } \t { plugin_info } " )
155152 sys .exit (0 )
156153
157154
@@ -1125,11 +1122,7 @@ def runner_input_json_file(available_inputs, namespace, input_file, downloadable
11251122 elif input_file == "-" :
11261123 input_json = sys .stdin .read ()
11271124 else :
1128- input_json = (
1129- asyncio .get_event_loop ()
1130- .run_until_complete (make_read_source (False )(input_file , [], None ))
1131- .source_text
1132- )
1125+ input_json = asyncio .run (make_read_source (False )(input_file , [], None )).source_text
11331126 input_json = YAML (typ = "safe" , pure = True ).load (input_json )
11341127 if not isinstance (input_json , dict ):
11351128 raise Error .InputError ("check JSON input; expected top-level object" )
@@ -1756,7 +1749,7 @@ def configure(cfg=None, show=False, force=False, **kwargs):
17561749 die ("`miniwdl configure` is for interactive use" )
17571750
17581751 from datetime import datetime
1759- import bullet # type: ignore
1752+ import questionary # type: ignore
17601753 from xdg import XDG_CONFIG_HOME
17611754
17621755 miniwdl_version = pkg_version ()
@@ -1774,11 +1767,12 @@ def configure(cfg=None, show=False, force=False, **kwargs):
17741767 cfg = os .path .join (XDG_CONFIG_HOME , "miniwdl.cfg" )
17751768
17761769 def yes (prompt ):
1777- return bullet .Bullet (prompt = prompt , choices = ["No" , "Yes" ]).launch () == "Yes"
1770+ answer = questionary .confirm (prompt , qmark = "" ).unsafe_ask ()
1771+ return bool (answer )
17781772
17791773 if os .path .exists (cfg ):
17801774 assert force
1781- logger .warn ("Proceeding will overwrite existing configuration file at " + cfg )
1775+ logger .warning ("Proceeding will overwrite existing configuration file at " + cfg )
17821776 sys .stderr .flush ()
17831777 if not yes ("OVERWRITE?" ):
17841778 sys .exit (0 )
@@ -1803,9 +1797,9 @@ def yes(prompt):
18031797 print ("\n Call cache JSON file storage directory: ~/.cache/miniwdl/" )
18041798
18051799 if yes ("OVERRIDE?" ):
1806- options ["call_cache" ]["dir" ] = bullet . Input (
1807- prompt = "Call cache directory: " , strip = True
1808- ). launch ()
1800+ options ["call_cache" ]["dir" ] = (
1801+ questionary . text ( "Call cache directory: " ). unsafe_ask (). strip ()
1802+ )
18091803
18101804 print (
18111805 textwrap .dedent (
@@ -1822,9 +1816,10 @@ def yes(prompt):
18221816 print ("\n Download cache directory: /tmp/miniwdl_download_cache" )
18231817
18241818 if yes ("OVERRIDE?" ):
1825- options ["download_cache" ]["dir" ] = bullet .Input (
1826- prompt = "Download cache directory: " , strip = True
1827- ).launch ()
1819+ # use questionary text prompt for directory input
1820+ options ["download_cache" ]["dir" ] = (
1821+ questionary .text ("Download cache directory: " ).unsafe_ask ().strip ()
1822+ )
18281823
18291824 print ()
18301825 if yes ("Configure non-public Amazon s3:// access?" ):
@@ -1854,7 +1849,8 @@ def yes(prompt):
18541849 print (cfg_content )
18551850 print ()
18561851 sys .stdout .flush ()
1857- os .makedirs (os .path .dirname (cfg ), exist_ok = True )
1852+ if dn := os .path .dirname (cfg ):
1853+ os .makedirs (dn , exist_ok = True )
18581854 with open (cfg , "w" ) as outfile :
18591855 print (
18601856 f"# miniwdl configure { miniwdl_version or '(version unknown)' } { datetime .utcnow ()} Z" ,
0 commit comments