- Add opt-in 24-bit true-color rendering to the ANSI Pygments stack. Pass
true_color=TruetoAnsiColorLexer,AnsiFilter, or any session lexer (likeget_lexer_by_name("ansi-shell-session", true_color=True)) to preserveSGR 38;2;r;g;band48;2;r;g;bsequences asToken.Ansi.FG_{rrggbb}/Token.Ansi.BG_{rrggbb}tokens instead of quantizing them to the 256-color palette.AnsiHtmlFormatterrenders those tokens as inlinestyle="color: #rrggbb"/style="background-color: #rrggbb"spans. The default behavior (256-color quantization) is unchanged. - New
click_extra.thememodule centralizes all theme machinery:HelpExtraTheme,default_theme,nocolor_theme,OK,KO,ThemeOption,theme_optiondecorator,theme_registry, andregister_theme(). Every click-extra command now accepts--theme [dark|light]; downstream consumers can extend the choice list viaregister_theme(). The active theme for a CLI run is stored inctx.meta[context.THEME]byThemeOptionand retrieved viaget_current_theme(), so back-to-back invocations in the same process (Sphinx builds, test runners, REPLs) no longer leak--themechoices into each other. Thewrapsubcommand reads the theme from the parent group's context rather than carrying its own--theme. Adds a correspondingdocs/theme.mduser guide. Breaking: downstream code importing theme symbols directly fromclick_extra.colorizemust update toclick_extra.theme; the canonicalfrom click_extra import HelpExtraThemepath is unaffected. - New
click_extra.contextmodule consolidatesExtraContext(moved fromclick_extra.commands) and a documented registry of everyctx.metakey Click Extra writes or reads:RAW_ARGS,CONF_SOURCE,CONF_FULL,TOOL_CONFIG,VERBOSITY_LEVEL,VERBOSITY,VERBOSE,START_TIME,JOBS,TABLE_FORMAT,SORT_BY, andTHEME. Theget()andset()helpers replace scatteredctx.meta.get(key, ...)calls throughout the codebase. Replaces the formerclick_extra.ctx_metamodule. Breaking:from click_extra.commands import ExtraContextandfrom click_extra import ctx_metamust be updated tofrom click_extra.context import ExtraContextandfrom click_extra import contextrespectively; the canonicalfrom click_extra import ExtraContextpath is unaffected. - Add
python:source,python:run,python:render,python:render-myst, andpython:render-rstSphinx directives under a newpythondomain inclick_extra.sphinx. They mirrorclick:source/click:runfor arbitrary Python (no Click CLI required):python:sourceruns silently and shows source,python:runcapturesstdoutand renders it in a code block (default lexertext, override via:language:), and therenderfamily parses the capturedstdoutas live document content: generated tables, headings, admonitions, and cross-references become first-class document nodes rather than a code block.python:renderuses the host file's parser;python:render-mystforces MyST parsing (so a.rsthost can embed MyST-generated content);python:render-rstforces reST parsing (so a.mdhost can embed reST-generated content). The Python and Click runners hold independent per-document namespaces. The render family replaces thedocs_update.pyregenerator + marker-region pattern many downstream projects use; the same logic now lives inline in the doc page and runs at build time, so the rendered HTML is always current. - Breaking change: the
click:*andpython:*Sphinx directives are now disabled by default. Both families execute arbitrary Python at build time with full Sphinx-process privileges (filesystem, network, environment secrets), so registering them on every project that importsclick_extra.sphinxsilently expanded the attack surface of every consumer. To re-enable, addclick_extra_enable_exec_directives = Truetoconf.py. Always-on features (the ANSI-capable Pygments HTML formatter and the GitHub-alerts → MyST/reST converter) are unaffected. Without the flag,click:source,click:run,python:source,python:run,python:render,python:render-myst, andpython:render-rstare not registered and any reference to them produces an "Unknown directive" warning at build time. - Tighten Click floor from
8.1to8.3.1. The relaxation in7.14.1went further than needed;8.3.1is the minimum that ships the parameter-name fix we depend on. - Move
--covand--cov-report=termfrompyproject.toml[tool.pytest].addoptsinto the CI workflow. Removespytest-covas an unconditional test-time dependency for downstream packagers. - Move
tests/test_mkdocs.pyintotests/mkdocs/. Downstream packagers can skip it with--ignore=tests/mkdocswithout pulling inmkdocs-click. - Loosen
default_debug_*_version_detailsregex helpers to also matchNoneforgit_long_hash,git_short_hash, andgit_date. Lets debug-output tests pass when the source tree has no.gitdirectory (Guixgit-fetch, sdist installs). - Mark
test_ansi_lexers_candidateswith the newnetworkmarker. Sandboxed builds can exclude it withpytest -m "not network". - Make
tests/test_table.pytolerate tabulate<0.10: branch the asciidoc fixture on the cell-alignment marker (<8vs8<) and skip thecolon-gridparametrize case when the format is aliased togrid.
Full changelog: v7.14.1...v7.15.0
🛡️ VirusTotal scans
| Binary | Detections | Analysis |
|---|---|---|
click-extra-7.15.0-linux-arm64.bin |
0 / 62 | View scan |
click-extra-7.15.0-linux-x64.bin |
1 / 63 | View scan |
click-extra-7.15.0-macos-arm64.bin |
4 / 61 | View scan |
click-extra-7.15.0-macos-x64.bin |
1 / 62 | View scan |
click-extra-7.15.0-windows-arm64.exe |
1 / 68 | View scan |
click-extra-7.15.0-windows-x64.exe |
20 / 69 | View scan |