From 826169af7c0ac9ca19e4dd8a30c44bb1b26bf9b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Thu, 2 Feb 2023 12:48:13 +0100 Subject: [PATCH] Fix black complaints MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit These are newly detected by black 23.1.0. Signed-off-by: Lubomír Sedlář --- pungi/gather.py | 1 - pungi/gather_dnf.py | 1 - pungi/phases/buildinstall.py | 2 +- pungi/phases/createiso.py | 2 +- pungi/phases/extra_isos.py | 2 +- pungi/phases/gather/__init__.py | 9 +++------ pungi/phases/live_images.py | 2 +- pungi/phases/pkgset/sources/source_koji.py | 1 - pungi/scripts/pungi.py | 1 - pungi/wrappers/variants.py | 1 - tests/test_iso_wrapper.py | 1 + tests/test_koji_wrapper.py | 2 -- tests/test_ostree_script.py | 1 - 13 files changed, 8 insertions(+), 18 deletions(-) diff --git a/pungi/gather.py b/pungi/gather.py index a77ed6bd..e1b2dbf9 100644 --- a/pungi/gather.py +++ b/pungi/gather.py @@ -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: diff --git a/pungi/gather_dnf.py b/pungi/gather_dnf.py index 97ebf48e..d718dcdc 100644 --- a/pungi/gather_dnf.py +++ b/pungi/gather_dnf.py @@ -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: diff --git a/pungi/phases/buildinstall.py b/pungi/phases/buildinstall.py index 6240730f..f6df5bd8 100644 --- a/pungi/phases/buildinstall.py +++ b/pungi/phases/buildinstall.py @@ -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) diff --git a/pungi/phases/createiso.py b/pungi/phases/createiso.py index 481d38fb..57200520 100644 --- a/pungi/phases/createiso.py +++ b/pungi/phases/createiso.py @@ -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)) diff --git a/pungi/phases/extra_isos.py b/pungi/phases/extra_isos.py index 2f1d9964..3b0e25ec 100644 --- a/pungi/phases/extra_isos.py +++ b/pungi/phases/extra_isos.py @@ -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)) diff --git a/pungi/phases/gather/__init__.py b/pungi/phases/gather/__init__.py index 72843571..6667b4ce 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -90,7 +90,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 " @@ -99,7 +99,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 @@ -235,7 +235,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 @@ -468,9 +468,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 ) @@ -575,7 +573,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"] diff --git a/pungi/phases/live_images.py b/pungi/phases/live_images.py index 0a4c4108..102e0fd3 100644 --- a/pungi/phases/live_images.py +++ b/pungi/phases/live_images.py @@ -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)) diff --git a/pungi/phases/pkgset/sources/source_koji.py b/pungi/phases/pkgset/sources/source_koji.py index 26ec770e..baea26c9 100644 --- a/pungi/phases/pkgset/sources/source_koji.py +++ b/pungi/phases/pkgset/sources/source_koji.py @@ -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: diff --git a/pungi/scripts/pungi.py b/pungi/scripts/pungi.py index 9c307eaf..48629813 100644 --- a/pungi/scripts/pungi.py +++ b/pungi/scripts/pungi.py @@ -319,7 +319,6 @@ def get_arguments(config): def main(): - config = pungi.config.Config() opts = get_arguments(config) diff --git a/pungi/wrappers/variants.py b/pungi/wrappers/variants.py index 04719b67..be47f4ed 100755 --- a/pungi/wrappers/variants.py +++ b/pungi/wrappers/variants.py @@ -276,7 +276,6 @@ class Variant(object): modules=None, modular_koji_tags=None, ): - environments = environments or [] buildinstallpackages = buildinstallpackages or [] diff --git a/tests/test_iso_wrapper.py b/tests/test_iso_wrapper.py index 5be0e32e..bdea5dd5 100644 --- a/tests/test_iso_wrapper.py +++ b/tests/test_iso_wrapper.py @@ -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): diff --git a/tests/test_koji_wrapper.py b/tests/test_koji_wrapper.py index 4b943596..341090f5 100644 --- a/tests/test_koji_wrapper.py +++ b/tests/test_koji_wrapper.py @@ -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): diff --git a/tests/test_ostree_script.py b/tests/test_ostree_script.py index b6710e57..eab84158 100644 --- a/tests/test_ostree_script.py +++ b/tests/test_ostree_script.py @@ -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")