aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/dependencies/base.py8
-rw-r--r--mesonbuild/dependencies/dev.py56
-rw-r--r--mesonbuild/dependencies/misc.py49
-rw-r--r--mesonbuild/dependencies/scalapack.py7
-rw-r--r--mesonbuild/dependencies/ui.py28
-rwxr-xr-xrun_mypy.py17
6 files changed, 77 insertions, 88 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index 9b835d0..6280878 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -22,7 +22,7 @@ from enum import Enum
from .. import mlog
from ..compilers import clib_langs
-from ..mesonlib import MachineChoice, MesonException
+from ..mesonlib import MachineChoice, MesonException, File
from ..mesonlib import version_compare_many
from ..interpreterbase import FeatureDeprecated
@@ -83,7 +83,7 @@ class Dependency:
# Raw -L and -l arguments without manual library searching
# If None, self.link_args will be used
self.raw_link_args: T.Optional[T.List[str]] = None
- self.sources: T.List[str] = []
+ self.sources: T.List['FileOrString'] = []
self.methods = process_method_kw(self.get_methods(), kwargs)
self.include_type = self._process_include_type_kw(kwargs)
self.ext_deps: T.List[Dependency] = []
@@ -138,7 +138,7 @@ class Dependency:
def found(self) -> bool:
return self.is_found
- def get_sources(self) -> T.List[str]:
+ def get_sources(self) -> T.List['FileOrString']:
"""Source files that need to be added to the target.
As an example, gtest-all.cc when using GTest."""
return self.sources
@@ -218,7 +218,7 @@ class Dependency:
class InternalDependency(Dependency):
def __init__(self, version: str, incdirs: T.List[str], compile_args: T.List[str],
link_args: T.List[str], libraries: T.List['BuildTarget'],
- whole_libraries: T.List['BuildTarget'], sources: T.List[str],
+ whole_libraries: T.List['BuildTarget'], sources: T.List['FileOrString'],
ext_deps: T.List[Dependency], variables: T.Dict[str, T.Any]):
super().__init__('internal', {})
self.version = version
diff --git a/mesonbuild/dependencies/dev.py b/mesonbuild/dependencies/dev.py
index 345b24c..9c1d932 100644
--- a/mesonbuild/dependencies/dev.py
+++ b/mesonbuild/dependencies/dev.py
@@ -31,15 +31,14 @@ from .configtool import ConfigToolDependency
from .pkgconfig import PkgConfigDependency
from .factory import DependencyFactory
from .misc import threads_factory
-from ..compilers.c import AppleClangCCompiler
-from ..compilers.cpp import AppleClangCPPCompiler
+from ..compilers import AppleClangCCompiler, AppleClangCPPCompiler, CLikeCompiler
if T.TYPE_CHECKING:
from ..envconfig import MachineInfo
from .. environment import Environment
-def get_shared_library_suffix(environment, for_machine: MachineChoice):
+def get_shared_library_suffix(environment: 'Environment', for_machine: MachineChoice) -> str:
"""This is only guaranteed to work for languages that compile to machine
code, not for languages like C# that use a bytecode and always end in .dll
"""
@@ -52,7 +51,7 @@ def get_shared_library_suffix(environment, for_machine: MachineChoice):
class GTestDependencySystem(ExternalDependency):
- def __init__(self, name: str, environment, kwargs):
+ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
super().__init__(name, environment, kwargs, language='cpp')
self.main = kwargs.get('main', False)
self.src_dirs = ['/usr/src/gtest/src', '/usr/src/googletest/googletest/src']
@@ -61,7 +60,7 @@ class GTestDependencySystem(ExternalDependency):
return
self.detect()
- def detect(self):
+ def detect(self) -> None:
gtest_detect = self.clib_compiler.find_library("gtest", self.env, [])
gtest_main_detect = self.clib_compiler.find_library("gtest_main", self.env, [])
if gtest_detect and (not self.main or gtest_main_detect):
@@ -84,7 +83,7 @@ class GTestDependencySystem(ExternalDependency):
else:
self.is_found = False
- def detect_srcdir(self):
+ def detect_srcdir(self) -> bool:
for s in self.src_dirs:
if os.path.exists(s):
self.src_dir = s
@@ -98,17 +97,17 @@ class GTestDependencySystem(ExternalDependency):
return True
return False
- def log_info(self):
+ def log_info(self) -> str:
if self.prebuilt:
return 'prebuilt'
else:
return 'building self'
- def log_tried(self):
+ def log_tried(self) -> str:
return 'system'
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM]
@@ -122,7 +121,7 @@ class GTestDependencyPC(PkgConfigDependency):
class GMockDependencySystem(ExternalDependency):
- def __init__(self, name: str, environment, kwargs):
+ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
super().__init__(name, environment, kwargs, language='cpp')
self.main = kwargs.get('main', False)
if not self._add_sub_dependency(threads_factory(environment, self.for_machine, {})):
@@ -173,17 +172,17 @@ class GMockDependencySystem(ExternalDependency):
self.is_found = False
- def log_info(self):
+ def log_info(self) -> str:
if self.prebuilt:
return 'prebuilt'
else:
return 'building self'
- def log_tried(self):
+ def log_tried(self) -> str:
return 'system'
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM]
@@ -204,7 +203,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
tool_name = 'llvm-config'
__cpp_blacklist = {'-DNDEBUG'}
- def __init__(self, name: str, environment, kwargs):
+ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]):
self.tools = get_llvm_tool_names('llvm-config')
# Fedora starting with Fedora 30 adds a suffix of the number
@@ -219,9 +218,9 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
# It's necessary for LLVM <= 3.8 to use the C++ linker. For 3.9 and 4.0
# the C linker works fine if only using the C API.
super().__init__(name, environment, kwargs, language='cpp')
- self.provided_modules = []
- self.required_modules = set()
- self.module_details = []
+ self.provided_modules: T.List[str] = []
+ self.required_modules: T.Set[str] = set()
+ self.module_details: T.List[str] = []
if not self.is_found:
return
@@ -244,7 +243,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
self.is_found = False
return
- def __fix_bogus_link_args(self, args):
+ def __fix_bogus_link_args(self, args: T.List[str]) -> T.List[str]:
"""This function attempts to fix bogus link arguments that llvm-config
generates.
@@ -255,19 +254,20 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
"-L IBPATH:...", if we're using an msvc like compilers convert
that to "/LIBPATH", otherwise to "-L ..."
"""
- cpp = self.env.coredata.compilers[self.for_machine]['cpp']
new_args = []
for arg in args:
if arg.startswith('-l') and arg.endswith('.so'):
new_args.append(arg.lstrip('-l'))
elif arg.startswith('-LIBPATH:'):
+ cpp = self.env.coredata.compilers[self.for_machine]['cpp']
+ assert isinstance(cpp, CLikeCompiler)
new_args.extend(cpp.get_linker_search_args(arg.lstrip('-LIBPATH:')))
else:
new_args.append(arg)
return new_args
- def __check_libfiles(self, shared):
+ def __check_libfiles(self, shared: bool) -> None:
"""Use llvm-config's --libfiles to check if libraries exist."""
mode = '--link-shared' if shared else '--link-static'
@@ -283,7 +283,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
finally:
self.required = restore
- def _set_new_link_args(self, environment):
+ def _set_new_link_args(self, environment: 'Environment') -> None:
"""How to set linker args for LLVM versions >= 3.9"""
try:
mode = self.get_config_value(['--shared-mode'], 'link_args')[0]
@@ -338,7 +338,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
['--libs', '--ldflags'] + link_args + list(self.required_modules),
'link_args')
- def _set_old_link_args(self):
+ def _set_old_link_args(self) -> None:
"""Setting linker args for older versions of llvm.
Old versions of LLVM bring an extra level of insanity with them.
@@ -369,7 +369,7 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
raise DependencyException(
'Could not find a dynamically linkable library for LLVM.')
- def check_components(self, modules, required=True):
+ def check_components(self, modules: T.List[str], required: bool = True) -> None:
"""Check for llvm components (modules in meson terms).
The required option is whether the module is required, not whether LLVM
@@ -392,13 +392,13 @@ class LLVMDependencyConfigTool(ConfigToolDependency):
self.module_details.append(mod + status)
- def log_details(self):
+ def log_details(self) -> str:
if self.module_details:
return 'modules: ' + ', '.join(self.module_details)
return ''
class LLVMDependencyCMake(CMakeDependency):
- def __init__(self, name: str, env, kwargs):
+ def __init__(self, name: str, env: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
self.llvm_modules = stringlistify(extract_as_list(kwargs, 'modules'))
self.llvm_opt_modules = stringlistify(extract_as_list(kwargs, 'optional_modules'))
super().__init__(name, env, kwargs, language='cpp')
@@ -458,10 +458,10 @@ class ValgrindDependency(PkgConfigDependency):
Consumers of Valgrind usually only need the compile args and do not want to
link to its (static) libraries.
'''
- def __init__(self, env, kwargs):
+ def __init__(self, env: 'Environment', kwargs: T.Dict[str, T.Any]):
super().__init__('valgrind', env, kwargs)
- def get_link_args(self, **kwargs):
+ def get_link_args(self, language: T.Optional[str] = None, raw: bool = False) -> T.List[str]:
return []
@@ -510,7 +510,7 @@ class ZlibSystemDependency(ExternalDependency):
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.SYSTEM]
diff --git a/mesonbuild/dependencies/misc.py b/mesonbuild/dependencies/misc.py
index 52380f3..9bc279e 100644
--- a/mesonbuild/dependencies/misc.py
+++ b/mesonbuild/dependencies/misc.py
@@ -23,6 +23,7 @@ import typing as T
from .. import mlog
from .. import mesonlib
from ..environment import detect_cpu_family
+from ..compilers import CLikeCompiler
from .base import DependencyException, DependencyMethods, ExternalDependency
from .cmake import CMakeDependency
@@ -33,7 +34,6 @@ from .factory import DependencyFactory, factory_methods
if T.TYPE_CHECKING:
from ..environment import Environment, MachineChoice
from .factory import TV_DepGenerators
- from .base import DependencyType, Dependency # noqa: F401
@factory_methods({DependencyMethods.PKGCONFIG, DependencyMethods.CMAKE})
@@ -43,7 +43,7 @@ def netcdf_factory(env: 'Environment', for_machine: 'MachineChoice',
if language not in ('c', 'cpp', 'fortran'):
raise DependencyException(f'Language {language} is not supported with NetCDF.')
- candidates = [] # type: T.List['DependencyType']
+ candidates: 'TV_DepGenerators' = []
if DependencyMethods.PKGCONFIG in methods:
if language == 'fortran':
@@ -73,7 +73,7 @@ class OpenMPDependency(ExternalDependency):
'199810': '1.0',
}
- def __init__(self, environment, kwargs):
+ def __init__(self, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
language = kwargs.get('language')
super().__init__('openmp', environment, kwargs, language=language)
self.is_found = False
@@ -112,7 +112,7 @@ class OpenMPDependency(ExternalDependency):
class ThreadDependency(ExternalDependency):
- def __init__(self, name: str, environment, kwargs):
+ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
super().__init__(name, environment, kwargs)
self.is_found = True
# Happens if you are using a language with threads
@@ -125,12 +125,12 @@ class ThreadDependency(ExternalDependency):
self.link_args = self.clib_compiler.thread_link_flags(environment)
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.AUTO, DependencyMethods.CMAKE]
class BlocksDependency(ExternalDependency):
- def __init__(self, environment, kwargs):
+ def __init__(self, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
super().__init__('blocks', environment, kwargs)
self.name = 'blocks'
self.is_found = False
@@ -163,7 +163,7 @@ class BlocksDependency(ExternalDependency):
class Python3DependencySystem(ExternalDependency):
- def __init__(self, name, environment, kwargs):
+ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
super().__init__(name, environment, kwargs)
if not environment.machines.matches_build_machine(self.for_machine):
@@ -178,7 +178,7 @@ class Python3DependencySystem(ExternalDependency):
self._find_libpy3_windows(environment)
@staticmethod
- def get_windows_python_arch():
+ def get_windows_python_arch() -> T.Optional[str]:
pyplat = sysconfig.get_platform()
if pyplat == 'mingw':
pycc = sysconfig.get_config_var('CC')
@@ -197,7 +197,7 @@ class Python3DependencySystem(ExternalDependency):
mlog.log(f'Unknown Windows Python platform {pyplat!r}')
return None
- def get_windows_link_args(self):
+ def get_windows_link_args(self) -> T.Optional[T.List[str]]:
pyplat = sysconfig.get_platform()
if pyplat.startswith('win'):
vernum = sysconfig.get_config_var('py_version_nodot')
@@ -206,7 +206,7 @@ class Python3DependencySystem(ExternalDependency):
else:
comp = self.get_compiler()
if comp.id == "gcc":
- libpath = f'python{vernum}.dll'
+ libpath = Path(f'python{vernum}.dll')
else:
libpath = Path('libs') / f'python{vernum}.lib'
lib = Path(sysconfig.get_config_var('base')) / libpath
@@ -221,7 +221,7 @@ class Python3DependencySystem(ExternalDependency):
return None
return [str(lib)]
- def _find_libpy3_windows(self, env):
+ def _find_libpy3_windows(self, env: 'Environment') -> None:
'''
Find python3 libraries on Windows and also verify that the arch matches
what we are building for.
@@ -263,7 +263,7 @@ class Python3DependencySystem(ExternalDependency):
self.is_found = True
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
if mesonlib.is_windows():
return [DependencyMethods.PKGCONFIG, DependencyMethods.SYSCONFIG]
elif mesonlib.is_osx():
@@ -271,7 +271,7 @@ class Python3DependencySystem(ExternalDependency):
else:
return [DependencyMethods.PKGCONFIG]
- def log_tried(self):
+ def log_tried(self) -> str:
return 'sysconfig'
class PcapDependencyConfigTool(ConfigToolDependency):
@@ -288,19 +288,20 @@ class PcapDependencyConfigTool(ConfigToolDependency):
self.version = self.get_pcap_lib_version()
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]
- def get_pcap_lib_version(self):
+ def get_pcap_lib_version(self) -> T.Optional[str]:
# Since we seem to need to run a program to discover the pcap version,
# we can't do that when cross-compiling
# FIXME: this should be handled if we have an exe_wrapper
if not self.env.machines.matches_build_machine(self.for_machine):
return None
+ assert isinstance(self.clib_compiler, CLikeCompiler)
v = self.clib_compiler.get_return_value('pcap_lib_version', 'string',
'#include <pcap.h>', self.env, [], [self])
- v = re.sub(r'libpcap version ', '', v)
+ v = re.sub(r'libpcap version ', '', str(v))
v = re.sub(r' -- Apple version.*$', '', v)
return v
@@ -318,7 +319,7 @@ class CupsDependencyConfigTool(ConfigToolDependency):
self.link_args = self.get_config_value(['--ldflags', '--libs'], 'link_args')
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
if mesonlib.is_osx():
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK, DependencyMethods.CMAKE]
else:
@@ -338,7 +339,7 @@ class LibWmfDependencyConfigTool(ConfigToolDependency):
self.link_args = self.get_config_value(['--libs'], 'link_args')
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]
@@ -356,7 +357,7 @@ class LibGCryptDependencyConfigTool(ConfigToolDependency):
self.version = self.get_config_value(['--version'], 'version')[0]
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]
@@ -374,13 +375,13 @@ class GpgmeDependencyConfigTool(ConfigToolDependency):
self.version = self.get_config_value(['--version'], 'version')[0]
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL]
class ShadercDependency(ExternalDependency):
- def __init__(self, environment, kwargs):
+ def __init__(self, environment: 'Environment', kwargs: T.Dict[str, T.Any]):
super().__init__('shaderc', environment, kwargs)
static_lib = 'shaderc_combined'
@@ -403,11 +404,11 @@ class ShadercDependency(ExternalDependency):
break
- def log_tried(self):
+ def log_tried(self) -> str:
return 'system'
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.SYSTEM, DependencyMethods.PKGCONFIG]
@@ -518,7 +519,7 @@ def shaderc_factory(env: 'Environment', for_machine: 'MachineChoice',
thing are just easier to represent as a separate function than
twisting DependencyFactory even more.
"""
- candidates = [] # type: T.List['DependencyType']
+ candidates: 'TV_DepGenerators' = []
if DependencyMethods.PKGCONFIG in methods:
# ShaderC packages their shared and static libs together
diff --git a/mesonbuild/dependencies/scalapack.py b/mesonbuild/dependencies/scalapack.py
index b19e98b..70dbbf0 100644
--- a/mesonbuild/dependencies/scalapack.py
+++ b/mesonbuild/dependencies/scalapack.py
@@ -32,7 +32,7 @@ if T.TYPE_CHECKING:
def scalapack_factory(env: 'Environment', for_machine: 'MachineChoice',
kwargs: T.Dict[str, T.Any],
methods: T.List[DependencyMethods]) -> 'TV_DepGenerators':
- candidates = []
+ candidates: 'TV_DepGenerators' = []
if DependencyMethods.PKGCONFIG in methods:
mkl = 'mkl-static-lp64-iomp' if kwargs.get('static', False) else 'mkl-dynamic-lp64-iomp'
@@ -96,9 +96,10 @@ class MKLPkgConfigDependency(PkgConfigDependency):
pass
if v:
+ assert isinstance(v, str)
self.version = v
- def _set_libs(self):
+ def _set_libs(self) -> None:
super()._set_libs()
if self.env.machines[self.for_machine].is_windows():
@@ -135,7 +136,7 @@ class MKLPkgConfigDependency(PkgConfigDependency):
self.link_args.insert(i, '-lmkl_scalapack_lp64')
self.link_args.insert(i + 1, '-lmkl_blacs_intelmpi_lp64')
- def _set_cargs(self):
+ def _set_cargs(self) -> None:
env = None
if self.language == 'fortran':
# gfortran doesn't appear to look in system paths for INCLUDE files,
diff --git a/mesonbuild/dependencies/ui.py b/mesonbuild/dependencies/ui.py
index 3d68e46..4eefd6e 100644
--- a/mesonbuild/dependencies/ui.py
+++ b/mesonbuild/dependencies/ui.py
@@ -35,7 +35,7 @@ if T.TYPE_CHECKING:
class GLDependencySystem(ExternalDependency):
- def __init__(self, name: str, environment, kwargs):
+ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
super().__init__(name, environment, kwargs)
if self.env.machines[self.for_machine].is_darwin():
@@ -52,13 +52,13 @@ class GLDependencySystem(ExternalDependency):
return
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
if mesonlib.is_osx() or mesonlib.is_windows():
return [DependencyMethods.PKGCONFIG, DependencyMethods.SYSTEM]
else:
return [DependencyMethods.PKGCONFIG]
- def log_tried(self):
+ def log_tried(self) -> str:
return 'system'
class GnuStepDependency(ConfigToolDependency):
@@ -66,7 +66,7 @@ class GnuStepDependency(ConfigToolDependency):
tools = ['gnustep-config']
tool_name = 'gnustep-config'
- def __init__(self, environment, kwargs):
+ def __init__(self, environment: 'Environment', kwargs: T.Dict[str, T.Any]) -> None:
super().__init__('gnustep', environment, kwargs, language='objc')
if not self.is_found:
return
@@ -77,7 +77,7 @@ class GnuStepDependency(ConfigToolDependency):
['--gui-libs' if 'gui' in self.modules else '--base-libs'],
'link_args'))
- def find_config(self, versions=None, returncode: int = 0):
+ def find_config(self, versions: T.Optional[T.List[str]] = None, returncode: int = 0) -> T.Tuple[T.Optional[T.List[str]], T.Optional[str]]:
tool = [self.tools[0]]
try:
p, out = Popen_safe(tool + ['--help'])[:2]
@@ -92,14 +92,16 @@ class GnuStepDependency(ConfigToolDependency):
return (tool, found_version)
- def weird_filter(self, elems):
+ @staticmethod
+ def weird_filter(elems: T.List[str]) -> T.List[str]:
"""When building packages, the output of the enclosing Make is
sometimes mixed among the subprocess output. I have no idea why. As a
hack filter out everything that is not a flag.
"""
return [e for e in elems if e.startswith('-')]
- def filter_args(self, args):
+ @staticmethod
+ def filter_args(args: T.List[str]) -> T.List[str]:
"""gnustep-config returns a bunch of garbage args such as -O2 and so
on. Drop everything that is not needed.
"""
@@ -113,7 +115,7 @@ class GnuStepDependency(ConfigToolDependency):
result.append(f)
return result
- def detect_version(self):
+ def detect_version(self) -> str:
gmake = self.get_config_value(['--variable=GNUMAKE'], 'variable')[0]
makefile_dir = self.get_config_value(['--variable=GNUSTEP_MAKEFILES'], 'variable')[0]
# This Makefile has the GNUStep version set
@@ -149,7 +151,7 @@ class SDL2DependencyConfigTool(ConfigToolDependency):
self.link_args = self.get_config_value(['--libs'], 'link_args')
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
if mesonlib.is_osx():
return [DependencyMethods.PKGCONFIG, DependencyMethods.CONFIG_TOOL, DependencyMethods.EXTRAFRAMEWORK]
else:
@@ -196,7 +198,7 @@ class WxDependency(ConfigToolDependency):
class VulkanDependencySystem(ExternalDependency):
- def __init__(self, name: str, environment, kwargs, language: T.Optional[str] = None):
+ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.Any], language: T.Optional[str] = None) -> None:
super().__init__(name, environment, kwargs, language=language)
try:
@@ -223,7 +225,7 @@ class VulkanDependencySystem(ExternalDependency):
inc_path = os.path.join(self.vulkan_sdk, inc_dir)
header = os.path.join(inc_path, 'vulkan', 'vulkan.h')
lib_path = os.path.join(self.vulkan_sdk, lib_dir)
- find_lib = self.clib_compiler.find_library(lib_name, environment, lib_path)
+ find_lib = self.clib_compiler.find_library(lib_name, environment, [lib_path])
if not find_lib:
raise DependencyException('VULKAN_SDK point to invalid directory (no lib)')
@@ -251,10 +253,10 @@ class VulkanDependencySystem(ExternalDependency):
return
@staticmethod
- def get_methods():
+ def get_methods() -> T.List[DependencyMethods]:
return [DependencyMethods.SYSTEM]
- def log_tried(self):
+ def log_tried(self) -> str:
return 'system'
gl_factory = DependencyFactory(
diff --git a/run_mypy.py b/run_mypy.py
index da79980..cbe7ebb 100755
--- a/run_mypy.py
+++ b/run_mypy.py
@@ -12,28 +12,13 @@ modules = [
'mesonbuild/ast',
'mesonbuild/cmake',
'mesonbuild/compilers',
+ 'mesonbuild/dependencies',
'mesonbuild/scripts',
'mesonbuild/wrap',
# specific files
'mesonbuild/arglist.py',
# 'mesonbuild/coredata.py',
- 'mesonbuild/dependencies/__init__.py',
- 'mesonbuild/dependencies/factory.py',
- 'mesonbuild/dependencies/base.py',
- 'mesonbuild/dependencies/cmake.py',
- 'mesonbuild/dependencies/coarrays.py',
- 'mesonbuild/dependencies/configtool.py',
- 'mesonbuild/dependencies/dub.py',
- 'mesonbuild/dependencies/platform.py',
- 'mesonbuild/dependencies/cuda.py',
- 'mesonbuild/dependencies/detect.py',
- 'mesonbuild/dependencies/boost.py',
- 'mesonbuild/dependencies/framework.py',
- 'mesonbuild/dependencies/hdf5.py',
- 'mesonbuild/dependencies/mpi.py',
- 'mesonbuild/dependencies/pkgconfig.py',
- 'mesonbuild/dependencies/qt.py',
'mesonbuild/envconfig.py',
'mesonbuild/interpreterbase.py',
'mesonbuild/linkers.py',