Summary
There is no CI in this repository — no .github/ directory at all. Two things that are checkable
today run only when someone remembers to run them locally:
The second is the reason to file this now. The cookbook's value rests entirely on its accuracy,
and the failure mode is quiet: rename a client method or a result accessor, and 66 snippets go
stale with no signal until a reader copies one and it doesn't work. The checker exists precisely
to catch that, but a checker nobody runs is documentation of good intent rather than a guarantee.
Proposed
A single .github/workflows/ci.yml running on push and pull_request:
pip install -e .[analysis,dev]
pytest tests/
python .dev/tools/check-cookbook-snippets.py
Notes on the third step:
- The checker resolves mypy at
.venv/bin/mypy (VENV_MYPY in the script). In CI there is
typically no .venv/, so this needs either a venv at that path or a small change to fall back
to shutil.which("mypy"). The latter is probably the better fix — it makes the script work for
contributors who don't use that exact layout either.
- It carries its own canary self-test: if mypy ever stops resolving
dp_python_lib, it fails
loudly rather than passing everything silently. That property is what makes it safe to gate on.
- Runtime is a few seconds; no server or network required.
requires-python is >=3.10, so a matrix over 3.10–3.13 is worth considering, though a single
version is a fine start.
Out of scope
Integration tests that need a live MLDP stack. Those can't run in CI without an ecosystem to
point at, and this issue is deliberately limited to what runs hermetically.
Context
Came out of the review of #21 (the cookbook PR). That PR tracks the checker and wires up the
[dev] extra, but stops short of running either automatically — noted there as a deliberate
follow-up rather than an omission.
Summary
There is no CI in this repository — no
.github/directory at all. Two things that are checkabletoday run only when someone remembers to run them locally:
.dev/tools/check-cookbook-snippets.py, tracked as of Add task-oriented cookbook for the Python client API (issue #15) #21).It type-checks all 66 snippets in
doc/cookbook/against the installed package.The second is the reason to file this now. The cookbook's value rests entirely on its accuracy,
and the failure mode is quiet: rename a client method or a result accessor, and 66 snippets go
stale with no signal until a reader copies one and it doesn't work. The checker exists precisely
to catch that, but a checker nobody runs is documentation of good intent rather than a guarantee.
Proposed
A single
.github/workflows/ci.ymlrunning on push and pull_request:pip install -e .[analysis,dev]pytest tests/python .dev/tools/check-cookbook-snippets.pyNotes on the third step:
.venv/bin/mypy(VENV_MYPYin the script). In CI there istypically no
.venv/, so this needs either a venv at that path or a small change to fall backto
shutil.which("mypy"). The latter is probably the better fix — it makes the script work forcontributors who don't use that exact layout either.
dp_python_lib, it failsloudly rather than passing everything silently. That property is what makes it safe to gate on.
requires-pythonis>=3.10, so a matrix over 3.10–3.13 is worth considering, though a singleversion is a fine start.
Out of scope
Integration tests that need a live MLDP stack. Those can't run in CI without an ecosystem to
point at, and this issue is deliberately limited to what runs hermetically.
Context
Came out of the review of #21 (the cookbook PR). That PR tracks the checker and wires up the
[dev]extra, but stops short of running either automatically — noted there as a deliberatefollow-up rather than an omission.