diff --git a/distutils/cmd.py b/distutils/cmd.py index 072f0f72..f2b5b964 100644 --- a/distutils/cmd.py +++ b/distutils/cmd.py @@ -102,7 +102,7 @@ def __init__(self, dist: Distribution) -> None: # timestamps, but methods defined *here* assume that # 'self.force' exists for all commands. So define it here # just to be safe. - self.force = None + self.force: bool | None = None # The 'help' flag is just used for command-line parsing, so # none of that complicated bureaucracy is needed. diff --git a/distutils/command/build_ext.py b/distutils/command/build_ext.py index 85560be6..01181bbe 100644 --- a/distutils/command/build_ext.py +++ b/distutils/command/build_ext.py @@ -109,11 +109,11 @@ class build_ext(Command): ('help-compiler', None, "list available compilers", show_compilers), ] - def initialize_options(self): + def initialize_options(self) -> None: self.extensions = None - self.build_lib = None - self.plat_name = None - self.build_temp = None + self.build_lib: str = None # Should always be set in finalize_options + self.plat_name: str = None # Should always be set in finalize_options + self.build_temp: str = None # Should always be set in finalize_options self.inplace = False self.package = None @@ -125,7 +125,7 @@ def initialize_options(self): self.rpath = None self.link_objects = None self.debug = None - self.force = None + self.force: bool = None # Should always be set in finalize_options self.compiler = None self.swig = None self.swig_cpp = None