aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2021-08-10 14:45:17 -0700
committerDylan Baker <dylan@pnwbakers.com>2021-08-30 18:02:56 -0700
commitec59cbdf6128fd65b46f6d1837145a124ef0bba9 (patch)
tree29d8b6336aaf59666f9473894407ccb011cf0d53
parent8c90140f2bcc1025cc37c5489ef3f60c469009a5 (diff)
downloadmeson-ec59cbdf6128fd65b46f6d1837145a124ef0bba9.zip
meson-ec59cbdf6128fd65b46f6d1837145a124ef0bba9.tar.gz
meson-ec59cbdf6128fd65b46f6d1837145a124ef0bba9.tar.bz2
interpreter: move 'env' to type_checking
-rw-r--r--mesonbuild/interpreter/interpreter.py3
-rw-r--r--mesonbuild/interpreter/type_checking.py6
2 files changed, 8 insertions, 1 deletions
diff --git a/mesonbuild/interpreter/interpreter.py b/mesonbuild/interpreter/interpreter.py
index d104f74..ec5c75c 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 d4e178d..3d43b21 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),
+)