A managed Python REPL exposed through the generic language facade (repl_start / repl_status / repl_stop / repl_eval). Activates only when the workspace looks like a Python project. The REPL is a subprocess on a project-aware interpreter (uv / poetry / .venv / python3), registered as a session resource so it shows in ctx + the footer and is stoppable by id.
A managed Python REPL exposed through the generic language facade (repl_start / repl_status / repl_stop / repl_eval). Activates only when the workspace looks like a Python project. The REPL is a subprocess on a project-aware interpreter (uv / poetry / .venv / python3), registered as a session resource so it shows in ctx + the footer and is stoppable by id.
(py-repl-eval-fn env arg)repl_eval handler for Python. Accepts a code string or
{code, dir, timeout_ms}. Requires this session to own a running REPL for the
canonical dir, then evaluates with globals persistent across calls.
repl_eval handler for Python. Accepts a code string or
`{code, dir, timeout_ms}`. Requires this session to own a running REPL for the
canonical dir, then evaluates with globals persistent across calls.(py-start-repl-fn env op opts)REPL-lifecycle handler for Python. The facade's repl_start / repl_status /
repl_stop verbs reach a pack as a positional op STRING plus opts
{dir, id, env} — there is NO restart (stop, then start), and a repl_start
for a REPL already running in THIS session REUSES it, refusing only when this
call named a different env. Other sessions have independent interpreters.
op arrives as a STRING from the model — dispatch without keyword minting.
REPL-lifecycle handler for Python. The facade's `repl_start` / `repl_status` /
`repl_stop` verbs reach a pack as a positional `op` STRING plus opts
`{dir, id, env}` — there is NO restart (stop, then start), and a `repl_start`
for a REPL already running in THIS session REUSES it, refusing only when this
call named a different `env`. Other sessions have independent interpreters.
`op` arrives as a STRING from the model — dispatch without keyword minting.(py-test-fn env arg)run_tests handler for Python. Two execution environments:
test_*.py /
*_test.py under {paths} (default: the project's declared pytest
testpaths, else tests/ if present, else the run's cwd) and runs
each in a TRUSTED embedded CPython session under real pytest.
{paths} entries may be FILES or dirs, resolve against cwd, must
exist, and discovering nothing is NOT a pass. It runs whole FILES and
has no test-name filter, so a <path>::<test-name> node id is REFUSED
here (pointing at {runner "project"}) rather than quietly
running every test in the file. The project's declared
import roots (a src layout) are on sys.path; installed third-party
deps are NOT visible. When that layout could not be READ, the result
carries a warning instead of quietly claiming the project has none.{runner "project"} shells the project interpreter's pytest
(uv/Poetry/virtualenv/system autodetection, then -m pytest <paths>)
so installed test dependencies are visible. Node ids go straight through as
pytest's own file.py::test_name, and a PATHLESS ::test_name becomes -k.
BOTH backends name their faults: every failing/erroring test comes back in
ONE failures list as {ns test type message file line}, type telling a
thrown "error" from a false-assertion "fail" (the project backend
reads pytest's own --junitxml report), and output carries the complete
transcript. Only the display preview is bounded; result data is not truncated.
python.runner in merged config chooses the DEFAULT backend; an explicit
runner argument still wins.run_tests handler for Python. Two execution environments:
- the DEFAULT is the hermetic embedded CPython. It discovers `test_*.py` /
`*_test.py` under `{paths}` (default: the project's declared pytest
`testpaths`, else `tests/` if present, else the run's `cwd`) and runs
each in a TRUSTED embedded CPython session under real `pytest`.
`{paths}` entries may be FILES or dirs, resolve against `cwd`, must
exist, and discovering nothing is NOT a pass. It runs whole FILES and
has no test-name filter, so a `<path>::<test-name>` node id is REFUSED
here (pointing at `{runner "project"}`) rather than quietly
running every test in the file. The project's declared
import roots (a `src` layout) are on `sys.path`; installed third-party
deps are NOT visible. When that layout could not be READ, the result
carries a `warning` instead of quietly claiming the project has none.
- `{runner "project"}` shells the project interpreter's pytest
(uv/Poetry/virtualenv/system autodetection, then `-m pytest <paths>`)
so installed test dependencies are visible. Node ids go straight through as
pytest's own `file.py::test_name`, and a PATHLESS `::test_name` becomes `-k`.
BOTH backends name their faults: every failing/erroring test comes back in
ONE `failures` list as `{ns test type message file line}`, `type` telling a
thrown `"error"` from a false-assertion `"fail"` (the project backend
reads pytest's own `--junitxml` report), and `output` carries the complete
transcript. Only the display preview is bounded; result data is not truncated.
`python.runner` in merged config chooses the DEFAULT backend; an explicit
`runner` argument still wins.(register-repl-resource! session dir result & [id])Mirror a managed Python REPL into the session resource registry (ctx + footer
Mirror a managed Python REPL into the session resource registry (ctx + footer + stop by id; no restart — stop, then start). No-op without a session or a live pid.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |