]> git.ipfire.org Git - thirdparty/mkosi.git/commitdiff
Use __future__.annotations everywhere 791/head
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 10 Sep 2021 12:46:03 +0000 (14:46 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 10 Sep 2021 12:46:03 +0000 (14:46 +0200)
mkosi/__init__.py
mkosi/backend.py

index 7f644208f282a77987252fec04dc438dadbf3a55..f2407bf89373682ad5f5342110ef911e42edf06b 100644 (file)
@@ -1205,10 +1205,10 @@ class LuksSetupOutput(NamedTuple):
     tmp: Optional[Path]
 
     @classmethod
-    def empty(cls) -> "LuksSetupOutput":
+    def empty(cls) -> LuksSetupOutput:
         return cls(None, None, None, None, None)
 
-    def without_generated_root(self, args: CommandLineArguments) -> "LuksSetupOutput":
+    def without_generated_root(self, args: CommandLineArguments) -> LuksSetupOutput:
         "A copy of self with .root optionally supressed"
         return LuksSetupOutput(
             None if is_generated_root(args) else self.root,
@@ -6528,7 +6528,7 @@ class BuildOutput:
         return self.raw.name if self.raw is not None else None
 
     @classmethod
-    def empty(cls) -> "BuildOutput":
+    def empty(cls) -> BuildOutput:
         return cls(None, None, None, None, None, None, None)
 
 
index f90cff3184fbc35b64c55c94fe961811437c9498..6859ed40e59e2044efcc1d6cc1cee834a56f91f3 100644 (file)
@@ -1,5 +1,7 @@
 # SPDX-License-Identifier: LGPL-2.1+
 
+from __future__ import annotations
+
 import argparse
 import contextlib
 import dataclasses
@@ -100,7 +102,7 @@ class Distribution(enum.Enum):
     photon = 9, PackageType.rpm
     openmandriva = 10, PackageType.rpm
 
-    def __new__(cls, number: int, package_type: PackageType) -> "Distribution":
+    def __new__(cls, number: int, package_type: PackageType) -> Distribution:
         # This turns the list above into enum entries with .package_type attributes.
         # See https://docs.python.org/3.9/library/enum.html#when-to-use-new-vs-init
         # for an explanation.