setuptools (Python)¶
The one Python recipe that needs no pyproject.toml of its own. dsdlc writes one declaring setuptools, so the generated tree is already an installable package and the host just installs it.
| Language | Python |
| Build system | setuptools |
| Idiom | A -- the generated tree is the package |
| Regeneration | None -- regeneration is an explicit step |
Notes¶
This is the only Python backend that gets Idiom A, and the reason is simply that it is the backend dsdlc's emitted manifest declares. A project cannot have two build backends, so choosing any other one means owning the manifest yourself -- which is what the other four recipes show.
Every Python recipe builds its own virtual environment and lets pip fetch the build backend into it. That is correct isolation regardless, and it is the only thing that works on a distribution that marks its interpreter externally managed (PEP 668) -- which the toolshed image does.
Prerequisites¶
| Tool | Why |
|---|---|
python3 |
creates the virtual environment the backend installs into |
Commands¶
Run these from the recipe directory, with dsdl/ and src/ copied alongside it. This is the exact sequence CI runs.
# generate
dsdlc --target-language python dsdl/lanyard --py-package lanyard --outdir generated
# virtual environment
python3 -m venv .venv
# install
.venv/bin/pip install -q ./generated
# round-trip
.venv/bin/python src/python/test_roundtrip.py
The types this builds¶
The whole lanyard namespace -- twenty-four definitions, browsable from the showroom overview, where each one is paired with its wire-layout facts and a declaration excerpt in every language.