diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2021-11-03 10:06:22 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2021-11-22 11:28:43 -0800 |
commit | 3295621706d47ca6f4731695e9c9acc0ddcc572b (patch) | |
tree | 5a617862dc224208d720d4b413aaa7e0a99d48c3 /mesonbuild/interpreter/kwargs.py | |
parent | f34013fb08b8d24d570c96084c5d58c5eaf4f5da (diff) | |
download | meson-3295621706d47ca6f4731695e9c9acc0ddcc572b.zip meson-3295621706d47ca6f4731695e9c9acc0ddcc572b.tar.gz meson-3295621706d47ca6f4731695e9c9acc0ddcc572b.tar.bz2 |
interpreter: add typed_kwargs to subdir
Diffstat (limited to 'mesonbuild/interpreter/kwargs.py')
-rw-r--r-- | mesonbuild/interpreter/kwargs.py | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index 00dfdfd..50bc5d1 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 @@ -204,3 +204,18 @@ class Project(TypedDict): 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] |