interpreter: move KwargInfo('depends') to type_checking

pull/9329/head
Dylan Baker 3 years ago committed by Daniel Mensinger
parent 16986f1853
commit a3e63a4269
  1. 8
      mesonbuild/interpreter/interpreter.py
  2. 9
      mesonbuild/interpreter/type_checking.py

@ -50,6 +50,7 @@ from .interpreterobjects import (
NullSubprojectInterpreter, NullSubprojectInterpreter,
) )
from .type_checking import ( from .type_checking import (
DEPENDS_KW,
DEPFILE_KW, DEPFILE_KW,
ENV_KW, ENV_KW,
INSTALL_MODE_KW, INSTALL_MODE_KW,
@ -1676,12 +1677,7 @@ This will become a hard error in the future.''' % kwargs['input'], location=self
listify=True, listify=True,
default=[], default=[],
), ),
KwargInfo( DEPENDS_KW,
'depends',
ContainerTypeInfo(list, (build.BuildTarget, build.CustomTarget)),
listify=True,
default=[],
),
ENV_KW.evolve(since='0.57.0'), ENV_KW.evolve(since='0.57.0'),
) )
def func_run_target(self, node: mparser.FunctionNode, args: T.Tuple[str], def func_run_target(self, node: mparser.FunctionNode, args: T.Tuple[str],

@ -6,7 +6,7 @@
import typing as T import typing as T
from .. import compilers from .. import compilers
from ..build import EnvironmentVariables from ..build import EnvironmentVariables, CustomTarget, BuildTarget
from ..coredata import UserFeatureOption from ..coredata import UserFeatureOption
from ..interpreterbase import TYPE_var from ..interpreterbase import TYPE_var
from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo from ..interpreterbase.decorators import KwargInfo, ContainerTypeInfo
@ -183,3 +183,10 @@ DEPFILE_KW: KwargInfo[T.Optional[str]] = KwargInfo(
(str, type(None)), (str, type(None)),
validator=lambda x: 'Depfile must be a plain filename with a subdirectory' if has_path_sep(x) else None validator=lambda x: 'Depfile must be a plain filename with a subdirectory' if has_path_sep(x) else None
) )
DEPENDS_KW: KwargInfo[T.List[T.Union[BuildTarget, CustomTarget]]] = KwargInfo(
'depends',
ContainerTypeInfo(list, (BuildTarget, CustomTarget)),
listify=True,
default=[],
)

Loading…
Cancel
Save