From ec59cbdf6128fd65b46f6d1837145a124ef0bba9 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 10 Aug 2021 14:45:17 -0700 Subject: [PATCH] interpreter: move 'env' to type_checking --- mesonbuild/interpreter/interpreter.py | 3 ++- mesonbuild/interpreter/type_checking.py | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py index d104f7411..ec5c75c4d 100644 --- a/mesonbuild/interpreter/interpreter.py +++ b/mesonbuild/interpreter/interpreter.py @@ -51,6 +51,7 @@ from .interpreterobjects import ( NullSubprojectInterpreter, ) from .type_checking import ( + ENV_KW, INSTALL_MODE_KW, LANGUAGE_KW, NATIVE_KW, @@ -189,7 +190,7 @@ TEST_KWARGS: T.List[KwargInfo] = [ listify=True, default=[], since='0.46.0'), KwargInfo('priority', int, default=0, since='0.52.0'), # TODO: env needs reworks of the way the environment variable holder itself works probably - KwargInfo('env', (EnvironmentVariablesObject, list, dict, str, NoneType)), + ENV_KW, KwargInfo('suite', ContainerTypeInfo(list, str), listify=True, default=['']), # yes, a list of empty string ] diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index d4e178d12..3d43b21b8 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -6,6 +6,7 @@ import typing as T from .. import compilers +from ..build import EnvironmentVariables from ..coredata import UserFeatureOption from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo from ..mesonlib import FileMode, MachineChoice @@ -126,3 +127,8 @@ REQUIRED_KW: KwargInfo[T.Union[bool, UserFeatureOption]] = KwargInfo( default=True, # TODO: extract_required_kwarg could be converted to a convertor ) + +ENV_KW: KwargInfo[T.Union[EnvironmentVariables, T.List, T.Dict, str, NoneType]] = KwargInfo( + 'env', + (EnvironmentVariables, list, dict, str), +)