Black 26.1.0 new format

Signed-off-by: guillermodotn <gleiro@redhat.com>
This commit is contained in:
Guillermo Leiro 2026-02-05 17:21:42 +01:00
commit 6989c9ede0
37 changed files with 12 additions and 46 deletions

View file

@ -27,7 +27,7 @@ def get_full_version():
proc = subprocess.Popen(
["rpm", "-q", "pungi"], stdout=subprocess.PIPE, text=True, errors="replace"
)
(output, err) = proc.communicate()
output, err = proc.communicate()
if not err:
return output.rstrip()
else:

View file

@ -288,7 +288,7 @@ def getCanonArch(skipRpmPlatform=0): # pragma: no cover
f = open("/etc/rpm/platform", "r")
line = f.readline()
f.close()
(arch, vendor, opersys) = line.split("-", 2)
arch, vendor, opersys = line.split("-", 2)
return arch
except Exception:
pass

View file

@ -24,7 +24,6 @@ one record per line:
- disc number (optional)
"""
__all__ = (
"read_discinfo",
"write_discinfo",

View file

@ -12,7 +12,6 @@ from .wrappers.jigdo import JigdoWrapper
from .phases.buildinstall import BOOT_CONFIGS, BOOT_IMAGES
CreateIsoOpts = namedtuple(
"CreateIsoOpts",
[

View file

@ -69,7 +69,6 @@ Syntax:
%end
"""
import pykickstart.parser
import pykickstart.sections
from pykickstart.constants import GROUP_REQUIRED, GROUP_DEFAULT
@ -82,7 +81,7 @@ class FulltreeExcludesSection(pykickstart.sections.Section):
if not self.handler:
return
(h, s, t) = line.partition("#")
h, s, t = line.partition("#")
line = h.rstrip()
self.handler.fulltree_excludes.add(line)
@ -95,7 +94,7 @@ class MultilibBlacklistSection(pykickstart.sections.Section):
if not self.handler:
return
(h, s, t) = line.partition("#")
h, s, t = line.partition("#")
line = h.rstrip()
self.handler.multilib_blacklist.add(line)
@ -108,7 +107,7 @@ class MultilibWhitelistSection(pykickstart.sections.Section):
if not self.handler:
return
(h, s, t) = line.partition("#")
h, s, t = line.partition("#")
line = h.rstrip()
self.handler.multilib_whitelist.add(line)
@ -121,7 +120,7 @@ class PrepopulateSection(pykickstart.sections.Section):
if not self.handler:
return
(h, s, t) = line.partition("#")
h, s, t = line.partition("#")
line = h.rstrip()
self.handler.prepopulate.add(line)

View file

