From a9839d80781a5706776496cc79c2dd25382e4ee2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Fri, 26 Jan 2024 09:21:20 +0100 Subject: [PATCH] Make latest black happy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář (cherry picked from commit dd7ecbd5fdb0cad5081290854026b18be6435459) --- pungi/runroot.py | 6 +++--- pungi/scripts/pungi.py | 3 +-- tests/test_extra_isos_phase.py | 6 ++---- tests/test_gather_phase.py | 6 ++---- tests/test_runroot.py | 24 ++++++++++++------------ 5 files changed, 20 insertions(+), 25 deletions(-) diff --git a/pungi/runroot.py b/pungi/runroot.py index 96985b9d..26bc6fec 100644 --- a/pungi/runroot.py +++ b/pungi/runroot.py @@ -236,9 +236,9 @@ class Runroot(kobo.log.LoggingBase): fmt_dict["runroot_key"] = runroot_key self._ssh_run(hostname, user, run_template, fmt_dict, log_file=log_file) - fmt_dict[ - "command" - ] = "rpm -qa --qf='%{name}-%{version}-%{release}.%{arch}\n'" + fmt_dict["command"] = ( + "rpm -qa --qf='%{name}-%{version}-%{release}.%{arch}\n'" + ) buildroot_rpms = self._ssh_run( hostname, user, diff --git a/pungi/scripts/pungi.py b/pungi/scripts/pungi.py index 48629813..4609fa75 100644 --- a/pungi/scripts/pungi.py +++ b/pungi/scripts/pungi.py @@ -478,8 +478,7 @@ def main(): print("RPM size: %s MiB" % (mypungi.size_packages() / 1024**2)) if not opts.nodebuginfo: print( - "DEBUGINFO size: %s MiB" - % (mypungi.size_debuginfo() / 1024**2) + "DEBUGINFO size: %s MiB" % (mypungi.size_debuginfo() / 1024**2) ) if not opts.nosource: print("SRPM size: %s MiB" % (mypungi.size_srpms() / 1024**2)) diff --git a/tests/test_extra_isos_phase.py b/tests/test_extra_isos_phase.py index fed53c26..1e5696ba 100644 --- a/tests/test_extra_isos_phase.py +++ b/tests/test_extra_isos_phase.py @@ -888,10 +888,8 @@ class GetIsoContentsTest(helpers.PungiTestCase): "images/efiboot.img": os.path.join(iso_dir, "images/efiboot.img"), } - ggp.side_effect = ( - lambda compose, x: gp[x[0][len(self.topdir) + 1 :]] - if len(x) == 1 - else bi_gp + ggp.side_effect = lambda compose, x: ( + gp[x[0][len(self.topdir) + 1 :]] if len(x) == 1 else bi_gp ) gp_file = os.path.join(self.topdir, "work/x86_64/iso/my.iso-graft-points") diff --git a/tests/test_gather_phase.py b/tests/test_gather_phase.py index 7ed167dd..10d5db7d 100644 --- a/tests/test_gather_phase.py +++ b/tests/test_gather_phase.py @@ -1057,10 +1057,8 @@ class TestGatherPackages(helpers.PungiTestCase): @mock.patch("pungi.phases.gather.get_gather_method") def test_hybrid_method(self, get_gather_method, get_variant_packages): packages, groups, filters = mock.Mock(), mock.Mock(), mock.Mock() - get_variant_packages.side_effect = ( - lambda c, v, a, s, p: (packages, groups, filters) - if s == "comps" - else (None, None, None) + get_variant_packages.side_effect = lambda c, v, a, s, p: ( + (packages, groups, filters) if s == "comps" else (None, None, None) ) get_gather_method.return_value.return_value.return_value = { "rpm": [], diff --git a/tests/test_runroot.py b/tests/test_runroot.py index 410a0fcf..bbc77740 100644 --- a/tests/test_runroot.py +++ b/tests/test_runroot.py @@ -82,12 +82,12 @@ class TestRunrootOpenSSH(helpers.PungiTestCase): @mock.patch("pungi.runroot.run") def test_run_templates(self, run): - self.compose.conf[ - "runroot_ssh_init_template" - ] = "/usr/sbin/init_runroot {runroot_tag}" - self.compose.conf[ - "runroot_ssh_install_packages_template" - ] = "install {runroot_key} {packages}" + self.compose.conf["runroot_ssh_init_template"] = ( + "/usr/sbin/init_runroot {runroot_tag}" + ) + self.compose.conf["runroot_ssh_install_packages_template"] = ( + "install {runroot_key} {packages}" + ) self.compose.conf["runroot_ssh_run_template"] = "run {runroot_key} {command}" run.return_value = (0, "key\n") @@ -111,9 +111,9 @@ class TestRunrootOpenSSH(helpers.PungiTestCase): @mock.patch("pungi.runroot.run") def test_run_templates_no_init(self, run): - self.compose.conf[ - "runroot_ssh_install_packages_template" - ] = "install {packages}" + self.compose.conf["runroot_ssh_install_packages_template"] = ( + "install {packages}" + ) self.compose.conf["runroot_ssh_run_template"] = "run {command}" run.return_value = (0, "key\n") @@ -136,9 +136,9 @@ class TestRunrootOpenSSH(helpers.PungiTestCase): @mock.patch("pungi.runroot.run") def test_run_templates_no_packages(self, run): - self.compose.conf[ - "runroot_ssh_install_packages_template" - ] = "install {packages}" + self.compose.conf["runroot_ssh_install_packages_template"] = ( + "install {packages}" + ) self.compose.conf["runroot_ssh_run_template"] = "run {command}" run.return_value = (0, "key\n")