diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-06-15 11:49:40 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-06-22 12:06:10 -0700 |
commit | d42cd735a4dc894d8e898a5f9e81029f6eb5364c (patch) | |
tree | 05297f403ffa2591b3b5583826472cad129d616e | |
parent | 4f6bd29ac9c697e042a2a808344f1db3efd1d6cb (diff) | |
download | meson-d42cd735a4dc894d8e898a5f9e81029f6eb5364c.tar.gz |
arglist: Fix remaining mypy errors and warnings
So we can lint it with mypy
-rw-r--r-- | .github/workflows/lint_mypy.yml | 2 | ||||
-rw-r--r-- | mesonbuild/arglist.py | 9 |
2 files changed, 5 insertions, 6 deletions
diff --git a/.github/workflows/lint_mypy.yml b/.github/workflows/lint_mypy.yml index 7afee2e4a..056f96e39 100644 --- a/.github/workflows/lint_mypy.yml +++ b/.github/workflows/lint_mypy.yml @@ -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 diff --git a/mesonbuild/arglist.py b/mesonbuild/arglist.py index bb16f38fc..fd4de96f1 100644 --- a/mesonbuild/arglist.py +++ b/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(): @@ -158,8 +157,8 @@ class CompilerArgs(collections.abc.MutableSequence): def __getitem__(self, index: int) -> str: # noqa: F811 pass - @T.overload # noqa: F811 - def __getitem__(self, index: slice) -> T.List[str]: # noqa: F811 + @T.overload # 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): |