You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(python-codegen): emit package __init__.py so the out dir is importable
The Python codegen emits modules with package-relative imports (e.g. an
output-parser importing its payload sibling via `from .x import X`), but `gen`
never wrote an `__init__.py`, so a consumer importing the generated package hit
`ImportError: attempted relative import with no known parent package`. The
workaround — hand-adding `__init__.py` — then failed `verify --codegen`, which
flagged it as an `extra` file.
run_gen now emits an `@generated` `__init__.py` in every directory that received a
generated file (and intermediate dirs up to out_dir), gated by the new
`GenConfig.emit_package_init` (default True). As a generated file it is part of the
regenerated set, so `verify --codegen` passes; a hand-authored marker-less
`__init__.py` is still refused (never clobbered) by the overwrite policy.
Also fixes doc drift: templates-and-payloads.md claimed Python payload-VO codegen
"is not yet emitted" (it ships); both docs showed a `render(ref=…, payload=…)`
kwargs API that does not exist (real API is `render(RenderRequest(...))`); and the
python.md capability snapshot listed migrations as "in progress" rather than TS-only
by ADR-0015.
Spec: docs/superpowers/specs/2026-06-13-python-codegen-package-init-emission.md
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
0 commit comments