import subprocess
import textwrap
import uuid
-from collections.abc import Iterable, Iterator, Sequence
+from collections.abc import Collection, Iterable, Iterator, Sequence
from pathlib import Path
-from typing import Any, Callable, Optional, Union, cast
+from typing import Any, Callable, Collection, Optional, Union, cast
from mkosi.architecture import Architecture
from mkosi.distributions import Distribution, detect_distribution
}
-def parse_ini(path: Path, only_sections: Sequence[str] = ()) -> Iterator[tuple[str, str, str]]:
+def parse_ini(path: Path, only_sections: Collection[str] = ()) -> Iterator[tuple[str, str, str]]:
"""
We have our own parser instead of using configparser as the latter does not support specifying the same
setting multiple times in the same configuration file.
if path.exists():
logging.debug(f"Including configuration file {Path.cwd() / path}")
- for section, k, v in parse_ini(
- path, only_sections=["Distribution", "Output", "Content", "Validation", "Host", "Preset"]
- ):
+ for section, k, v in parse_ini(path, only_sections={s.section for s in SETTINGS}):
name = k.removeprefix("@")
ns = namespace if k == name else defaults