Fix black complaints

These are newly detected by black 23.1.0.

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
(cherry picked from commit 826169af7c)
This commit is contained in:
Lubomír Sedlář 2023-02-02 12:48:13 +01:00 committed by Stepan Oksanichenko
parent 80ad0448ec
commit f9190d1fd1
Signed by: soksanichenko
GPG Key ID: AB9983172AB1E45B
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.")
def gather(self):
# get package objects according to the input list
self.getPackageObjects()
if self.is_sources:

View File

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

View File

@ -297,7 +297,7 @@ class BuildinstallPhase(PhaseBase):
"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.queue_put(
(self.compose, arch, variant, cmd, self.pkgset_phase)

View File

@ -369,7 +369,7 @@ class CreateisoPhase(PhaseLoggerMixin, PhaseBase):
if self.compose.notifier:
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.queue_put((self.compose, cmd, variant, arch))

View File

@ -76,7 +76,7 @@ class ExtraIsosPhase(PhaseLoggerMixin, ConfigGuardedPhase, PhaseBase):
for arch in sorted(arches):
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.queue_put((self.compose, config, variant, arch))

View File

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

View File

@ -117,7 +117,7 @@ class LiveImagesPhase(
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.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():
if compose_tag in variant_tags[variant]:
# 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():
if compose_tag == koji_tag:

View File

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

View File

@ -276,7 +276,6 @@ class Variant(object):
modules=None,
modular_koji_tags=None,
):
environments = environments 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,
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
# isdir() is using listdir(), so the mocking is breaking it.
def worker(path):

View File

@ -121,7 +121,6 @@ class KojiWrapperTest(KojiWrapperBaseTestCase):
)
def test_get_image_paths(self):
# 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
# completeness is fully preserved.
@ -321,7 +320,6 @@ class KojiWrapperTest(KojiWrapperBaseTestCase):
)
def test_get_image_paths_failed_subtask(self):
failed = set()
def failed_callback(arch):

View File

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