apply flake8 fixes for unused imports and missing imports

pull/9256/head
Eli Schwartz 4 years ago
parent 6cc1b8441c
commit 87e13af1c8
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 2
      .flake8
  2. 2
      mesonbuild/backend/ninjabackend.py
  3. 1
      mesonbuild/cmake/toolchain.py
  4. 4
      mesonbuild/compilers/compilers.py
  5. 1
      mesonbuild/compilers/detect.py
  6. 5
      mesonbuild/compilers/mixins/intel.py
  7. 8
      mesonbuild/coredata.py
  8. 2
      mesonbuild/dependencies/detect.py
  9. 1
      mesonbuild/dependencies/hdf5.py
  10. 2
      mesonbuild/modules/__init__.py
  11. 3
      mesonbuild/modules/unstable_cuda.py

@ -28,4 +28,6 @@ ignore =
W504, W504,
# A003: builtin class attribute # A003: builtin class attribute
A003 A003
per-file-ignores =
mesonbuild/mesonlib/__init__.py:F401
max-line-length = 120 max-line-length = 120

@ -53,7 +53,7 @@ from ..mesonmain import need_setup_vsenv
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from .._typing import ImmutableListProtocol from .._typing import ImmutableListProtocol
from ..linkers import StaticLinker from ..linkers import DynamicLinker, StaticLinker
from ..compilers.cs import CsCompiler from ..compilers.cs import CsCompiler

@ -26,7 +26,6 @@ from textwrap import dedent
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from .executor import CMakeExecutor from .executor import CMakeExecutor
from ..envconfig import MachineInfo, Properties, CMakeVariables
from ..environment import Environment from ..environment import Environment
class CMakeExecScope(Enum): class CMakeExecScope(Enum):

@ -32,13 +32,13 @@ from ..arglist import CompilerArgs
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from ..build import BuildTarget from ..build import BuildTarget
from ..coredata import OptionDictType, KeyedOptionDictType from ..coredata import KeyedOptionDictType
from ..envconfig import MachineInfo from ..envconfig import MachineInfo
from ..environment import Environment from ..environment import Environment
from ..linkers import DynamicLinker, RSPFileSyntax from ..linkers import DynamicLinker, RSPFileSyntax
from ..dependencies import Dependency from ..dependencies import Dependency
CompilerType = T.TypeVar('CompilerType', bound=Compiler) CompilerType = T.TypeVar('CompilerType', bound='Compiler')
_T = T.TypeVar('_T') _T = T.TypeVar('_T')
"""This file contains the data files of all compilers Meson knows """This file contains the data files of all compilers Meson knows

@ -142,7 +142,6 @@ import typing as T
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from ..environment import Environment from ..environment import Environment
from ..programs import ExternalProgram from ..programs import ExternalProgram
from .compilers import CompilerType

@ -28,11 +28,6 @@ from ..compilers import CompileCheckMode
from .gnu import GnuLikeCompiler from .gnu import GnuLikeCompiler
from .visualstudio import VisualStudioLikeCompiler from .visualstudio import VisualStudioLikeCompiler
if T.TYPE_CHECKING:
from ...arglist import CompilerArgs
from ...dependencies import Dependency
from ...environment import Environment
# XXX: avoid circular dependencies # XXX: avoid circular dependencies
# TODO: this belongs in a posix compiler class # TODO: this belongs in a posix compiler class
# NOTE: the default Intel optimization is -O2, unlike GNU which defaults to -O0. # NOTE: the default Intel optimization is -O2, unlike GNU which defaults to -O0.

@ -34,14 +34,14 @@ import typing as T
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from . import dependencies from . import dependencies
from .compilers.compilers import Compiler from .compilers.compilers import Compiler, CompileResult
from .environment import Environment from .environment import Environment
from .mesonlib import OptionOverrideProxy, FileOrString from .mesonlib import OptionOverrideProxy, FileOrString
from .cmake.traceparser import CMakeCacheEntry from .cmake.traceparser import CMakeCacheEntry
OptionDictType = T.Union[T.Dict[str, 'UserOption[T.Any]'], OptionOverrideProxy] OptionDictType = T.Union[T.Dict[str, 'UserOption[T.Any]'], OptionOverrideProxy]
KeyedOptionDictType = T.Union[T.Dict['OptionKey', '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' version = '0.59.99'
backendlist = ['ninja', 'vs', 'vs2010', 'vs2012', 'vs2013', 'vs2015', 'vs2017', 'vs2019', 'xcode'] backendlist = ['ninja', 'vs', 'vs2010', 'vs2012', 'vs2013', 'vs2015', 'vs2017', 'vs2019', 'xcode']
@ -267,7 +267,7 @@ class UserFeatureOption(UserComboOption):
return self.value == 'auto' return self.value == 'auto'
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from .dependencies.detect import TV_DepIDEntry, TV_DepID from .dependencies.detect import TV_DepID
class DependencyCacheType(enum.Enum): class DependencyCacheType(enum.Enum):
@ -442,7 +442,7 @@ class CoreData:
DependencyCache(self.options, MachineChoice.BUILD), DependencyCache(self.options, MachineChoice.BUILD),
DependencyCache(self.options, MachineChoice.HOST)) 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 # CMake cache
self.cmake_cache: PerMachine[CMakeStateCache] = PerMachine(CMakeStateCache(), CMakeStateCache()) self.cmake_cache: PerMachine[CMakeStateCache] = PerMachine(CMakeStateCache(), CMakeStateCache())

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from .base import Dependency, ExternalDependency, DependencyException, DependencyMethods, NotFoundDependency from .base import ExternalDependency, DependencyException, DependencyMethods, NotFoundDependency
from .cmake import CMakeDependency from .cmake import CMakeDependency
from .dub import DubDependency from .dub import DubDependency
from .framework import ExtraFrameworkDependency from .framework import ExtraFrameworkDependency

@ -29,7 +29,6 @@ from .factory import factory_methods
import typing as T import typing as T
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from .base import Dependency
from .factory import DependencyGenerator from .factory import DependencyGenerator
from ..environment import Environment from ..environment import Environment
from ..mesonlib import MachineChoice from ..mesonlib import MachineChoice

@ -22,7 +22,7 @@ from ..mesonlib import relpath, HoldableObject
from ..interpreterbase.decorators import noKwargs, noPosargs from ..interpreterbase.decorators import noKwargs, noPosargs
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from ..interpreter import Interpreter, MachineHolder from ..interpreter import Interpreter
from ..interpreterbase import TYPE_var, TYPE_kwargs from ..interpreterbase import TYPE_var, TYPE_kwargs
from ..programs import ExternalProgram from ..programs import ExternalProgram

@ -25,6 +25,9 @@ from ..interpreterbase import (
InvalidArguments, FeatureNew InvalidArguments, FeatureNew
) )
if T.TYPE_CHECKING:
from . import ModuleState
class CudaModule(NewExtensionModule): class CudaModule(NewExtensionModule):
@FeatureNew('CUDA module', '0.50.0') @FeatureNew('CUDA module', '0.50.0')

Loading…
Cancel
Save