Skip to content

docs(agents): tell packages to split a long ipython block - #20

Merged
jmineau merged 1 commit into
mainfrom
docs/split-long-block
Oct 22, 2026
Merged

jmineau merged 1 commit into
mainfrom
docs/split-long-block

Conversation

@jmineau

@jmineau jmineau commented Oct 19, 2026

Copy link
Copy Markdown
Owner

Adds one sentence to the "Examples in the docs" section of the generated AGENTS.md: split a long .. ipython:: python block so that no multi-line statement is its 10th (or 100th) statement, because the directive runs only the first line of that one.

Why. In IPython's .. ipython:: directive, a multi-line statement in position 10 (or 100) of a block is cut after its first line. The build then stops with SyntaxError: incomplete input, or, in a block with :okexcept:, shows that error on the page and a NameError where the name is used next. An earlier check reproduced it on IPython 9.10.0, 9.17.1 (the newest release) and IPython main, and found that positions 1, 2, 9, 11, 99 and 101 are fine. Splitting the block is the workaround. Nothing is posted upstream.

Checked.

  • just test (bakes the template twice, with docs_notebooks yes and no, and in each runs quality-check, build-docs, every pre-commit hook, dist and the version checks) passed on a compute node: "All checks passed for both variants."
  • The line is in the generated AGENTS.md of both bakes.

Not checked. copier update on the packages (that is yours to run or approve). The wording of the sentence, which is the one thing to read.

Other open PRs in python-template: none.

A multi-line statement that is the 10th (or 100th) statement of a
`.. ipython:: python` block runs only its first line, so the build stops
with a SyntaxError, or with `:okexcept:` shows one. Say in the generated
AGENTS.md to split such a block.
@jmineau
jmineau merged commit 5260b64 into main Oct 22, 2026
1 check passed
@jmineau
jmineau deleted the docs/split-long-block branch October 22, 2026 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant