2626from datetime import datetime , timedelta , timezone
2727from pathlib import Path
2828from subprocess import CompletedProcess
29- from typing import Callable , NamedTuple , Optional
29+ from typing import Any , Callable , NamedTuple , NoReturn , Optional
3030
3131import __main__
3232import rich .traceback
@@ -145,7 +145,7 @@ def __init__(
145145 console_force_terminal : Optional [bool ] = None ,
146146 console_log_path : bool = True ,
147147 print_commands : bool = True ,
148- ):
148+ ) -> None :
149149 """
150150 Initialize a :class:`StagedScript` object.
151151
@@ -248,7 +248,7 @@ def stage(stage_name: str, heading: str) -> Callable:
248248
249249 def decorator (func : Callable ) -> Callable :
250250 def get_phase_method ( # noqa: D417
251- self ,
251+ self , # noqa: ANN001
252252 method_name : str ,
253253 ) -> Callable :
254254 """
@@ -273,9 +273,9 @@ def get_phase_method( # noqa: D417
273273 )
274274
275275 def run_retryable_phases ( # noqa: D417
276- self ,
277- * args ,
278- ** kwargs ,
276+ self , # noqa: ANN001
277+ * args : Any , # noqa: ANN401
278+ ** kwargs : Any , # noqa: ANN401
279279 ) -> None :
280280 """
281281 Run the retryable phases.
@@ -310,7 +310,7 @@ def run_retryable_phases( # noqa: D417
310310 get_phase_method (self , "_end_stage" )()
311311
312312 @functools .wraps (func )
313- def wrapper (self , * args , ** kwargs ) -> None :
313+ def wrapper (self , * args : Any , ** kwargs : Any ) -> None : # noqa: ANN001, ANN401
314314 """
315315 Turn a function into a stage.
316316
@@ -759,7 +759,7 @@ def parse_args(self, argv: list[str]) -> None:
759759 ]:
760760 setattr (self , retry_arg , getattr (self .args , retry_arg , None ))
761761
762- def raise_parser_error (self , message ) :
762+ def raise_parser_error (self , message : str ) -> NoReturn :
763763 """
764764 Raise a parser error.
765765
@@ -788,7 +788,7 @@ def run(
788788 * ,
789789 pretty_print : bool = False ,
790790 print_command : Optional [bool ] = None ,
791- ** kwargs ,
791+ ** kwargs : Any , # noqa: ANN401
792792 ) -> CompletedProcess :
793793 """
794794 Run a command in the underlying shell.
0 commit comments