@@ -237,8 +237,13 @@ def _subcommand(
237237 help : Optional [str ] = None , # pylint: disable=redefined-builtin
238238 description : Optional [str ] = None ,
239239 handler : Handler ,
240- ):
241- def _wrap_add_subcommand (f : Callable [[argparse .ArgumentParser ], None ]):
240+ ) -> Callable [
241+ [Callable [[argparse .ArgumentParser ], None ]],
242+ Callable [["argparse._SubParsersAction" ], None ],
243+ ]:
244+ def _wrap_add_subcommand (
245+ f : Callable [[argparse .ArgumentParser ], None ]
246+ ) -> Callable [["argparse._SubParsersAction" ], None ]:
242247 def _wrapped_subcommand (subparsers : "argparse._SubParsersAction" ):
243248 parser = subparsers .add_parser (
244249 subcommand , help = help , description = description
@@ -279,14 +284,14 @@ def bootstrap_basilisp_installation(_, args: argparse.Namespace) -> None:
279284 description = textwrap .dedent (
280285 """Bootstrap the Python installation to allow importing Basilisp namespaces"
281286 without requiring an additional bootstrapping step.
282-
287+
283288 Python installations are bootstrapped by installing a `basilispbootstrap.pth`
284289 file in your `site-packages` directory. Python installations execute `*.pth`
285290 files found at startup.
286-
291+
287292 Bootstrapping your Python installation in this way can help avoid needing to
288293 perform manual bootstrapping from Python code within your application.
289-
294+
290295 On the first startup, Basilisp will compile `basilisp.core` to byte code
291296 which could take up to 30 seconds in some cases depending on your system and
292297 which version of Python you are using. Subsequent startups should be
@@ -319,7 +324,7 @@ def _add_bootstrap_subcommand(parser: argparse.ArgumentParser) -> None:
319324def nrepl_server (
320325 _ ,
321326 args : argparse .Namespace ,
322- ):
327+ ) -> None :
323328 opts = compiler .compiler_opts ()
324329 basilisp .init (opts )
325330
@@ -369,7 +374,7 @@ def _add_nrepl_server_subcommand(parser: argparse.ArgumentParser) -> None:
369374def repl (
370375 _ ,
371376 args : argparse .Namespace ,
372- ):
377+ ) -> None :
373378 opts = compiler .compiler_opts (
374379 warn_on_shadowed_name = args .warn_on_shadowed_name ,
375380 warn_on_shadowed_var = args .warn_on_shadowed_var ,
@@ -465,7 +470,7 @@ def _add_repl_subcommand(parser: argparse.ArgumentParser) -> None:
465470def run (
466471 parser : argparse .ArgumentParser ,
467472 args : argparse .Namespace ,
468- ):
473+ ) -> None :
469474 target = args .file_or_ns_or_code
470475 if args .load_namespace :
471476 if args .in_ns is not None :
@@ -523,18 +528,18 @@ def run(
523528 help = "run a Basilisp script or code or namespace" ,
524529 description = textwrap .dedent (
525530 """Run a Basilisp script or a line of code or load a Basilisp namespace.
526-
531+
527532 If `-c` is provided, execute the line of code as given. If `-n` is given,
528533 interpret `file_or_ns_or_code` as a fully qualified Basilisp namespace
529534 relative to `sys.path`. Otherwise, execute the file as a script relative to
530535 the current working directory.
531-
536+
532537 `*main-ns*` will be set to the value provided for `-n`. In all other cases,
533538 it will be `nil`."""
534539 ),
535540 handler = run ,
536541)
537- def _add_run_subcommand (parser : argparse .ArgumentParser ):
542+ def _add_run_subcommand (parser : argparse .ArgumentParser ) -> None :
538543 parser .add_argument (
539544 "file_or_ns_or_code" ,
540545 help = (
@@ -570,7 +575,9 @@ def _add_run_subcommand(parser: argparse.ArgumentParser):
570575 _add_debug_arg_group (parser )
571576
572577
573- def test (parser : argparse .ArgumentParser , args : argparse .Namespace ): # pragma: no cover
578+ def test (
579+ parser : argparse .ArgumentParser , args : argparse .Namespace
580+ ) -> None : # pragma: no cover
574581 try :
575582 import pytest
576583 except (ImportError , ModuleNotFoundError ):
@@ -591,7 +598,7 @@ def _add_test_subcommand(parser: argparse.ArgumentParser) -> None:
591598 parser .add_argument ("args" , nargs = - 1 )
592599
593600
594- def version (_ , __ ):
601+ def version (_ , __ ) -> None :
595602 v = importlib .metadata .version ("basilisp" )
596603 print (f"Basilisp { v } " )
597604
0 commit comments