Fix black complaints

These are newly detected by black 23.1.0.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2023-02-02 12:48:13 +01:00
parent d97b8bdd33
commit 826169af7c
13 changed files with 8 additions and 18 deletions

View File

@ -1118,7 +1118,6 @@ class Pungi(PungiBase):
self.logger.info("Finished gathering package objects.") self.logger.info("Finished gathering package objects.")
def gather(self): def gather(self):
# get package objects according to the input list # get package objects according to the input list
self.getPackageObjects() self.getPackageObjects()
if self.is_sources: if self.is_sources:

View File

@ -616,7 +616,6 @@ class Gather(GatherBase):
return added return added
for pkg in self.result_debug_packages.copy(): for pkg in self.result_debug_packages.copy():
if pkg not in self.finished_add_debug_package_deps: if pkg not in self.finished_add_debug_package_deps:
deps = self._get_package_deps(pkg, debuginfo=True) deps = self._get_package_deps(pkg, debuginfo=True)
for i, req in deps: for i, req in deps:

View File

@ -297,7 +297,7 @@ class BuildinstallPhase(PhaseBase):
"Unsupported buildinstall method: %s" % self.buildinstall_method "Unsupported buildinstall method: %s" % self.buildinstall_method
) )
for (variant, cmd) in commands: for variant, cmd in commands:
self.pool.add(BuildinstallThread(self.pool)) self.pool.add(BuildinstallThread(self.pool))
self.pool.queue_put( self.pool.queue_put(
(self.compose, arch, variant, cmd, self.pkgset_phase) (self.compose, arch, variant, cmd, self.pkgset_phase)

View File

@ -369,7 +369,7 @@ class CreateisoPhase(PhaseLoggerMixin, PhaseBase):
if self.compose.notifier: if self.compose.notifier:
self.compose.notifier.send("createiso-targets", deliverables=deliverables) self.compose.notifier.send("createiso-targets", deliverables=deliverables)
for (cmd, variant, arch) in commands: for cmd, variant, arch in commands:
self.pool.add(CreateIsoThread(self.pool)) self.pool.add(CreateIsoThread(self.pool))
self.pool.queue_put((self.compose, cmd, variant, arch)) self.pool.queue_put((self.compose, cmd, variant, arch))

View File

@ -76,7 +76,7 @@ class ExtraIsosPhase(PhaseLoggerMixin, ConfigGuardedPhase, PhaseBase):
for arch in sorted(arches): for arch in sorted(arches):
commands.append((config, variant, arch)) commands.append((config, variant, arch))
for (config, variant, arch) in commands: for config, variant, arch in commands:
self.pool.add(ExtraIsosThread(self.pool, self.bi)) self.pool.add(ExtraIsosThread(self.pool, self.bi))
self.pool.queue_put((self.compose, config, variant, arch)) self.pool.queue_put((self.compose, config, variant, arch))

View File

@ -90,7 +90,7 @@ class GatherPhase(PhaseBase):
# check whether variants from configuration value # check whether variants from configuration value
# 'variant_as_lookaside' are correct # 'variant_as_lookaside' are correct
for (requiring, required) in variant_as_lookaside: for requiring, required in variant_as_lookaside:
if requiring in all_variants and required not in all_variants: if requiring in all_variants and required not in all_variants:
errors.append( errors.append(
"variant_as_lookaside: variant %r doesn't exist but is " "variant_as_lookaside: variant %r doesn't exist but is "
@ -99,7 +99,7 @@ class GatherPhase(PhaseBase):
# check whether variants from configuration value # check whether variants from configuration value
# 'variant_as_lookaside' have same architectures # 'variant_as_lookaside' have same architectures
for (requiring, required) in variant_as_lookaside: for requiring, required in variant_as_lookaside:
if ( if (
requiring in all_variants requiring in all_variants
and required in all_variants and required in all_variants
@ -235,7 +235,7 @@ def reuse_old_gather_packages(compose, arch, variant, package_sets, methods):
if not hasattr(compose, "_gather_reused_variant_arch"): if not hasattr(compose, "_gather_reused_variant_arch"):
setattr(compose, "_gather_reused_variant_arch", []) setattr(compose, "_gather_reused_variant_arch", [])
variant_as_lookaside = compose.conf.get("variant_as_lookaside", []) variant_as_lookaside = compose.conf.get("variant_as_lookaside", [])
for (requiring, required) in variant_as_lookaside: for requiring, required in variant_as_lookaside:
if ( if (
requiring == variant.uid requiring == variant.uid
and (required, arch) not in compose._gather_reused_variant_arch and (required, arch) not in compose._gather_reused_variant_arch
@ -468,9 +468,7 @@ def gather_packages(compose, arch, variant, package_sets, fulltree_excludes=None
) )
else: else:
for source_name in ("module", "comps", "json"): for source_name in ("module", "comps", "json"):
packages, groups, filter_packages = get_variant_packages( packages, groups, filter_packages = get_variant_packages(
compose, arch, variant, source_name, package_sets compose, arch, variant, source_name, package_sets
) )
@ -575,7 +573,6 @@ def trim_packages(compose, arch, variant, pkg_map, parent_pkgs=None, remove_pkgs
move_to_parent_pkgs = _mk_pkg_map() move_to_parent_pkgs = _mk_pkg_map()
removed_pkgs = _mk_pkg_map() removed_pkgs = _mk_pkg_map()
for pkg_type, pkgs in pkg_map.items(): for pkg_type, pkgs in pkg_map.items():
new_pkgs = [] new_pkgs = []
for pkg in pkgs: for pkg in pkgs:
pkg_path = pkg["path"] pkg_path = pkg["path"]

View File

@ -117,7 +117,7 @@ class LiveImagesPhase(
commands.append((cmd, variant, arch)) commands.append((cmd, variant, arch))
for (cmd, variant, arch) in commands: for cmd, variant, arch in commands:
self.pool.add(CreateLiveImageThread(self.pool)) self.pool.add(CreateLiveImageThread(self.pool))
self.pool.queue_put((self.compose, cmd, variant, arch)) self.pool.queue_put((self.compose, cmd, variant, arch))

View File

@ -880,7 +880,6 @@ def populate_global_pkgset(compose, koji_wrapper, path_prefix, event):
) )
for variant in compose.all_variants.values(): for variant in compose.all_variants.values():
if compose_tag in variant_tags[variant]: if compose_tag in variant_tags[variant]:
# If it's a modular tag, store the package set for the module. # If it's a modular tag, store the package set for the module.
for nsvc, koji_tag in variant.module_uid_to_koji_tag.items(): for nsvc, koji_tag in variant.module_uid_to_koji_tag.items():
if compose_tag == koji_tag: if compose_tag == koji_tag:

View File

@ -319,7 +319,6 @@ def get_arguments(config):
def main(): def main():
config = pungi.config.Config() config = pungi.config.Config()
opts = get_arguments(config) opts = get_arguments(config)

View File

@ -276,7 +276,6 @@ class Variant(object):
modules=None, modules=None,
modular_koji_tags=None, modular_koji_tags=None,
): ):
environments = environments or [] environments = environments or []
buildinstallpackages = buildinstallpackages or [] buildinstallpackages = buildinstallpackages or []

View File

@ -28,6 +28,7 @@ def fake_listdir(pattern, result=None, exc=None):
"""Create a function that mocks os.listdir. If the path contains pattern, """Create a function that mocks os.listdir. If the path contains pattern,
result will be returned or exc raised. Otherwise it's normal os.listdir result will be returned or exc raised. Otherwise it's normal os.listdir
""" """
# The point of this is to avoid issues on Python 2, where apparently # The point of this is to avoid issues on Python 2, where apparently
# isdir() is using listdir(), so the mocking is breaking it. # isdir() is using listdir(), so the mocking is breaking it.
def worker(path): def worker(path):

View File

@ -121,7 +121,6 @@ class KojiWrapperTest(KojiWrapperBaseTestCase):
) )
def test_get_image_paths(self): def test_get_image_paths(self):
# The data for this tests is obtained from the actual Koji build. It # The data for this tests is obtained from the actual Koji build. It
# includes lots of fields that are not used, but for the sake of # includes lots of fields that are not used, but for the sake of
# completeness is fully preserved. # completeness is fully preserved.
@ -321,7 +320,6 @@ class KojiWrapperTest(KojiWrapperBaseTestCase):
) )
def test_get_image_paths_failed_subtask(self): def test_get_image_paths_failed_subtask(self):
failed = set() failed = set()
def failed_callback(arch): def failed_callback(arch):

View File

@ -315,7 +315,6 @@ class OstreeTreeScriptTest(helpers.PungiTestCase):
@mock.patch("kobo.shortcuts.run") @mock.patch("kobo.shortcuts.run")
def test_extra_config_with_keep_original_sources(self, run): def test_extra_config_with_keep_original_sources(self, run):
configdir = os.path.join(self.topdir, "config") configdir = os.path.join(self.topdir, "config")
self._make_dummy_config_dir(configdir) self._make_dummy_config_dir(configdir)
treefile = os.path.join(configdir, "fedora-atomic-docker-host.json") treefile = os.path.join(configdir, "fedora-atomic-docker-host.json")