aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-02-28 15:20:19 -0800
committerDylan Baker <dylan@pnwbakers.com>2022-03-03 10:29:14 -0800
commit122b9db7b00ef55b154fbc414eb18e50fcfc987f (patch)
tree0528d5853c5c4fb264ce76f3f7e7150fca78879e
parentca64777315ce031face69c263b9e69f0c55b93c1 (diff)
downloadmeson-122b9db7b00ef55b154fbc414eb18e50fcfc987f.zip
meson-122b9db7b00ef55b154fbc414eb18e50fcfc987f.tar.gz
meson-122b9db7b00ef55b154fbc414eb18e50fcfc987f.tar.bz2
interpreter: Use a literal for the do_subproject helper
Since we only have two valid options and we don't want to allow any others.
-rw-r--r--mesonbuild/interpreter/interpreter.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index daa2ca5..4d5bf1b 100644
--- a/mesonbuild/interpreter/interpreter.py
+++ b/mesonbuild/interpreter/interpreter.py
@@ -93,6 +93,8 @@ import importlib
if T.TYPE_CHECKING:
import argparse
+ from typing_extensions import Literal
+
from . import kwargs
from ..programs import OverrideProgram
@@ -807,7 +809,7 @@ external dependencies (including libraries) must go to "dependencies".''')
self.coredata.initialized_subprojects.add(subp_name)
return sub
- def do_subproject(self, subp_name: str, method: str, kwargs):
+ def do_subproject(self, subp_name: str, method: Literal['meson', 'cmake'], kwargs) -> SubprojectHolder:
disabled, required, feature = extract_required_kwarg(kwargs, self.subproject)
if disabled:
mlog.log('Subproject', mlog.bold(subp_name), ':', 'skipped: feature', mlog.bold(feature), 'disabled')