(path: Path)
| 124 | |
| 125 | |
| 126 | def read_yaml(path: Path) -> YamlMapping: |
| 127 | ensure_existing(path, "YAML file") |
| 128 | data = yaml.safe_load(path.read_text(encoding="utf-8")) |
| 129 | if not isinstance(data, dict): |
| 130 | raise ValueError(f"expected YAML mapping in {path}") |
| 131 | return cast("YamlMapping", data) |
| 132 | |
| 133 | |
| 134 | def write_yaml(path: Path, data: YamlMapping) -> None: |
no test coverage detected