arglist: Fix remaining mypy errors and warnings

So we can lint it with mypy
pull/7369/head
Dylan Baker 5 years ago
parent 4f6bd29ac9
commit d42cd735a4
  1. 2
      .github/workflows/lint_mypy.yml
  2. 7
      mesonbuild/arglist.py

@ -31,4 +31,4 @@ jobs:
with:
python-version: '3.x'
- run: python -m pip install mypy
- run: mypy --follow-imports=skip mesonbuild/interpreterbase.py mesonbuild/mtest.py mesonbuild/minit.py mesonbuild/mintro.py mesonbuild/mparser.py mesonbuild/msetup.py mesonbuild/ast mesonbuild/wrap tools/ mesonbuild/modules/fs.py mesonbuild/dependencies/boost.py mesonbuild/dependencies/mpi.py mesonbuild/dependencies/hdf5.py mesonbuild/compilers/mixins/intel.py mesonbuild/mlog.py mesonbuild/mcompile.py mesonbuild/mesonlib.py
- run: mypy --follow-imports=skip mesonbuild/interpreterbase.py mesonbuild/mtest.py mesonbuild/minit.py mesonbuild/mintro.py mesonbuild/mparser.py mesonbuild/msetup.py mesonbuild/ast mesonbuild/wrap tools/ mesonbuild/modules/fs.py mesonbuild/dependencies/boost.py mesonbuild/dependencies/mpi.py mesonbuild/dependencies/hdf5.py mesonbuild/compilers/mixins/intel.py mesonbuild/mlog.py mesonbuild/mcompile.py mesonbuild/mesonlib.py mesonbuild/arglist.py

@ -26,7 +26,6 @@ if T.TYPE_CHECKING:
from .linkers import StaticLinker
from .compilers import Compiler
UNIXY_COMPILER_INTERNAL_LIBS = ['m', 'c', 'pthread', 'dl', 'rt'] # type: T.List[str]
# execinfo is a compiler lib on FreeBSD and NetBSD
if mesonlib.is_freebsd() or mesonlib.is_netbsd():
@ -159,7 +158,7 @@ class CompilerArgs(collections.abc.MutableSequence):
pass
@T.overload # noqa: F811
def __getitem__(self, index: slice) -> T.List[str]: # noqa: F811
def __getitem__(self, index: slice) -> T.MutableSequence[str]: # noqa: F811
pass
def __getitem__(self, index): # noqa: F811
@ -171,7 +170,7 @@ class CompilerArgs(collections.abc.MutableSequence):
pass
@T.overload # noqa: F811
def __setitem__(self, index: slice, value: T.List[str]) -> None: # noqa: F811
def __setitem__(self, index: slice, value: T.Iterable[str]) -> None: # noqa: F811
pass
def __setitem__(self, index, value) -> None: # noqa: F811
@ -312,7 +311,7 @@ class CompilerArgs(collections.abc.MutableSequence):
new += self
return new
def __eq__(self, other: T.Any) -> T.Union[bool, type(NotImplemented)]:
def __eq__(self, other: T.Any) -> T.Union[bool]:
self.flush_pre_post()
# Only allow equality checks against other CompilerArgs and lists instances
if isinstance(other, CompilerArgs):

Loading…
Cancel
Save