From 16986f1853673776f76ff97acb5d8b5b9f02a788 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 10 Aug 2021 15:38:18 -0700 Subject: [PATCH] interpreter: DEPFILE_KW should be Optional[str] --- mesonbuild/interpreter/kwargs.py | 2 +- mesonbuild/interpreter/type_checking.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mesonbuild/interpreter/kwargs.py b/mesonbuild/interpreter/kwargs.py index 69706bc88..4281ee420 100644 --- a/mesonbuild/interpreter/kwargs.py +++ b/mesonbuild/interpreter/kwargs.py @@ -88,7 +88,7 @@ class FuncGenerator(TypedDict): arguments: T.List[str] output: T.List[str] - depfile: bool + depfile: T.Optional[str] capture: bool depends: T.List[T.Union[build.BuildTarget, build.CustomTarget]] diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 3c4c3f0f4..d8559541e 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -178,8 +178,8 @@ ENV_KW: KwargInfo[T.Union[EnvironmentVariables, T.List, T.Dict, str, None]] = Kw convertor=_env_convertor, ) -DEPFILE_KW = KwargInfo( +DEPFILE_KW: KwargInfo[T.Optional[str]] = KwargInfo( 'depfile', - str, + (str, type(None)), validator=lambda x: 'Depfile must be a plain filename with a subdirectory' if has_path_sep(x) else None )