@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]
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]
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)