Fix black complaint

Signed-off-by: Lubomír Sedlář <lsedlar@redhat.com>
This commit is contained in:
Lubomír Sedlář 2022-08-10 08:31:02 +02:00
parent ea8020473d
commit 778dcfa587
5 changed files with 16 additions and 15 deletions

View File

@ -20,8 +20,8 @@ import os
SIZE_UNITS = { SIZE_UNITS = {
"b": 1, "b": 1,
"k": 1024, "k": 1024,
"M": 1024 ** 2, "M": 1024**2,
"G": 1024 ** 3, "G": 1024**3,
} }

View File

@ -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): 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: There are three cases where changes may happen:

View File

@ -476,14 +476,14 @@ def main():
else: else:
mypungi.downloadSRPMs() 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: if not opts.nodebuginfo:
print( print(
"DEBUGINFO size: %s MiB" "DEBUGINFO size: %s MiB"
% (mypungi.size_debuginfo() / 1024 ** 2) % (mypungi.size_debuginfo() / 1024**2)
) )
if not opts.nosource: 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...) # Furthermore (but without the yumlock...)
if not opts.sourceisos: if not opts.sourceisos:

View File

@ -1105,8 +1105,8 @@ class SplitIsoTest(helpers.PungiTestCase):
os.path.join(self.topdir, "compose/Server/x86_64/os/n/media.repo") os.path.join(self.topdir, "compose/Server/x86_64/os/n/media.repo")
) )
M = 1024 ** 2 M = 1024**2
G = 1024 ** 3 G = 1024**3
with mock.patch( with mock.patch(
"os.path.getsize", "os.path.getsize",
@ -1157,8 +1157,8 @@ class SplitIsoTest(helpers.PungiTestCase):
os.path.join(self.topdir, "compose/Server/x86_64/os/n/media.repo") os.path.join(self.topdir, "compose/Server/x86_64/os/n/media.repo")
) )
M = 1024 ** 2 M = 1024**2
G = 1024 ** 3 G = 1024**3
with mock.patch( with mock.patch(
"os.path.getsize", "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") 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 # treeinfo has size 0, spacer leaves 11M of free space, so with 10M
# reserve the padding package should be on second disk # reserve the padding package should be on second disk
@ -1233,7 +1233,7 @@ class SplitIsoTest(helpers.PungiTestCase):
) )
def test_can_customize_reserve(self): 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( helpers.touch(
os.path.join(self.topdir, "compose/Server/x86_64/os/.treeinfo"), TREEINFO 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") os.path.join(self.topdir, "compose/Server/x86_64/os/Packages/x/pad.rpm")
) )
M = 1024 ** 2 M = 1024**2
with mock.patch( with mock.patch(
"os.path.getsize", DummySize({"spacer": 4688465664, "pad": 5 * M}) "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") os.path.join(self.topdir, "compose/Server/x86_64/os/Packages/x/pad.rpm")
) )
M = 1024 ** 2 M = 1024**2
with mock.patch( with mock.patch(
"os.path.getsize", DummySize({"spacer": 4688465664, "pad": 5 * M}) "os.path.getsize", DummySize({"spacer": 4688465664, "pad": 5 * M})

View File

@ -61,7 +61,7 @@ class EqualsAny(object):
return True return True
def __repr__(self): def __repr__(self):
return u"ANYTHING" return "ANYTHING"
ANYTHING = EqualsAny() ANYTHING = EqualsAny()