]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Get rid of cast
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 22 Feb 2024 19:36:12 +0000 (20:36 +0100)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Thu, 22 Feb 2024 19:38:30 +0000 (20:38 +0100)
mkosi/installer/apt.py

index 475d8d891a94d73c0789c8c22f721fbe38e1a42d..440d34834278304a928cb2bb573f574940b0a0c9 100644 (file)
@@ -3,7 +3,7 @@ import os
 import textwrap
 from collections.abc import Iterable, Sequence
 from pathlib import Path
-from typing import NamedTuple, Optional, cast
+from typing import NamedTuple, Optional
 
 from mkosi.config import Config
 from mkosi.context import Context
@@ -51,23 +51,24 @@ class Apt(PackageManager):
     @classmethod
     def scripts(cls, context: Context) -> dict[str, list[PathString]]:
         return {
-            command: apivfs_cmd(context.root) + cls.cmd(context, command) for command in (
-                "apt",
-                "apt-cache",
-                "apt-cdrom",
-                "apt-config",
-                "apt-extracttemplates",
-                "apt-get",
-                "apt-key",
-                "apt-mark",
-                "apt-sortpkgs",
-            )
-        } | cast(dict[str, list[PathString]], {
+            **{
+                command: apivfs_cmd(context.root) + cls.cmd(context, command) for command in (
+                    "apt",
+                    "apt-cache",
+                    "apt-cdrom",
+                    "apt-config",
+                    "apt-extracttemplates",
+                    "apt-get",
+                    "apt-key",
+                    "apt-mark",
+                    "apt-sortpkgs",
+                )
+            },
             "mkosi-install"  : ["apt-get", "install"],
             "mkosi-upgrade"  : ["apt-get", "upgrade"],
             "mkosi-remove"   : ["apt-get", "purge"],
             "mkosi-reinstall": ["apt-get", "install", "--reinstall"],
-        })
+        }
 
     @classmethod
     def setup(cls, context: Context, repos: Iterable[Repository]) -> None: