aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter/interpreterobjects.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2022-03-07 16:43:44 +0200
committerGitHub <noreply@github.com>2022-03-07 16:43:44 +0200
commitade6e3a19ed48c058138473a2f543031a1386393 (patch)
treee305c1be971b261090e42bac4dc8effb154cf2cf /mesonbuild/interpreter/interpreterobjects.py
parent01e92dc543fb7443fba8a33687ffd726f11433e8 (diff)
parentbcf924dc7b7eebfdca83e74da400a060b6be4319 (diff)
downloadmeson-ade6e3a19ed48c058138473a2f543031a1386393.zip
meson-ade6e3a19ed48c058138473a2f543031a1386393.tar.gz
meson-ade6e3a19ed48c058138473a2f543031a1386393.tar.bz2
Merge pull request #10043 from dcbaker/submit/type-checking-for-subproject
Add typing for subproject()
Diffstat (limited to 'mesonbuild/interpreter/interpreterobjects.py')
-rw-r--r--mesonbuild/interpreter/interpreterobjects.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/interpreter/interpreterobjects.py b/mesonbuild/interpreter/interpreterobjects.py
index 90607ee..ef899e2 100644
--- a/mesonbuild/interpreter/interpreterobjects.py
+++ b/mesonbuild/interpreter/interpreterobjects.py
@@ -1,3 +1,4 @@
+from __future__ import annotations
import os
import shlex
import subprocess
@@ -23,15 +24,16 @@ from ..interpreterbase import (
from ..interpreter.type_checking import NoneType, ENV_SEPARATOR_KW
from ..dependencies import Dependency, ExternalLibrary, InternalDependency
from ..programs import ExternalProgram
-from ..mesonlib import HoldableObject, MesonException, OptionKey, listify, Popen_safe
+from ..mesonlib import HoldableObject, OptionKey, listify, Popen_safe
import typing as T
if T.TYPE_CHECKING:
from . import kwargs
- from .interpreter import Interpreter
+ from ..cmake.interpreter import CMakeInterpreter
from ..envconfig import MachineInfo
from ..interpreterbase import SubProject
+ from .interpreter import Interpreter
from typing_extensions import TypedDict
@@ -683,13 +685,14 @@ class SubprojectHolder(MesonInterpreterObject):
subdir: str,
warnings: int = 0,
disabled_feature: T.Optional[str] = None,
- exception: T.Optional[MesonException] = None) -> None:
+ exception: T.Optional[Exception] = None) -> None:
super().__init__()
self.held_object = subinterpreter
self.warnings = warnings
self.disabled_feature = disabled_feature
self.exception = exception
self.subdir = PurePath(subdir).as_posix()
+ self.cm_interpreter: T.Optional[CMakeInterpreter] = None
self.methods.update({'get_variable': self.get_variable_method,
'found': self.found_method,
})