@ -16,7 +16,6 @@
import os
SIZE_UNITS = {
"b": 1,
"k": 1024,

View file

@ -41,6 +41,5 @@ from .osbs import OSBSPhase # noqa
from .phases_metadata import gather_phases_metadata # noqa
from .trigger_konflux_pipeline import TriggerKonfluxPipelinePhase # noqa
this_module = sys.modules[__name__]
PHASES_NAMES = gather_phases_metadata(this_module)

View file

@ -20,7 +20,6 @@ import kobo.rpmlib
from pungi.linker import LinkerPool
# TODO: global Linker instance - to keep hardlinks on dest?
# DONE: show overall progress, not each file
# TODO: (these should be logged separately)

View file

@ -24,7 +24,6 @@ Output:
set([(rpm_name, rpm_arch or None)])
"""
from pungi.wrappers.comps import CompsWrapper
import pungi.phases.gather.source

View file

@ -30,7 +30,6 @@ Output:
set([(rpm_name, rpm_arch or None)])
"""
import json
import os

View file

@ -20,7 +20,6 @@ modulemd file contains a list of exact RPM NEVRAs that should be include, so
just go over all modules in a given variant and join all lists together.
"""
import pungi.arch
import pungi.phases.gather.source

View file

@ -24,7 +24,6 @@ Output:
set()
"""
import pungi.phases.gather.source

View file

@ -19,7 +19,6 @@ from kobo.shortcuts import force_list
from productmd.images import Image
from productmd.rpms import Rpms
# This is a mapping from formats to file extensions. The format is what koji
# image-build command expects as argument, and the extension is what the file
# name will be ending with. The extensions are used to filter out which task

View file

@ -8,7 +8,6 @@ import threading
from .base import PhaseBase
from ..util import get_format_substs, get_file_size
MULTIPLE_CHECKSUMS_ERROR = (
'Config option "media_checksum_one_file" requires only one checksum'
' to be configured in "media_checksums".'

View file

@ -12,7 +12,6 @@ from ..wrappers import kojiwrapper
from .image_build import EXTENSIONS
from ..threading import TelemetryWorkerThread as WorkerThread
IMAGEBUILDEREXTENSIONS = [
("vagrant-libvirt", ["vagrant.libvirt.box"], "vagrant-libvirt.box"),
(
@ -118,7 +117,7 @@ class ImageBuilderPhase(
class RunImageBuilderThread(WorkerThread):
def process(self, item, num):
(compose, variant, config, arches, generics, repo, failable_arches) = item
compose, variant, config, arches, generics, repo, failable_arches = item
self.failable_arches = []
# the Koji task as a whole can only fail if *all* arches are failable
can_task_fail = set(self.failable_arches).issuperset(set(arches))

View file

@ -128,7 +128,7 @@ class KiwiBuildPhase(
class RunKiwiBuildThread(WorkerThread):
def process(self, item, num):
(compose, variant, config, arches, generics, repo, failable_arches) = item
compose, variant, config, arches, generics, repo, failable_arches = item
self.failable_arches = failable_arches
# the Koji task as a whole can only fail if *all* arches are failable
can_task_fail = set(failable_arches).issuperset(set(arches))

View file

@ -390,8 +390,8 @@ class RunTriggerKonfluxPipelineThread(WorkerThread):
def process(self, item, num):
"""Thread entrypoint"""
# Simple var rename
(compose, variant, parameters) = item
(oc_context, kubeconfig_file, pr_name) = parameters
compose, variant, parameters = item
oc_context, kubeconfig_file, pr_name = parameters
with util.failable(
compose, False, variant, "*", TriggerKonfluxPipelinePhase.name

View file

@ -27,7 +27,6 @@ from kobo.shortcuts import run
from pungi import util
from pungi.wrappers import kojiwrapper
RUNROOT_TYPES = ["local", "koji", "openssh"]

View file

@ -5,7 +5,6 @@ import time
from pungi.util import format_size
LOCK_RE = re.compile(r".*\.lock(\|[A-Za-z0-9]+)*$")

View file

@ -25,7 +25,6 @@ from pungi.wrappers import kojiwrapper
from pungi.util import rmtree
from pungi.otel import tracing
# force C locales
try:
locale.setlocale(locale.LC_ALL, "C.UTF-8")

View file

@ -23,7 +23,6 @@ import time
import fedora_messaging.api
import fedora_messaging.exceptions
RESEND_INTERVAL = 300 # In seconds
SLEEP_TIME = 5

View file

@ -24,7 +24,6 @@ from operator import attrgetter
import libcomps
import lxml.etree
if sys.version_info[:2] < (2, 7):
# HACK: remove spaces from text elements on py < 2.7
OldElement = xml.dom.minidom.Element

View file

@ -36,7 +36,6 @@ from .. import util
from ..otel import tracing
from ..arch_utils import getBaseArch
KOJI_BUILD_DELETED = koji.BUILD_STATES["DELETED"]

View file

@ -19,7 +19,6 @@ import re
from .. import util
PACKAGES_RE = {
"rpm": re.compile(r"^RPM(\((?P<flags>[^\)]*)\))?: (?P<path>.+)$"),
"srpm": re.compile(r"^SRPM(\((?P<flags>[^\)]*)\))?: (?P<path>.+)$"),

View file

@ -11,7 +11,6 @@ TODO:
* jigdo
"""
from __future__ import print_function
import copy

View file

@ -7,7 +7,6 @@ import glob
from setuptools import setup
# recursively scan for python modules to be included
package_root_dirs = ["pungi", "pungi_utils"]
packages = set()

View file

@ -16,7 +16,6 @@ from pungi.util import get_arch_variant_data
from pungi import paths, checks
from pungi.module_util import Modulemd
GIT_WITH_CREDS = [
"git",
"-c",

View file

@ -7,7 +7,6 @@ import os
from pungi.scripts.config_validate import cli_main
from tests import helpers
HERE = os.path.abspath(os.path.dirname(__file__))
DUMMY_CONFIG = os.path.join(HERE, "data/dummy-pungi.conf")
SCHEMA_OVERRIDE = os.path.join(HERE, "data/dummy-override.json")

View file

@ -105,13 +105,11 @@ class TestWriteConfig(PungiTestCase):
fus.write_config(f, ["moda:master"], ["pkg", "foo"])
self.assertFileContent(
f,
dedent(
"""\
dedent("""\
module(moda:master)
pkg
foo
"""
),
"""),
)

View file

@ -9,7 +9,6 @@ from pungi.phases.gather.methods import method_hybrid as hybrid
from pungi.phases.pkgset.common import MaterializedPackageSet as PkgSet
from tests import helpers
MockPkg = namedtuple(
"MockPkg", ["name", "version", "release", "epoch", "sourcerpm", "file_path", "arch"]
)

View file

@ -4,7 +4,6 @@ from unittest import mock
from pungi.phases.imagebuilder import ImageBuilderPhase, RunImageBuilderThread
from tests.helpers import DummyCompose, PungiTestCase
MINIMAL_CONF = {
"types": ["minimal-raw-xz"],
"name": "Test",

View file

@ -4,7 +4,6 @@ from unittest import mock
from pungi.phases.kiwibuild import KiwiBuildPhase, RunKiwiBuildThread
from tests.helpers import DummyCompose, PungiTestCase
MINIMAL_CONF = {
"description_scm": "https://example.com/kiwi.git",
"description_path": "Fedora.kiwi",

View file

@ -7,7 +7,6 @@ from pungi.module_util import Modulemd
from tests import helpers
pytestmark = pytest.mark.skipif(not Modulemd, reason="Skipped test, no module support.")

View file

@ -7,7 +7,6 @@ from unittest import mock
from pungi.notifier import PungiNotifier
mock_datetime = mock.Mock()
mock_datetime.utcnow.return_value = datetime(2017, 6, 28, 9, 34)
mock_datetime.side_effect = lambda *args, **kwargs: datetime(*args, **kwargs)

View file

@ -9,7 +9,6 @@ from kobo.shortcuts import force_list
from tests import helpers
from pungi.phases import ostree_installer as ostree
LOG_PATH = "logs/x86_64/Everything/ostree_installer-1"

View file

@ -6,7 +6,6 @@ import os
import pungi.phases.test as test_phase
from tests.helpers import DummyCompose, PungiTestCase, touch, FIXTURE_DIR
PAD = b"\0" * 100
UNBOOTABLE_ISO = (b"\0" * 0x8001) + b"CD001" + PAD
ISO_WITH_MBR = (b"\0" * 0x1FE) + b"\x55\xaa" + (b"\0" * 0x7E01) + b"CD001" + PAD

View file

@ -8,7 +8,6 @@ from unittest import mock
from tests.helpers import PungiTestCase, FIXTURE_DIR, touch, mk_boom
from pungi_utils import unified_isos
COMPOSE_ID = "DP-1.0-20161013.t.4"