From: Zbigniew Jędrzejewski-Szmek Date: Sat, 15 Jun 2024 19:57:49 +0000 (+0200) Subject: installer/rpm: make RpmRepository a dataclass X-Git-Tag: v24~82^2~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36caecbce8dc4c1660cd3785efcd50f6deada1a1;p=thirdparty%2Fmkosi.git installer/rpm: make RpmRepository a dataclass Dataclasses are the more modern approach, with better string representation and less hacks. A NamedTuple is also a tuple, which is rather surprising when we don't use that. --- diff --git a/mkosi/installer/rpm.py b/mkosi/installer/rpm.py index d4ce79848..8dcdf96b8 100644 --- a/mkosi/installer/rpm.py +++ b/mkosi/installer/rpm.py @@ -1,16 +1,18 @@ # SPDX-License-Identifier: LGPL-2.1+ +import dataclasses import subprocess import textwrap from pathlib import Path -from typing import NamedTuple, Optional +from typing import Optional from mkosi.context import Context from mkosi.run import run from mkosi.types import PathString -class RpmRepository(NamedTuple): +@dataclasses.dataclass(frozen=True) +class RpmRepository: id: str url: str gpgurls: tuple[str, ...]