flake8: fix various whitespace nits

pull/10404/head
Eli Schwartz 3 years ago committed by Jussi Pakkanen
parent f380862284
commit 462b35e4b1
  1. 1
      mesonbuild/ast/introspection.py
  2. 6
      mesonbuild/backend/backends.py
  3. 2
      mesonbuild/coredata.py
  4. 6
      mesonbuild/dependencies/dub.py
  5. 2
      mesonbuild/interpreter/primitives/string.py
  6. 2
      mesonbuild/linkers/detect.py
  7. 2
      mesonbuild/mesonlib/universal.py
  8. 3
      mesonbuild/modules/gnome.py
  9. 8
      mesonbuild/scripts/env2mfile.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)

@ -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):

@ -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:

@ -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)

@ -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

@ -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.

@ -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

@ -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,

@ -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)

Loading…
Cancel
Save