From 011b58d75fd2fd7cee740e65d63859f2c3ba87f1 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 1 Jul 2021 10:44:06 -0700 Subject: [PATCH] interpreter: use typed_pos_args for project --- mesonbuild/interpreter/interpreter.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index 0671bc023..7c737958d 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -1079,12 +1079,10 @@ external dependencies (including libraries) must go to "dependencies".''') options = {k: v for k, v in self.environment.options.items() if k.is_backend()} self.coredata.set_options(options) - @stringArgs @permittedKwargs({'version', 'meson_version', 'default_options', 'license', 'subproject_dir'}) - def func_project(self, node, args, kwargs): - if len(args) < 1: - raise InvalidArguments('Not enough arguments to project(). Needs at least the project name.') - proj_name, *proj_langs = args + @typed_pos_args('project', str, varargs=str) + def func_project(self, node: mparser.FunctionNode, args: T.Tuple[str, T.List[str]], kwargs: 'TYPE_kwargs') -> None: + proj_name, proj_langs = args if ':' in proj_name: raise InvalidArguments(f"Project name {proj_name!r} must not contain ':'")