diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2021-11-27 21:44:41 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-27 21:44:41 +0200 |
commit | bd509d11a5233164498d19dd20d2e5653abcafc2 (patch) | |
tree | bd91da6669115b7ff761594e4ccedfa8c642017f /mesonbuild/interpreter/kwargs.py | |
parent | 91a099f3a7d2d3f2986e7e7e5949a7f73c2bdc79 (diff) | |
parent | c167a7691f8c9dc98b3035922b007dea65a6806c (diff) | |
download | meson-bd509d11a5233164498d19dd20d2e5653abcafc2.zip meson-bd509d11a5233164498d19dd20d2e5653abcafc2.tar.gz meson-bd509d11a5233164498d19dd20d2e5653abcafc2.tar.bz2 |
Merge pull request #9531 from dcbaker/submit/interpreter-more-typing
More use of typed_* in the interpreter module
Diffstat (limited to 'mesonbuild/interpreter/kwargs.py')
-rw-r--r-- | mesonbuild/interpreter/kwargs.py | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index 2229984..4f8cf06 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -6,7 +6,7 @@ import typing as T -from typing_extensions import TypedDict, Literal +from typing_extensions import TypedDict, Literal, Protocol from .. import build from .. import coredata @@ -186,3 +186,49 @@ class CustomTarget(TypedDict): install_tag: T.List[T.Union[str, bool]] output: T.List[str] override_options: T.Dict[OptionKey, str] + +class AddTestSetup(TypedDict): + + exe_wrapper: T.List[T.Union[str, ExternalProgram]] + gdb: bool + timeout_multiplier: int + is_default: bool + exclude_suites: T.List[str] + env: build.EnvironmentVariables + + +class Project(TypedDict): + + version: T.Optional[FileOrString] + meson_version: T.Optional[str] + default_options: T.List[str] + license: T.List[str] + subproject_dir: str + + +class _FoundProto(Protocol): + + """Protocol for subdir arguments. + + This allows us to define any objec that has a found(self) -> bool method + """ + + def found(self) -> bool: ... + + +class Subdir(TypedDict): + + if_found: T.List[_FoundProto] + + +class Summary(TypedDict): + + section: str + bool_yn: bool + list_sep: T.Optional[str] + + +class FindProgram(ExtractRequired, ExtractSearchDirs): + + native: MachineChoice + version: T.List[str] |