diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2022-06-10 01:49:25 -0400 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2022-06-13 13:34:39 +0300 |
commit | 462b35e4b1b46db3b116d7ebd792f46404feee90 (patch) | |
tree | 5642af509844b769ec84e4a59a77257e603ba0bf | |
parent | f380862284c9187f8c4496068f11bcc3ca245fec (diff) | |
download | meson-462b35e4b1b46db3b116d7ebd792f46404feee90.zip meson-462b35e4b1b46db3b116d7ebd792f46404feee90.tar.gz meson-462b35e4b1b46db3b116d7ebd792f46404feee90.tar.bz2 |
flake8: fix various whitespace nits
-rw-r--r-- | mesonbuild/ast/introspection.py | 1 | ||||
-rw-r--r-- | mesonbuild/backend/backends.py | 6 | ||||
-rw-r--r-- | mesonbuild/coredata.py | 2 | ||||
-rw-r--r-- | mesonbuild/dependencies/dub.py | 6 | ||||
-rw-r--r-- | mesonbuild/interpreter/primitives/string.py | 2 | ||||
-rw-r--r-- | mesonbuild/linkers/detect.py | 2 | ||||
-rw-r--r-- | mesonbuild/mesonlib/universal.py | 2 | ||||
-rw-r--r-- | mesonbuild/modules/gnome.py | 3 | ||||
-rwxr-xr-x | mesonbuild/scripts/env2mfile.py | 8 |
9 files changed, 16 insertions, 16 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index f7d3e20..765e49b 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -184,7 +184,6 @@ class IntrospectionInterpreter(AstInterpreter): options[k] = v self.coredata.add_compiler_options(options, lang, for_machine, self.environment) - def func_dependency(self, node: BaseNode, args: T.List[TYPE_nvar], kwargs: T.Dict[str, TYPE_nvar]) -> None: args = self.flatten_args(args) kwargs = self.flatten_kwargs(kwargs) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 63afceb..53fd6da 100644 --- a/mesonbuild/backend/backends.py +++ b/mesonbuild/backend/backends.py @@ -1637,9 +1637,9 @@ class Backend: for output, tag in zip(t.get_outputs(), t.install_tag): f = os.path.join(self.get_target_dir(t), output) i = TargetInstallData(f, first_outdir, default_install_dir_name, - False, {}, set(), None, install_mode, - t.subproject, optional=not t.build_by_default, - tag=tag) + False, {}, set(), None, install_mode, + t.subproject, optional=not t.build_by_default, + tag=tag) d.targets.append(i) else: for output, outdir, tag in zip(t.get_outputs(), outdirs, t.install_tag): diff --git a/mesonbuild/coredata.py b/mesonbuild/coredata.py index 48881f0..569fe39 100644 --- a/mesonbuild/coredata.py +++ b/mesonbuild/coredata.py @@ -913,7 +913,7 @@ class CmdLineFileParser(configparser.ConfigParser): # storing subproject options like "subproject:option=value" super().__init__(delimiters=['='], interpolation=None) - def read(self, filenames: T.Union['StrOrBytesPath', T.Iterable['StrOrBytesPath']], encoding: str ='utf-8') -> T.List[str]: + def read(self, filenames: T.Union['StrOrBytesPath', T.Iterable['StrOrBytesPath']], encoding: str = 'utf-8') -> T.List[str]: return super().read(filenames, encoding) def optionxform(self, option: str) -> str: diff --git a/mesonbuild/dependencies/dub.py b/mesonbuild/dependencies/dub.py index c8b155e..519f2f7 100644 --- a/mesonbuild/dependencies/dub.py +++ b/mesonbuild/dependencies/dub.py @@ -97,7 +97,8 @@ class DubDependency(ExternalDependency): # A command that might be useful in case of missing DUB package def dub_build_deep_command() -> str: - cmd = ['dub', 'run', 'dub-build-deep', '--yes', '--', main_pack_spec, + cmd = [ + 'dub', 'run', 'dub-build-deep', '--yes', '--', main_pack_spec, '--arch=' + dub_arch, '--compiler=' + self.compiler.get_exelist()[-1], '--build=' + dub_buildtype ] @@ -260,7 +261,7 @@ class DubDependency(ExternalDependency): is_windows = self.env.machines.host.is_windows() if is_windows: winlibs = ['kernel32', 'user32', 'gdi32', 'winspool', 'shell32', 'ole32', - 'oleaut32', 'uuid', 'comdlg32', 'advapi32', 'ws2_32'] + 'oleaut32', 'uuid', 'comdlg32', 'advapi32', 'ws2_32'] for lib in bs['libs']: if os.name != 'nt': @@ -371,7 +372,6 @@ class DubDependency(ExternalDependency): return (None, compatibilities) - def _call_dubbin(self, args: T.List[str], env: T.Optional[T.Dict[str, str]] = None) -> T.Tuple[int, str, str]: assert isinstance(self.dubbin, ExternalProgram) p, out, err = Popen_safe(self.dubbin.get_command() + args, env=env) diff --git a/mesonbuild/interpreter/primitives/string.py b/mesonbuild/interpreter/primitives/string.py index 1fd6e92..9abca75 100644 --- a/mesonbuild/interpreter/primitives/string.py +++ b/mesonbuild/interpreter/primitives/string.py @@ -126,7 +126,7 @@ class StringHolder(ObjectHolder[str]): @typed_pos_args('str.substring', optargs=[int, int]) def substring_method(self, args: T.Tuple[T.Optional[int], T.Optional[int]], kwargs: TYPE_kwargs) -> str: start = args[0] if args[0] is not None else 0 - end = args[1] if args[1] is not None else len(self.held_object) + end = args[1] if args[1] is not None else len(self.held_object) return self.held_object[start:end] @noKwargs diff --git a/mesonbuild/linkers/detect.py b/mesonbuild/linkers/detect.py index f1cdb2a..31f6ddc 100644 --- a/mesonbuild/linkers/detect.py +++ b/mesonbuild/linkers/detect.py @@ -127,7 +127,7 @@ def guess_win_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Ty __failed_to_detect_linker(compiler, check_args, o, e) def guess_nix_linker(env: 'Environment', compiler: T.List[str], comp_class: T.Type['Compiler'], - comp_version:str, for_machine: MachineChoice, *, + comp_version: str, for_machine: MachineChoice, *, extra_args: T.Optional[T.List[str]] = None) -> 'DynamicLinker': """Helper for guessing what linker to use on Unix-Like OSes. diff --git a/mesonbuild/mesonlib/universal.py b/mesonbuild/mesonlib/universal.py index 1649d11..d708671 100644 --- a/mesonbuild/mesonlib/universal.py +++ b/mesonbuild/mesonlib/universal.py @@ -1967,7 +1967,7 @@ class OptionOverrideProxy(collections.abc.Mapping): if opt.yielding: opt = self.options.get(key.as_root(), opt) override_value = self.overrides.get(key.as_root()) - if override_value is not None : + if override_value is not None: opt = copy.copy(opt) opt.set_value(override_value) return opt diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index 4cfbe26..b0182c3 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -654,7 +654,7 @@ class GnomeModule(ExtensionModule): _ld, depends = self._get_link_args(state, lib, depends, include_rpath) internal_ldflags.update(_ld) libdepflags = self._get_dependencies_flags_raw(lib.get_external_deps(), state, depends, include_rpath, - use_gir_args) + use_gir_args) cflags.update(libdepflags[0]) internal_ldflags.update(libdepflags[1]) external_ldflags.update(libdepflags[2]) @@ -742,6 +742,7 @@ class GnomeModule(ExtensionModule): external_ldflags.extend(ldflag) return cflags, internal_ldflags, external_ldflags, gi_includes, depends + def _unwrap_gir_target(self, girtarget: T.Union[build.Executable, build.StaticLibrary, build.SharedLibrary], state: 'ModuleState' ) -> T.Union[build.Executable, build.StaticLibrary, build.SharedLibrary]: if not isinstance(girtarget, (build.Executable, build.SharedLibrary, diff --git a/mesonbuild/scripts/env2mfile.py b/mesonbuild/scripts/env2mfile.py index 299fcc9..4675143 100755 --- a/mesonbuild/scripts/env2mfile.py +++ b/mesonbuild/scripts/env2mfile.py @@ -211,7 +211,7 @@ def detect_cross_debianlike(options: T.Any) -> MachineInfo: infos.binaries['objcopy'] = locate_path("%s-objcopy" % host_arch) infos.binaries['ld'] = locate_path("%s-ld" % host_arch) try: - infos.binaries['pkgconfig'] = locate_path("%s-pkg-config" % host_arch) + infos.binaries['pkgconfig'] = locate_path("%s-pkg-config" % host_arch) except ValueError: pass # pkg-config is optional try: @@ -260,7 +260,7 @@ def write_machine_file(infos: MachineInfo, ofilename: str, write_system_info: bo ofile.write(f"system = '{infos.system}'\n") os.replace(tmpfilename, ofilename) -def detect_language_args_from_envvars(langname: str, envvar_suffix: str ='') -> T.Tuple[T.List[str], T.List[str]]: +def detect_language_args_from_envvars(langname: str, envvar_suffix: str = '') -> T.Tuple[T.List[str], T.List[str]]: ldflags = tuple(shlex.split(os.environ.get('LDFLAGS' + envvar_suffix, ''))) compile_args = shlex.split(os.environ.get(UNIXY_ENVVARS_FLAGS[langname] + envvar_suffix, '')) if langname in LANGS_USING_CPPFLAGS: @@ -271,7 +271,7 @@ def detect_language_args_from_envvars(langname: str, envvar_suffix: str ='') -> lang_link_args = list(ldflags) + compile_args return (lang_compile_args, lang_link_args) -def detect_compilers_from_envvars(envvar_suffix:str ='') -> MachineInfo: +def detect_compilers_from_envvars(envvar_suffix: str = '') -> MachineInfo: infos = MachineInfo() for langname, envvarname in UNIXY_ENVVARS_COMPILER.items(): compilerstr = os.environ.get(envvarname + envvar_suffix) @@ -286,7 +286,7 @@ def detect_compilers_from_envvars(envvar_suffix:str ='') -> MachineInfo: infos.link_args[langname] = lang_link_args return infos -def detect_binaries_from_envvars(infos: MachineInfo, envvar_suffix:str ='') -> None: +def detect_binaries_from_envvars(infos: MachineInfo, envvar_suffix: str = '') -> None: for binname, envvar_base in UNIXY_ENVVARS_TOOLS.items(): envvar = envvar_base + envvar_suffix binstr = os.environ.get(envvar) |