symfonic.cli.example_spec¶
example_spec ¶
The shape of a curated example, and the domains the set must cover.
Split out of :mod:symfonic.cli.examples by T4.3.3 so the registry data
(:mod:symfonic.cli.example_journeys) can name the type without importing the
copy-out machinery that consumes it. Three jobs, three modules: what an
example is (here), which examples exist (the registries), and how one is
copied into a project (examples.py).
ExampleSpec
dataclass
¶
ExampleSpec(name: str, summary: str, run: str, srcdir: str | None = None, srcfile: str | None = None, requires: str | None = None, domain: str | None = None)
A curated, copy-out example.
srcdir and srcfile are mutually exclusive and are given relative to
the resolved examples root. Exactly one must be set.
domain
class-attribute
instance-attribute
¶
The :data:JOURNEY_DOMAINS rung this example is the canonical answer
for, or None for the older single-topic examples. Exactly one spec may
claim a domain — an example set where two files both claim to be the
memory example is a set with no canonical memory example.
requires
class-attribute
instance-attribute
¶
Human note on prerequisites (extra + credentials), or None for
a base-install example that runs on MockModelProvider.
ExamplesError ¶
Bases: RuntimeError
Raised when an example cannot be listed or copied.