From: Pyfisch Date: Fri, 9 Sep 2022 14:30:29 +0000 (+0200) Subject: Add note to MkosiConfig documentation X-Git-Tag: v14~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2b6b6b4dd723436b31debce727d121a0436b30ec;p=thirdparty%2Fmkosi.git Add note to MkosiConfig documentation --- diff --git a/mkosi/backend.py b/mkosi/backend.py index 4a7830847..25f024513 100644 --- a/mkosi/backend.py +++ b/mkosi/backend.py @@ -451,7 +451,12 @@ class PartitionTable: @dataclasses.dataclass(frozen=True) class MkosiConfig: - """Type-hinted storage for command line arguments.""" + """Type-hinted storage for command line arguments. + + Only user configuration is stored here while dynamic state exists in + MkosiState. If a field of the same name exists in both classes always + access the value from state. + """ verb: Verb cmdline: List[str] @@ -506,7 +511,6 @@ class MkosiConfig: skeleton_trees: List[Path] clean_package_metadata: Union[bool, str] remove_files: List[Path] - # Environment should not be used directly. Use MkosiState environment instead. environment: Dict[str, str] build_sources: Optional[Path] build_dir: Optional[Path] diff --git a/mkosi/machine.py b/mkosi/machine.py index 2dbacd5ca..ef3c05b84 100644 --- a/mkosi/machine.py +++ b/mkosi/machine.py @@ -117,10 +117,6 @@ class Machine: if needs_build(self.config): check_root() check_native(self.config) - - # Useful if testing within Docker - if parse_boolean(os.getenv("MKOSI_TEST_NO_NAMESPACE", "0")): - raise unittest.SkipTest("Build test skipped due to environment variable.") init_namespace() build_stuff(self.config)