From 3467cf956c973de6b27d282257bdb3d654c7c35f Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Tue, 10 Aug 2021 11:28:39 -0700 Subject: [PATCH] build: fix annotation for Build.targets This really does need to be an OrderedDict, not a MutableMapping, as there are consumers in the backend that need dictionary only methods. --- mesonbuild/build.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 3aab060e9..ceec9da18 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -213,7 +213,7 @@ class Build: self.project_version = None self.environment = environment self.projects = {} - self.targets: T.MutableMapping[str, 'Target'] = OrderedDict() + self.targets: 'T.OrderedDict[str, T.Union[CustomTarget, BuildTarget]]' = OrderedDict() self.run_target_names: T.Set[T.Tuple[str, str]] = set() self.global_args: PerMachine[T.Dict[str, T.List[str]]] = PerMachine({}, {}) self.global_link_args: PerMachine[T.Dict[str, T.List[str]]] = PerMachine({}, {}) @@ -282,7 +282,7 @@ class Build: def get_subproject_dir(self): return self.subproject_dir - def get_targets(self) -> T.Dict[str, 'Target']: + def get_targets(self) -> 'T.OrderedDict[str, T.Union[CustomTarget, BuildTarget]]': return self.targets def get_tests(self) -> T.List['Test']: