Skip to main content

spec.load_architecture

spec.load_architecture(path)

Read regen/architecture.toml.

Parameters

Name Type Description Default
path Path Path of the file. required

Returns

Name Type Description
Architecture Architecture The parsed compilation target.

Raises

Name Type Description
SpecError If a required field is missing, a key of the schema is unknown or a key of [pace] is not a pace.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from babregen import make_sample_repo
from babregen.spec import load_architecture

with TemporaryDirectory() as tmp:
    root = make_sample_repo(Path(tmp) / "demo")
    arch = load_architecture(root / "regen" / "architecture.toml")
    print(arch.package, sorted(arch.allowed))
samplepkg ['__init__', 'app', 'core']