interpreter: move 'env' to type_checking

pull/9185/head
Dylan Baker 4 years ago
parent 8c90140f2b
commit ec59cbdf61
  1. 3
      mesonbuild/interpreter/interpreter.py
  2. 6
      mesonbuild/interpreter/type_checking.py

@ -51,6 +51,7 @@ from .interpreterobjects import (
NullSubprojectInterpreter, NullSubprojectInterpreter,
) )
from .type_checking import ( from .type_checking import (
ENV_KW,
INSTALL_MODE_KW, INSTALL_MODE_KW,
LANGUAGE_KW, LANGUAGE_KW,
NATIVE_KW, NATIVE_KW,
@ -189,7 +190,7 @@ TEST_KWARGS: T.List[KwargInfo] = [
listify=True, default=[], since='0.46.0'), listify=True, default=[], since='0.46.0'),
KwargInfo('priority', int, default=0, since='0.52.0'), KwargInfo('priority', int, default=0, since='0.52.0'),
# TODO: env needs reworks of the way the environment variable holder itself works probably # 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 KwargInfo('suite', ContainerTypeInfo(list, str), listify=True, default=['']), # yes, a list of empty string
] ]

@ -6,6 +6,7 @@
import typing as T import typing as T
from .. import compilers from .. import compilers
from ..build import EnvironmentVariables
from ..coredata import UserFeatureOption from ..coredata import UserFeatureOption
from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo
from ..mesonlib import FileMode, MachineChoice from ..mesonlib import FileMode, MachineChoice
@ -126,3 +127,8 @@ REQUIRED_KW: KwargInfo[T.Union[bool, UserFeatureOption]] = KwargInfo(
default=True, default=True,
# TODO: extract_required_kwarg could be converted to a convertor # 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),
)

Loading…
Cancel
Save