From 3b54f38c845e0b3330a2e1fe3985884eb005e856 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Mon, 25 Feb 2019 02:45:20 -0500 Subject: [PATCH] Add some type annotations Some things, like `method[...](...)` or `x: ... = ...` python 3.5 doesn't support, so I made a comment instead with the intention that it can someday be made into a real annotation. --- mesonbuild/build.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mesonbuild/build.py b/mesonbuild/build.py index 763e5c9fb..7856fbdcc 100644 --- a/mesonbuild/build.py +++ b/mesonbuild/build.py @@ -12,7 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. -from typing import List import copy, os, re from collections import OrderedDict import itertools, pathlib @@ -30,6 +29,7 @@ from .mesonlib import ( get_filenames_templates_dict, substitute_values, has_path_sep, ) from .compilers import Compiler, is_object, clink_langs, sort_clink, lang_suffixes, get_macos_dylib_install_name +from .linkers import StaticLinker from .interpreterbase import FeatureNew pch_kwargs = set(['c_pch', 'cpp_pch']) @@ -113,16 +113,16 @@ class Build: self.environment = environment self.projects = {} self.targets = OrderedDict() - self.global_args = PerMachine({}, {}) - self.projects_args = PerMachine({}, {}) - self.global_link_args = PerMachine({}, {}) - self.projects_link_args = PerMachine({}, {}) + self.global_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.projects_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.global_link_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] + self.projects_link_args = PerMachine({}, {}) # type: PerMachine[typing.Dict[str, typing.List[str]]] self.tests = [] self.benchmarks = [] self.headers = [] self.man = [] self.data = [] - self.static_linker = PerMachine(None, None) + self.static_linker = PerMachine(None, None) # type: PerMachine[StaticLinker] self.subprojects = {} self.subproject_dir = '' self.install_scripts = [] @@ -1144,7 +1144,7 @@ You probably should put it in link_with instead.''') def get_aliases(self): return {} - def get_langs_used_by_deps(self) -> List[str]: + def get_langs_used_by_deps(self) -> typing.List[str]: ''' Sometimes you want to link to a C++ library that exports C API, which means the linker must link in the C++ stdlib, and we must use a C++