From 778dcfa587570396fea959f9445f02ccf2adcc71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lubom=C3=ADr=20Sedl=C3=A1=C5=99?= Date: Wed, 10 Aug 2022 08:31:02 +0200 Subject: [PATCH] Fix black complaint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Lubomír Sedlář --- pungi/media_split.py | 4 ++-- pungi/phases/gather/__init__.py | 3 ++- pungi/scripts/pungi.py | 6 +++--- tests/test_createiso_phase.py | 16 ++++++++-------- tests/test_patch_iso.py | 2 +- 5 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pungi/media_split.py b/pungi/media_split.py index 74be8fab..708ebd5d 100644 --- a/pungi/media_split.py +++ b/pungi/media_split.py @@ -20,8 +20,8 @@ import os SIZE_UNITS = { "b": 1, "k": 1024, - "M": 1024 ** 2, - "G": 1024 ** 3, + "M": 1024**2, + "G": 1024**3, } diff --git a/pungi/phases/gather/__init__.py b/pungi/phases/gather/__init__.py index 5d2b3c40..72843571 100644 --- a/pungi/phases/gather/__init__.py +++ b/pungi/phases/gather/__init__.py @@ -541,7 +541,8 @@ def write_packages(compose, arch, variant, pkg_map, path_prefix): def trim_packages(compose, arch, variant, pkg_map, parent_pkgs=None, remove_pkgs=None): - """Remove parent variant's packages from pkg_map <-- it gets modified in this function + """Remove parent variant's packages from pkg_map <-- it gets modified in + this function There are three cases where changes may happen: diff --git a/pungi/scripts/pungi.py b/pungi/scripts/pungi.py index 59b96ddc..9c307eaf 100644 --- a/pungi/scripts/pungi.py +++ b/pungi/scripts/pungi.py @@ -476,14 +476,14 @@ def main(): else: mypungi.downloadSRPMs() - print("RPM size: %s MiB" % (mypungi.size_packages() / 1024 ** 2)) + print("RPM size: %s MiB" % (mypungi.size_packages() / 1024**2)) if not opts.nodebuginfo: print( "DEBUGINFO size: %s MiB" - % (mypungi.size_debuginfo() / 1024 ** 2) + % (mypungi.size_debuginfo() / 1024**2) ) if not opts.nosource: - print("SRPM size: %s MiB" % (mypungi.size_srpms() / 1024 ** 2)) + print("SRPM size: %s MiB" % (mypungi.size_srpms() / 1024**2)) # Furthermore (but without the yumlock...) if not opts.sourceisos: diff --git a/tests/test_createiso_phase.py b/tests/test_createiso_phase.py index 02ccd8be..fd3c42ec 100644 --- a/tests/test_createiso_phase.py +++ b/tests/test_createiso_phase.py @@ -1105,8 +1105,8 @@ class SplitIsoTest(helpers.PungiTestCase): os.path.join(self.topdir, "compose/Server/x86_64/os/n/media.repo") ) - M = 1024 ** 2 - G = 1024 ** 3 + M = 1024**2 + G = 1024**3 with mock.patch( "os.path.getsize", @@ -1157,8 +1157,8 @@ class SplitIsoTest(helpers.PungiTestCase): os.path.join(self.topdir, "compose/Server/x86_64/os/n/media.repo") ) - M = 1024 ** 2 - G = 1024 ** 3 + M = 1024**2 + G = 1024**3 with mock.patch( "os.path.getsize", @@ -1209,7 +1209,7 @@ class SplitIsoTest(helpers.PungiTestCase): os.path.join(self.topdir, "compose/Server/x86_64/os/Packages/x/pad.rpm") ) - M = 1024 ** 2 + M = 1024**2 # treeinfo has size 0, spacer leaves 11M of free space, so with 10M # reserve the padding package should be on second disk @@ -1233,7 +1233,7 @@ class SplitIsoTest(helpers.PungiTestCase): ) def test_can_customize_reserve(self): - compose = helpers.DummyCompose(self.topdir, {"split_iso_reserve": 1024 ** 2}) + compose = helpers.DummyCompose(self.topdir, {"split_iso_reserve": 1024**2}) helpers.touch( os.path.join(self.topdir, "compose/Server/x86_64/os/.treeinfo"), TREEINFO ) @@ -1244,7 +1244,7 @@ class SplitIsoTest(helpers.PungiTestCase): os.path.join(self.topdir, "compose/Server/x86_64/os/Packages/x/pad.rpm") ) - M = 1024 ** 2 + M = 1024**2 with mock.patch( "os.path.getsize", DummySize({"spacer": 4688465664, "pad": 5 * M}) @@ -1265,7 +1265,7 @@ class SplitIsoTest(helpers.PungiTestCase): os.path.join(self.topdir, "compose/Server/x86_64/os/Packages/x/pad.rpm") ) - M = 1024 ** 2 + M = 1024**2 with mock.patch( "os.path.getsize", DummySize({"spacer": 4688465664, "pad": 5 * M}) diff --git a/tests/test_patch_iso.py b/tests/test_patch_iso.py index 55abf12b..9fe8d7b4 100644 --- a/tests/test_patch_iso.py +++ b/tests/test_patch_iso.py @@ -61,7 +61,7 @@ class EqualsAny(object): return True def __repr__(self): - return u"ANYTHING" + return "ANYTHING" ANYTHING = EqualsAny()