diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-09-14 01:22:21 -0400 |
---|---|---|
committer | Eli Schwartz <eschwartz@archlinux.org> | 2021-09-14 15:55:07 -0400 |
commit | 87e13af1c85c037079ad5e286975fb5be32d821c (patch) | |
tree | a8c69a73f9f9da20f04da39e70510fb5c84b3407 /mesonbuild | |
parent | 6cc1b8441c0cf7428e52bdf1cd541ea830a4eb83 (diff) | |
download | meson-87e13af1c85c037079ad5e286975fb5be32d821c.zip meson-87e13af1c85c037079ad5e286975fb5be32d821c.tar.gz meson-87e13af1c85c037079ad5e286975fb5be32d821c.tar.bz2 |
apply flake8 fixes for unused imports and missing imports
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/backend/ninjabackend.py | 2 | ||||
-rw-r--r-- | mesonbuild/cmake/toolchain.py | 1 | ||||
-rw-r--r-- | mesonbuild/compilers/compilers.py | 4 | ||||
-rw-r--r-- | mesonbuild/compilers/detect.py | 1 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/intel.py | 7 | ||||
-rw-r--r-- | mesonbuild/coredata.py | 8 | ||||
-rw-r--r-- | mesonbuild/dependencies/detect.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies/hdf5.py | 1 | ||||
-rw-r--r-- | mesonbuild/modules/__init__.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/unstable_cuda.py | 3 |
10 files changed, 13 insertions, 18 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 204510e..a15607a 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -53,7 +53,7 @@ from ..mesonmain import need_setup_vsenv if T.TYPE_CHECKING: from .._typing import ImmutableListProtocol - from ..linkers import StaticLinker + from ..linkers import DynamicLinker, StaticLinker from ..compilers.cs import CsCompiler diff --git a/mesonbuild/cmake/toolchain.py b/mesonbuild/cmake/toolchain.py index 1a6dcf0..50ff10c 100644 --- a/mesonbuild/cmake/toolchain.py +++ b/mesonbuild/cmake/toolchain.py @@ -26,7 +26,6 @@ from textwrap import dedent if T.TYPE_CHECKING: from .executor import CMakeExecutor - from ..envconfig import MachineInfo, Properties, CMakeVariables from ..environment import Environment class CMakeExecScope(Enum): diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py index ed77df6..de5e472 100644 --- a/mesonbuild/compilers/compilers.py +++ b/mesonbuild/compilers/compilers.py @@ -32,13 +32,13 @@ from ..arglist import CompilerArgs if T.TYPE_CHECKING: from ..build import BuildTarget - from ..coredata import OptionDictType, KeyedOptionDictType + from ..coredata import KeyedOptionDictType from ..envconfig import MachineInfo from ..environment import Environment from ..linkers import DynamicLinker, RSPFileSyntax from ..dependencies import Dependency - CompilerType = T.TypeVar('CompilerType', bound=Compiler) + CompilerType = T.TypeVar('CompilerType', bound='Compiler') _T = T.TypeVar('_T') """This file contains the data files of all compilers Meson knows diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index de1845a..59b425b 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -142,7 +142,6 @@ import typing as T if T.TYPE_CHECKING: from ..environment import Environment from ..programs import ExternalProgram - from .compilers import CompilerType diff --git a/mesonbuild/compilers/mixins/intel.py b/mesonbuild/compilers/mixins/intel.py index 89f3518..1417743 100644 --- a/mesonbuild/compilers/mixins/intel.py +++ b/mesonbuild/compilers/mixins/intel.py @@ -28,11 +28,6 @@ from ..compilers import CompileCheckMode from .gnu import GnuLikeCompiler from .visualstudio import VisualStudioLikeCompiler -if T.TYPE_CHECKING: - from ...arglist import CompilerArgs - from ...dependencies import Dependency - from ...environment import Environment - # XXX: avoid circular dependencies # TODO: this belongs in a posix compiler class # NOTE: the default Intel optimization is -O2, unlike GNU which defaults to -O0. @@ -186,4 +181,4 @@ class IntelVisualStudioLikeCompiler(VisualStudioLikeCompiler): return self.OPTIM_ARGS[optimization_level] def get_pch_base_name(self, header: str) -> str: - return os.path.basename(header)
\ No newline at end of file + return os.path.basename(header) diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index d0165c4..20a4ccb 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -34,14 +34,14 @@ import typing as T if T.TYPE_CHECKING: from . import dependencies - from .compilers.compilers import Compiler + from .compilers.compilers import Compiler, CompileResult from .environment import Environment from .mesonlib import OptionOverrideProxy, FileOrString from .cmake.traceparser import CMakeCacheEntry OptionDictType = T.Union[T.Dict[str, 'UserOption[T.Any]'], OptionOverrideProxy] KeyedOptionDictType = T.Union[T.Dict['OptionKey', 'UserOption[T.Any]'], OptionOverrideProxy] - CompilerCheckCacheKey = T.Tuple[T.Tuple[str, ...], str, 'FileOrString', T.Tuple[str, ...], str] + CompilerCheckCacheKey = T.Tuple[T.Tuple[str, ...], str, FileOrString, T.Tuple[str, ...], str] version = '0.59.99' backendlist = ['ninja', 'vs', 'vs2010', 'vs2012', 'vs2013', 'vs2015', 'vs2017', 'vs2019', 'xcode'] @@ -267,7 +267,7 @@ class UserFeatureOption(UserComboOption): return self.value == 'auto' if T.TYPE_CHECKING: - from .dependencies.detect import TV_DepIDEntry, TV_DepID + from .dependencies.detect import TV_DepID class DependencyCacheType(enum.Enum): @@ -442,7 +442,7 @@ class CoreData: DependencyCache(self.options, MachineChoice.BUILD), DependencyCache(self.options, MachineChoice.HOST)) - self.compiler_check_cache = OrderedDict() # type: T.Dict[CompilerCheckCacheKey, compiler.CompileResult] + self.compiler_check_cache: T.Dict['CompilerCheckCacheKey', 'CompileResult'] = OrderedDict() # CMake cache self.cmake_cache: PerMachine[CMakeStateCache] = PerMachine(CMakeStateCache(), CMakeStateCache()) diff --git a/mesonbuild/dependencies/detect.py b/mesonbuild/dependencies/detect.py index 3dc2e3f..ede76c9 100644 --- a/mesonbuild/dependencies/detect.py +++ b/mesonbuild/dependencies/detect.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -from .base import Dependency, ExternalDependency, DependencyException, DependencyMethods, NotFoundDependency +from .base import ExternalDependency, DependencyException, DependencyMethods, NotFoundDependency from .cmake import CMakeDependency from .dub import DubDependency from .framework import ExtraFrameworkDependency diff --git a/mesonbuild/dependencies/hdf5.py b/mesonbuild/dependencies/hdf5.py index c062e71..9687b36 100644 --- a/mesonbuild/dependencies/hdf5.py +++ b/mesonbuild/dependencies/hdf5.py @@ -29,7 +29,6 @@ from .factory import factory_methods import typing as T if T.TYPE_CHECKING: - from .base import Dependency from .factory import DependencyGenerator from ..environment import Environment from ..mesonlib import MachineChoice diff --git a/mesonbuild/modules/__init__.py b/mesonbuild/modules/__init__.py index 652110e..8f64120 100644 --- a/mesonbuild/modules/__init__.py +++ b/mesonbuild/modules/__init__.py @@ -22,7 +22,7 @@ from ..mesonlib import relpath, HoldableObject from ..interpreterbase.decorators import noKwargs, noPosargs if T.TYPE_CHECKING: - from ..interpreter import Interpreter, MachineHolder + from ..interpreter import Interpreter from ..interpreterbase import TYPE_var, TYPE_kwargs from ..programs import ExternalProgram diff --git a/mesonbuild/modules/unstable_cuda.py b/mesonbuild/modules/unstable_cuda.py index 9e8aa63..920457d 100644 --- a/mesonbuild/modules/unstable_cuda.py +++ b/mesonbuild/modules/unstable_cuda.py @@ -25,6 +25,9 @@ from ..interpreterbase import ( InvalidArguments, FeatureNew ) +if T.TYPE_CHECKING: + from . import ModuleState + class CudaModule(NewExtensionModule): @FeatureNew('CUDA module', '0.50.0') |