diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-06-16 20:11:46 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-16 20:11:46 +0300 |
commit | 6fb2f86379c224e99652748eea94a03321b9bd11 (patch) | |
tree | a96fb2b8f6468d793b64b172abc67b8224e0edc3 /mesonbuild/interpreter/kwargs.py | |
parent | 537adce5d803ff4ae373d87671190a4a2682ff54 (diff) | |
parent | 0f5e55a749f0fed6330b216a82de941de3ccf9d6 (diff) | |
download | meson-6fb2f86379c224e99652748eea94a03321b9bd11.zip meson-6fb2f86379c224e99652748eea94a03321b9bd11.tar.gz meson-6fb2f86379c224e99652748eea94a03321b9bd11.tar.bz2 |
Merge pull request #8822 from dcbaker/submit/annotate-and-check-qt-module
Rewrite the Qt module for type safety!
Diffstat (limited to 'mesonbuild/interpreter/kwargs.py')
-rw-r--r-- | mesonbuild/interpreter/kwargs.py | 35 |
1 files changed, 34 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index db6b02b..9734caa 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -9,7 +9,10 @@ import typing as T from typing_extensions import TypedDict, Literal from ..mesonlib import MachineChoice, File -from .interpreterobjects import BuildTargetHolder, CustomTargetHolder, EnvironmentVariablesHolder, TargetHolder +from .interpreterobjects import ( + BuildTargetHolder, CustomTargetHolder, EnvironmentVariablesHolder, + FeatureOptionHolder, TargetHolder +) class FuncAddProjectArgs(TypedDict): @@ -57,3 +60,33 @@ class FuncTest(FuncBenchmark): """ is_parallel: bool + + +class ExtractRequired(TypedDict): + + """Keyword Arguments consumed by the `extract_required_kwargs` function. + + Any function that uses the `required` keyword argument which accepts either + a boolean or a feature option should inherit it's arguments from this class. + """ + + required: T.Union[bool, 'FeatureOptionHolder'] + + +class FuncGenerator(TypedDict): + + """Keyword rguments for the generator function.""" + + arguments: T.List[str] + output: T.List[str] + depfile: bool + capture: bool + depends: T.List[T.Union['BuildTargetHolder', 'CustomTargetHolder']] + + +class GeneratorProcess(TypedDict): + + """Keyword Arguments for generator.process.""" + + preserve_path_from: T.Optional[str] + extra_args: T.List[str] |