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 d2119987..c721e887 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 5dee590d..0001ad69 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 31986b3e..8e173090 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -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"] 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 cfb45900..8d8255f3 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 0d219113..7d3728f8 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 2a051886..04cc3619 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")