From 71c65392a83f3f293fa70e7fadc610f95a8e8d4e Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Mon, 28 Feb 2022 15:20:49 -0800 Subject: [PATCH] interpreter: add some simple annotations to subproject methods --- mesonbuild/interpreter/interpreter.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 4d5bf1b3b..943f49eaf 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -802,7 +802,8 @@ external dependencies (including libraries) must go to "dependencies".''') def func_subproject(self, nodes: mparser.BaseNode, args: T.Tuple[str], kwargs: 'TYPE_kwargs') -> SubprojectHolder: return self.do_subproject(args[0], 'meson', kwargs) - def disabled_subproject(self, subp_name, disabled_feature=None, exception=None): + def disabled_subproject(self, subp_name: str, disabled_feature: T.Optional[str] = None, + exception: T.Optional[mesonlib.MesonException] = None) -> SubprojectHolder: sub = SubprojectHolder(NullSubprojectInterpreter(), os.path.join(self.subproject_dir, subp_name), disabled_feature=disabled_feature, exception=exception) self.subprojects[subp_name] = sub @@ -931,7 +932,7 @@ external dependencies (including libraries) must go to "dependencies".''') self.coredata.initialized_subprojects.add(subp_name) return self.subprojects[subp_name] - def _do_subproject_cmake(self, subp_name, subdir, subdir_abs, default_options, kwargs): + def _do_subproject_cmake(self, subp_name: str, subdir: str, subdir_abs: str, default_options, kwargs): with mlog.nested(subp_name): new_build = self.build.copy() prefix = self.coredata.options[OptionKey('prefix')].value