From 3b28286dcc88e93ffce0ba7fe4ce5e1072693053 Mon Sep 17 00:00:00 2001 From: Jussi Pakkanen Date: Thu, 12 Dec 2024 16:01:50 +0200 Subject: [PATCH] Fix command option typing. --- mesonbuild/mconf.py | 5 +++-- mesonbuild/msetup.py | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index c19fdc4eea84..e5a0bd0102c1 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -35,6 +35,7 @@ class CMDOptions(coredata.SharedCMDOptions, Protocol): builddir: str clearcache: bool pager: bool + unset_opts: T.List[str] # cannot be TV_Loggable, because non-ansidecorators do direct string concat LOGLINE = T.Union[str, mlog.AnsiDecorator] @@ -352,14 +353,14 @@ def print_augments(self) -> None: else: mlog.log('\nThere are no option augments.') -def has_option_flags(options: T.Any) -> bool: +def has_option_flags(options: CMDOptions) -> bool: if options.cmd_line_options: return True if options.unset_opts: return True return False -def is_print_only(options: T.Any) -> bool: +def is_print_only(options: CMDOptions) -> bool: if has_option_flags(options): return False if options.clearcache: diff --git a/mesonbuild/msetup.py b/mesonbuild/msetup.py index aea85b159c42..e2646f9e13d0 100644 --- a/mesonbuild/msetup.py +++ b/mesonbuild/msetup.py @@ -27,6 +27,7 @@ class CMDOptions(SharedCMDOptions, Protocol): builddir: str sourcedir: str pager: bool + unset_opts: T.List[str] git_ignore_file = '''# This file is autogenerated by Meson. If you change or delete it, it won't be recreated. *