diff --git a/mesonbuild/arglist.py b/mesonbuild/arglist.py index 4ab7d0990..b7fa749ee 100644 --- a/mesonbuild/arglist.py +++ b/mesonbuild/arglist.py @@ -164,7 +164,7 @@ class CompilerArgs(collections.abc.MutableSequence): def __getitem__(self, index: slice) -> T.MutableSequence[str]: # noqa: F811 pass - def __getitem__(self, index): # noqa: F811 + def __getitem__(self, index): # type: ignore # noqa: F811 self.flush_pre_post() return self._container[index] @@ -176,7 +176,7 @@ class CompilerArgs(collections.abc.MutableSequence): def __setitem__(self, index: slice, value: T.Iterable[str]) -> None: # noqa: F811 pass - def __setitem__(self, index, value) -> None: # noqa: F811 + def __setitem__(self, index, value) -> None: # type: ignore # noqa: F811 self.flush_pre_post() self._container[index] = value @@ -242,7 +242,7 @@ class CompilerArgs(collections.abc.MutableSequence): new = self.copy() else: new = self - return self.compiler.unix_args_to_native(new._container) + return T.cast(T.List[str], self.compiler.unix_args_to_native(new._container)) def append_direct(self, arg: str) -> None: ''' diff --git a/mesonbuild/compilers/mixins/intel.py b/mesonbuild/compilers/mixins/intel.py index fbbfdc54c..eb4b10d75 100644 --- a/mesonbuild/compilers/mixins/intel.py +++ b/mesonbuild/compilers/mixins/intel.py @@ -69,7 +69,7 @@ class IntelGnuLikeCompiler(GnuLikeCompiler): 's': ['-Os'], } - def __init__(self): + def __init__(self) -> None: super().__init__() # As of 19.0.0 ICC doesn't have sanitizer, color, or lto support. # @@ -152,7 +152,7 @@ class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler): super().__init__(target) self.id = 'intel-cl' - def compile(self, code, *, extra_args: T.Optional[T.List[str]] = None, **kwargs) -> T.Iterator['subprocess.Popen']: + def compile(self, code: str, *, extra_args: T.Optional[T.List[str]] = None, **kwargs) -> T.Iterator['subprocess.Popen']: # This covers a case that .get('foo', []) doesn't, that extra_args is if kwargs.get('mode', 'compile') != 'link': extra_args = extra_args.copy() if extra_args is not None else [] diff --git a/run_mypy.py b/run_mypy.py index 71b67270c..c7d44b606 100755 --- a/run_mypy.py +++ b/run_mypy.py @@ -40,6 +40,8 @@ strict_modules = [ 'mesonbuild/scripts', 'mesonbuild/dependencies/boost.py', 'mesonbuild/dependencies/hdf5.py', + 'mesonbuild/compilers/mixins/intel.py', + 'mesonbuild/arglist.py', 'run_mypy.py', 'tools', ]