File: _yaml.py

package info (click to toggle)
python-cyclopts 3.12.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 3,288 kB
  • sloc: python: 11,445; makefile: 24
file content (12 lines) | stat: -rw-r--r-- 328 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
from pathlib import Path
from typing import Any

from cyclopts.config._common import ConfigFromFile


class Yaml(ConfigFromFile):
    def _load_config(self, path: Path) -> dict[str, Any]:
        from yaml import safe_load  # pyright: ignore[reportMissingImports]

        with path.open() as f:
            return safe_load(f)