Skip to content

Commit 8650ab3

Browse files
mattipseiko2plus
authored andcommitted
fix long-standing linting problems
1 parent c1d25c8 commit 8650ab3

2 files changed

Lines changed: 10 additions & 15 deletions

File tree

mesonbuild/dependencies/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
ExternalLibrary, DependencyException, DependencyMethods,
88
BuiltinDependency, SystemDependency, get_leaf_external_dependencies)
99
from .detect import find_external_dependency, get_dep_identifier, packages, _packages_accept_language
10-
from .blas_lapack import openblas_factory
1110

1211

1312
__all__ = [

mesonbuild/dependencies/blas_lapack.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,15 @@
2525
from .. import mesonlib
2626
from ..mesonlib import MachineChoice, OptionKey
2727

28-
from .base import DependencyMethods, SystemDependency
28+
from .base import DependencyMethods, SystemDependency, DependencyException
2929
from .cmake import CMakeDependency
3030
from .detect import packages
3131
from .factory import DependencyFactory, factory_methods
3232
from .pkgconfig import PkgConfigDependency
3333

3434
if T.TYPE_CHECKING:
3535
from ..environment import Environment
36+
from . factory import DependencyGenerator
3637

3738
"""
3839
TODO: how to select BLAS interface layer (LP64, ILP64)?
@@ -302,7 +303,7 @@
302303
"""
303304

304305

305-
def check_blas_machine_file(self, name: str, props: dict) -> T.Tuple[bool, T.List[str]]:
306+
def check_blas_machine_file(name: str, props: dict) -> T.Tuple[bool, T.List[str]]:
306307
# TBD: do we need to support multiple extra dirs?
307308
incdir = props.get(f'{name}_includedir')
308309
assert incdir is None or isinstance(incdir, str)
@@ -363,11 +364,11 @@ def check_symbols(self, compile_args, suffix=None, check_cblas=True,
363364
prototypes = "".join(f"void {symbol}{suffix}();\n" for symbol in symbols)
364365
calls = " ".join(f"{symbol}{suffix}();\n" for symbol in symbols)
365366
code = (f"{prototypes}"
366-
"int main(int argc, const char *argv[])\n"
367-
"{\n"
367+
"int main(int argc, const char *argv[])\n"
368+
"{\n"
368369
f" {calls}"
369-
" return 0;\n"
370-
"}"
370+
" return 0;\n"
371+
"}"
371372
)
372373
code = '''#ifdef __cplusplus
373374
extern "C" {
@@ -719,7 +720,6 @@ def detect_lapack_machine_file(self, props: dict) -> None:
719720
self.detect([libdir], [incdir])
720721

721722

722-
723723
class AccelerateSystemDependency(BLASLAPACKMixin, SystemDependency):
724724
"""
725725
Accelerate is always installed on macOS, and not available on other OSes.
@@ -765,7 +765,6 @@ def detect(self, kwargs: T.Dict[str, T.Any]) -> None:
765765

766766
# We won't check symbols here, because Accelerate is built in a consistent fashion
767767
# with known symbol mangling, unlike OpenBLAS or Netlib BLAS/LAPACK.
768-
return None
769768

770769
def get_symbol_suffix(self) -> str:
771770
return '$NEWLAPACK' if self.interface == 'lp64' else '$NEWLAPACK$ILP64'
@@ -788,7 +787,7 @@ def parse_mkl_options(self, kwargs: T.Dict[str, T.Any]) -> None:
788787
if not threading_module:
789788
self.threading = 'iomp'
790789
elif len(threading_module) > 1:
791-
raise mesonlib.MesonException(f'Multiple threading arguments: {threading_modules}')
790+
raise mesonlib.MesonException(f'Multiple threading arguments: {threading_module}')
792791
else:
793792
# We have a single threading option specified - validate and process it
794793
opt = threading_module[0]
@@ -802,7 +801,7 @@ def parse_mkl_options(self, kwargs: T.Dict[str, T.Any]) -> None:
802801
if not sdl_module:
803802
self.use_sdl = 'auto'
804803
elif len(sdl_module) > 1:
805-
raise mesonlib.MesonException(f'Multiple sdl arguments: {threading_modules}')
804+
raise mesonlib.MesonException(f'Multiple sdl arguments: {threading_module}')
806805
else:
807806
# We have a single sdl option specified - validate and process it
808807
opt = sdl_module[0]
@@ -829,8 +828,6 @@ def parse_mkl_options(self, kwargs: T.Dict[str, T.Any]) -> None:
829828
raise mesonlib.MesonException(f'Linking SDL implies using LP64 and Intel OpenMP, found '
830829
f'conflicting options: {self.interface}, {self.threading}')
831830

832-
return None
833-
834831

835832
class MKLPkgConfigDependency(BLASLAPACKMixin, MKLMixin, PkgConfigDependency):
836833
"""
@@ -880,7 +877,6 @@ def __init__(self, name: str, environment: 'Environment', kwargs: T.Dict[str, T.
880877

881878
if self.use_sdl:
882879
self.detect_sdl()
883-
return None
884880

885881
def detect_sdl(self) -> None:
886882
# Use MKLROOT in addition to standard libdir(s)
@@ -910,7 +906,7 @@ def detect_sdl(self) -> None:
910906
self.is_found = True
911907
self.compile_args += incdir_args
912908
self.link_args += link_arg
913-
if not sys.platform == 'win32':
909+
if sys.platform != 'win32':
914910
self.link_args += ['-lpthread', '-lm', '-ldl']
915911

916912
# Determine MKL version

0 commit comments

Comments
 (0)