aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorEli Schwartz <eschwartz@archlinux.org>2022-02-16 19:55:46 -0500
committerEli Schwartz <eschwartz@archlinux.org>2022-02-16 23:00:31 -0500
commit9daaece7850cdd378163cd50bc524693f5294309 (patch)
tree80ca0ec55fbe6829f99e84fdfa3a1415985c3351 /mesonbuild
parent0d6972887f1b7d39524c5faff0b3c8612b5d0ece (diff)
downloadmeson-9daaece7850cdd378163cd50bc524693f5294309.zip
meson-9daaece7850cdd378163cd50bc524693f5294309.tar.gz
meson-9daaece7850cdd378163cd50bc524693f5294309.tar.bz2
flake8: fix various whitespace errors with badly aligned code
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/backend/backends.py2
-rw-r--r--mesonbuild/build.py16
-rw-r--r--mesonbuild/compilers/compilers.py2
-rw-r--r--mesonbuild/compilers/detect.py3
-rw-r--r--mesonbuild/compilers/mixins/clang.py2
-rw-r--r--mesonbuild/compilers/mixins/pgi.py11
-rw-r--r--mesonbuild/interpreter/type_checking.py4
-rw-r--r--mesonbuild/modules/gnome.py15
8 files changed, 28 insertions, 27 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 2efae0f..eb17f92 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -1386,7 +1386,7 @@ class Backend:
def eval_custom_target_command(
self, target: build.CustomTarget, absolute_outputs: bool = False) -> \
- T.Tuple[T.List[str], T.List[str], T.List[str]]:
+ T.Tuple[T.List[str], T.List[str], T.List[str]]:
# We want the outputs to be absolute only when using the VS backend
# XXX: Maybe allow the vs backend to use relative paths too?
source_root = self.build_to_src
diff --git a/mesonbuild/build.py b/mesonbuild/build.py
index 0ffb629..c77c420 100644
--- a/mesonbuild/build.py
+++ b/mesonbuild/build.py
@@ -1345,8 +1345,8 @@ You probably should put it in link_with instead.''')
if isinstance(t, (CustomTarget, CustomTargetIndex)):
if not t.should_install():
mlog.warning(f'Try to link an installed static library target {self.name} with a'
- 'custom target that is not installed, this might cause problems'
- 'when you try to use this static library')
+ 'custom target that is not installed, this might cause problems'
+ 'when you try to use this static library')
elif t.is_internal():
# When we're a static library and we link_with to an
# internal/convenience library, promote to link_whole.
@@ -1600,12 +1600,12 @@ You probably should put it in link_with instead.''')
link_target.force_soname = True
else:
mlog.deprecation(f'target {self.name} links against shared module {link_target.name}, which is incorrect.'
- '\n '
- f'This will be an error in the future, so please use shared_library() for {link_target.name} instead.'
- '\n '
- f'If shared_module() was used for {link_target.name} because it has references to undefined symbols,'
- '\n '
- 'use shared_libary() with `override_options: [\'b_lundef=false\']` instead.')
+ '\n '
+ f'This will be an error in the future, so please use shared_library() for {link_target.name} instead.'
+ '\n '
+ f'If shared_module() was used for {link_target.name} because it has references to undefined symbols,'
+ '\n '
+ 'use shared_libary() with `override_options: [\'b_lundef=false\']` instead.')
link_target.force_soname = True
class Generator(HoldableObject):
diff --git a/mesonbuild/compilers/compilers.py b/mesonbuild/compilers/compilers.py
index b652f5a..7c0a2ec 100644
--- a/mesonbuild/compilers/compilers.py
+++ b/mesonbuild/compilers/compilers.py
@@ -1224,7 +1224,7 @@ class Compiler(HoldableObject, metaclass=abc.ABCMeta):
yield r
def compiles(self, code: 'mesonlib.FileOrString', env: 'Environment', *,
- extra_args: T.Union[None, T.List[str], CompilerArgs, T.Callable[[CompileCheckMode], T.List[str]]] = None,
+ extra_args: T.Union[None, T.List[str], CompilerArgs, T.Callable[[CompileCheckMode], T.List[str]]] = None,
dependencies: T.Optional[T.List['Dependency']] = None,
mode: str = 'compile',
disable_cache: bool = False) -> T.Tuple[bool, bool]:
diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py
index 1c91a33..6a595e1 100644
--- a/mesonbuild/compilers/detect.py
+++ b/mesonbuild/compilers/detect.py
@@ -255,8 +255,7 @@ def _get_compilers(env: 'Environment', lang: str, for_machine: MachineChoice) ->
def _handle_exceptions(
exceptions: T.Mapping[str, T.Union[Exception, str]],
binaries: T.List[T.List[str]],
- bintype: str = 'compiler'
- ) -> T.NoReturn:
+ bintype: str = 'compiler') -> T.NoReturn:
errmsg = f'Unknown {bintype}(s): {binaries}'
if exceptions:
errmsg += '\nThe following exception(s) were encountered:'
diff --git a/mesonbuild/compilers/mixins/clang.py b/mesonbuild/compilers/mixins/clang.py
index 663a87e..a823b1c 100644
--- a/mesonbuild/compilers/mixins/clang.py
+++ b/mesonbuild/compilers/mixins/clang.py
@@ -106,7 +106,7 @@ class ClangCompiler(GnuLikeCompiler):
if isinstance(self.linker, AppleDynamicLinker) and mesonlib.version_compare(self.version, '>=8.0'):
extra_args.append('-Wl,-no_weak_imports')
return super().has_function(funcname, prefix, env, extra_args=extra_args,
- dependencies=dependencies)
+ dependencies=dependencies)
def openmp_flags(self) -> T.List[str]:
if mesonlib.version_compare(self.version, '>=3.8.0'):
diff --git a/mesonbuild/compilers/mixins/pgi.py b/mesonbuild/compilers/mixins/pgi.py
index 2bc7012..d13e946 100644
--- a/mesonbuild/compilers/mixins/pgi.py
+++ b/mesonbuild/compilers/mixins/pgi.py
@@ -49,11 +49,12 @@ class PGICompiler(Compiler):
self.base_options = {OptionKey('b_pch')}
default_warn_args = ['-Minform=inform']
- self.warn_args = {'0': [],
- '1': default_warn_args,
- '2': default_warn_args,
- '3': default_warn_args
- } # type: T.Dict[str, T.List[str]]
+ self.warn_args: T.Dict[str, T.List[str]] = {
+ '0': [],
+ '1': default_warn_args,
+ '2': default_warn_args,
+ '3': default_warn_args
+ }
def get_module_incdir_args(self) -> T.Tuple[str]:
return ('-module', )
diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py
index 15fa61b..e94027b 100644
--- a/mesonbuild/interpreter/type_checking.py
+++ b/mesonbuild/interpreter/type_checking.py
@@ -287,8 +287,8 @@ CT_BUILD_BY_DEFAULT: KwargInfo[T.Optional[bool]] = KwargInfo('build_by_default',
CT_BUILD_ALWAYS: KwargInfo[T.Optional[bool]] = KwargInfo(
'build_always', (bool, NoneType),
- deprecated='0.47.0',
- deprecated_message='combine build_by_default and build_always_stale instead.',
+ deprecated='0.47.0',
+ deprecated_message='combine build_by_default and build_always_stale instead.',
)
CT_BUILD_ALWAYS_STALE: KwargInfo[T.Optional[bool]] = KwargInfo(
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index b7427b6..06a1f34 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -339,7 +339,8 @@ class GnomeModule(ExtensionModule):
# Normal program lookup
return state.find_program(name, required=required)
- @typed_kwargs('gnome.post_install',
+ @typed_kwargs(
+ 'gnome.post_install',
KwargInfo('glib_compile_schemas', bool, default=False),
KwargInfo('gio_querymodules', ContainerTypeInfo(list, str), default=[], listify=True),
KwargInfo('gtk_update_icon_cache', bool, default=False),
@@ -899,7 +900,7 @@ class GnomeModule(ExtensionModule):
libsources: T.Sequence[T.Union[
str, mesonlib.File, build.GeneratedList,
build.CustomTarget, build.CustomTargetIndex]]
- ) -> str:
+ ) -> str:
gir_filelist_dir = state.backend.get_target_private_dir_abs(girtargets[0])
if not os.path.isdir(gir_filelist_dir):
os.mkdir(gir_filelist_dir)
@@ -1061,12 +1062,12 @@ class GnomeModule(ExtensionModule):
KwargInfo('includes', ContainerTypeInfo(list, (str, GirTarget)), default=[], listify=True),
KwargInfo('install_gir', (bool, NoneType), since='0.61.0'),
KwargInfo('install_dir_gir', (str, bool, NoneType),
- deprecated_values={False: ('0.61.0', 'Use install_gir to disable installation')},
- validator=lambda x: 'as boolean can only be false' if x is True else None),
+ deprecated_values={False: ('0.61.0', 'Use install_gir to disable installation')},
+ validator=lambda x: 'as boolean can only be false' if x is True else None),
KwargInfo('install_typelib', (bool, NoneType), since='0.61.0'),
KwargInfo('install_dir_typelib', (str, bool, NoneType),
- deprecated_values={False: ('0.61.0', 'Use install_typelib to disable installation')},
- validator=lambda x: 'as boolean can only be false' if x is True else None),
+ deprecated_values={False: ('0.61.0', 'Use install_typelib to disable installation')},
+ validator=lambda x: 'as boolean can only be false' if x is True else None),
KwargInfo('link_with', ContainerTypeInfo(list, (build.SharedLibrary, build.StaticLibrary)), default=[], listify=True),
KwargInfo('namespace', str, required=True),
KwargInfo('nsversion', str, required=True),
@@ -1360,7 +1361,7 @@ class GnomeModule(ExtensionModule):
KwargInfo('mkdb_args', ContainerTypeInfo(list, str), default=[], listify=True),
KwargInfo(
'mode', str, default='auto', since='0.37.0',
- validator=in_set_validator({'xml', 'sgml', 'none', 'auto'})),
+ validator=in_set_validator({'xml', 'sgml', 'none', 'auto'})),
KwargInfo('module_version', str, default='', since='0.48.0'),
KwargInfo('namespace', str, default='', since='0.37.0'),
KwargInfo('scan_args', ContainerTypeInfo(list, str), default=[], listify=True),