diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2020-09-21 12:48:51 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2020-09-24 12:14:13 -0700 |
commit | 682d22129c32edc64c610478368e1bc1f1dbc921 (patch) | |
tree | 093f5e8b064772ee3f0811c81123bb0df872bfee /mesonbuild/compilers/mixins/intel.py | |
parent | 2c0fbe161d61d2d15d29892456544442ab1c4ff6 (diff) | |
download | meson-682d22129c32edc64c610478368e1bc1f1dbc921.zip meson-682d22129c32edc64c610478368e1bc1f1dbc921.tar.gz meson-682d22129c32edc64c610478368e1bc1f1dbc921.tar.bz2 |
compilers: Tell mypy that the compiler mixins are just that
We do this by making the mixins inherit the Compiler class only when
mypy is examining the code (using some clever inheritance shenanigans).
This caught a bunch of issues, and also lets us delete a ton of code.
Diffstat (limited to 'mesonbuild/compilers/mixins/intel.py')
-rw-r--r-- | mesonbuild/compilers/mixins/intel.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/mesonbuild/compilers/mixins/intel.py b/mesonbuild/compilers/mixins/intel.py index cbbfc7a..b83e5c4 100644 --- a/mesonbuild/compilers/mixins/intel.py +++ b/mesonbuild/compilers/mixins/intel.py @@ -28,8 +28,6 @@ from .gnu import GnuLikeCompiler from .visualstudio import VisualStudioLikeCompiler if T.TYPE_CHECKING: - import subprocess # noqa: F401 - from ...arglist import CompilerArgs from ...dependencies import Dependency from ...environment import Environment @@ -115,8 +113,7 @@ class IntelGnuLikeCompiler(GnuLikeCompiler): '-diag-error', '10157', # Ignoring argument of the wrong type '-diag-error', '10158', # Argument must be separate. Can be hit by trying an option like -foo-bar=foo when -foo=bar is a valid option but -foo-bar isn't ] - ret = super().compiles(code, env, extra_args=extra_args, dependencies=dependencies, mode=mode, disable_cache=disable_cache) # type: ignore - return T.cast(T.Tuple[bool, bool], ret) + return super().compiles(code, env, extra_args=extra_args, dependencies=dependencies, mode=mode, disable_cache=disable_cache) def get_profile_generate_args(self) -> T.List[str]: return ['-prof-gen=threadsafe'] @@ -176,8 +173,7 @@ class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler): '/Qdiag-error:10157', # Ignoring argument of the wrong type '/Qdiag-error:10158', # Argument must be separate. Can be hit by trying an option like -foo-bar=foo when -foo=bar is a valid option but -foo-bar isn't ]) - ret = super().compiles(code, env, extra_args=extra_args, dependencies=dependencies, mode=mode, disable_cache=disable_cache) # type: ignore - return T.cast(T.Tuple[bool, bool], ret) + return super().compiles(code, env, extra_args=extra_args, dependencies=dependencies, mode=mode, disable_cache=disable_cache) def get_toolset_version(self) -> T.Optional[str]: # Avoid circular dependencies.... |