Repository navigation
runnable: runnable.args, sys.argv from the title, a quiet sys.exit() and COLUMNS from the panel width - #43
Merged
Merged
Conversation
…it()` and `COLUMNS` from the panel width A Click or Typer command in a block now runs with the code of a real file, with no `standalone_mode=False` or `prog_name`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ewels
added a commit
that referenced
this pull request
Nov 18, 2026
…dd PyPI spellings to the skill Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ewels
added a commit
that referenced
this pull request
Nov 18, 2026
* docs: run a Click or Typer command line tool, and PyPI name spellings Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * docs: remove the command line tool example, which #43 replaces, and add PyPI spellings to the skill Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # skills/starlight-codeblocks/references/copy-and-run.md
…ads it, and a transform-proof `COLUMNS` - `runnable.args` takes backslash escapes as a shell does. - A bad `runnable.args` or `runnable.packages` no longer warns about a site setting that does not exist. - `runnable.args` warns on scripted output and on the built-in JavaScript and TypeScript runtimes. - The panel width ignores CSS transforms, and its probe is hidden from screen readers. - The docs say that Click help is at least 50 characters wide. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rich keeps the console that it makes on the first run, with the `COLUMNS` of that run, and the worker keeps Rich between runs. A run in a wider or narrower panel then wrapped at the old width. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # packages/starlight-codeblocks/CHANGELOG.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A Click or Typer command in a
runnableblock now runs with the code of a real file. Authors no longer addstandalone_mode=False,prog_nameoros.environ["COLUMNS"]to their examples. This replaces the workarounds that #40 documented.runnable.argsrunnable.args="--count 2 'Ada Lovelace'". It splits as a shell splits words, so quotes keep spaces in an argument. A quote that does not close gives a build warning.sys.argvto the title of the block and the arguments, aspython hello.py --count 2does. A block with no title runs asmain.py. So the usage line of Click, Typer and argparse names the program, with noprog_name.sys.exit()SystemExitas CPython does: no traceback, and only an exit message that is not a number shows, on standard error.--helpin a Click command no longer shows aSystemExit: 0traceback.>>>) stops atsys.exit(), as the REPL does.eval_code_asyncin a Python helper, in place ofrunPythonAsync. The helper has the file name<scb>, so the existing traceback trimming drops its frames.COLUMNSCOLUMNSto it, so help text from argparse, Click and Rich fits the panel. Click still uses at least 50 columns.Runtimeinterfacerun()getsargs,fileandcolumnsin its options, so custom runtimes can use them. The runtime guide describes them.runnable.args="--help". The Typer note (runnable.packages="markdown-it-py pygments") moved here from docs: PyPI reads _, - and . in package names as the same character #40.DECISIONS.mdand the changelog have entries too.Tests
astro dev, against the Pyodide runtime:sys.argvandCOLUMNSget the values that were passed, andmain.pyand noCOLUMNSwhen nothing was passed.sys.exit("bad input")prints the message on standard error, andsys.exit(2)prints nothing.ZeroDivisionErrortraceback still starts at the reader's line, and top-levelawaitstill works.sys.exit(0).runnable.argssplitting, thedata-scb-runnable-fileattribute and the warning for a quote that does not close.Usage: hello.py [OPTIONS] NAMEand has no standard error. The example indexes inrunnable.test.tsmove up by one.pnpm lint,pnpm lint:docs,pnpm testandpnpm docs:buildpass. The runnable, compat and carousel Playwright specs pass in all projects.🤖 Generated with Claude Code