sample.make_sample_repo

sample.make_sample_repo(root)

Write a minimal, consistent repository below root.

The repository holds the package samplepkg (subpackages core and app), the unit samplepkg.core.calc with one intent item, one decision, the marked evaluation file tests/test_regen_eval_calc.py and the page docs/guide.qmd. Every dependent of the unit is declared, so spotregen check is clean. Existing files with the same names are overwritten.

Parameters

Name Type Description Default
root Path | str Target directory. Created, with its parents, if it does not exist. required

Returns

Name Type Description
Path Path The resolved repository root, ready for spotregen.load_spec.

Examples

from pathlib import Path
from tempfile import TemporaryDirectory

from spotregen import load_spec, make_sample_repo, run_checks

with TemporaryDirectory() as tmp:
    root = make_sample_repo(Path(tmp) / "demo")
    print(sorted(p.name for p in (root / "regen").iterdir()))
    print(run_checks(load_spec(root)))
['architecture.toml', 'decisions', 'units']
[]