diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2022-06-17 14:05:25 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2023-08-08 10:06:47 -0700 |
commit | 7abd4d39c179f9cf4b8830d44d070b910db8a2d4 (patch) | |
tree | 5778315e024c1ddbfdefdd92a0b5bd18883af390 /mesonbuild/interpreter/interpreter.py | |
parent | a151b10988644b24dd45d0a912d5994edccbb6e0 (diff) | |
download | meson-7abd4d39c179f9cf4b8830d44d070b910db8a2d4.zip meson-7abd4d39c179f9cf4b8830d44d070b910db8a2d4.tar.gz meson-7abd4d39c179f9cf4b8830d44d070b910db8a2d4.tar.bz2 |
interpreter: add type annotations to func_declare_dependency
Diffstat (limited to 'mesonbuild/interpreter/interpreter.py')
-rw-r--r-- | mesonbuild/interpreter/interpreter.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 95a6e1d..61c0b25 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -691,7 +691,8 @@ class Interpreter(InterpreterBase, HoldableObject): KwargInfo('version', (str, NoneType)), KwargInfo('objects', ContainerTypeInfo(list, build.ExtractedObjects), listify=True, default=[], since='1.1.0'), ) - def func_declare_dependency(self, node, args, kwargs): + def func_declare_dependency(self, node: mparser.BaseNode, args: T.List[TYPE_var], + kwargs: kwtypes.FuncDeclareDependency) -> dependencies.Dependency: deps = kwargs['dependencies'] incs = self.extract_incdirs(kwargs) libs = kwargs['link_with'] @@ -2738,7 +2739,7 @@ class Interpreter(InterpreterBase, HoldableObject): install_tag=install_tag, data_type='configure')) return mesonlib.File.from_built_file(self.subdir, output) - def extract_incdirs(self, kwargs, key: str = 'include_directories'): + def extract_incdirs(self, kwargs, key: str = 'include_directories') -> T.List[build.IncludeDirs]: prospectives = extract_as_list(kwargs, key) if key == 'include_directories': for i in prospectives: @@ -2747,7 +2748,7 @@ class Interpreter(InterpreterBase, HoldableObject): f'Use include_directories({i!r}) instead', location=self.current_node) break - result = [] + result: T.List[build.IncludeDirs] = [] for p in prospectives: if isinstance(p, build.IncludeDirs): result.append(p) |