Upstream

Click Extra was born as a collection of patches for unmaintained or slow-moving click-contrib addons. Over time, many of these fixes were contributed back upstream, and the project grew into a significant contributor to the Click ecosystem.

This page tracks click-extra’s relationship with its upstream dependencies: code contributed back, issues reported, workarounds provided, and features that upstream declined.

Code contributed upstream

PRs authored by the click-extra maintainer and merged into upstream projects.

click

Default and sentinel handling:

Help system:

Enum and Choice support:

Testing:

Documentation:

python-tabulate

pygments

furo

cloup

pallets-sphinx-themes

click-contrib/sphinx-click

click-contrib/click-log

Upstreamed from click-extra

Issues that click-extra solved with local workarounds first. The fix was later contributed upstream and the workaround removed from click-extra.

click

  • #2811 / #2563 - Help option eagerness and deduplication. click-extra had custom HelpOption fixes; contributed upstream and removed locally.

  • #2680 - Callbacks not properly closed on CLI exit. click-extra patched Option to force-close; contributed the fix upstream.

  • #2523 / #2522 - CliRunner conflating stderr and stdout. click-extra backported the fix before the Click release.

  • #2516 / #2517 - Help extra items (default, envvar, required) were computed and rendered together. click-extra needed them split to inject colorization; contributed the refactor upstream.

cloup

  • #160 / #162 - cloup.Group ignored command_class for subcommands. click-extra worked around it; Cloup fixed it in a later release.

  • #177 - cloup.Color could not be rendered by Sphinx. click-extra had an exception handler; Cloup fixed the import.

Addressed by click-extra

Issues that remain open or unfixed upstream. click-extra provides the solution.

Color and terminal support

click-extra implements NO_COLOR, FORCE_COLOR, and full help colorization with a theme system, addressing long-standing Click gaps:

Themes and palettes

click-extra ships six built-in palettes (dark, light, dracula, monokai, nord, solarized_dark) and is the only Click-ecosystem library that lets end users define new themes or override existing ones from the CLI’s --config file ([tool.<cli>.themes.<name>]). Click itself has no theme system — formatter-level customization is still WIP upstream — and the competing rich help layers expose themes through Python or environment variables, not the CLI’s own configuration file:

Configuration validation

click-extra’s config pipeline exposes an extension hook (ConfigValidator) so apps can validate data-keyed sub-tables ([tool.<cli>.managers.<id>], [tool.<cli>.plugins], …) inside the same strict-check pipeline that polices CLI-flag-bound keys. --validate-config collects every error before exiting and surfaces all failures with the same rooted ValidationError shape.

This is click-extra’s own design rather than an answer to a documented upstream issue: Click maintainers have closed every config-file proposal as out of scope (#1753, #386, #42, #971) and deferred to external packages, so validation of those external config files lives wherever each package chose to put it. The closest related upstream gap is click_config_file#11 (listed under Configuration files above): “warn when providing unsupported options in the config file?” — open since 2018 in an unmaintained package.

Configuration files

click-extra’s config module replaces the functionality of several unmaintained packages, with multi-format support (TOML, YAML, JSON, INI, XML), pyproject.toml integration, and a precedence chain:

Version option

click-extra’s ExtraVersionOption adds template variables for git metadata (branch, hash, date, tag), environment info, and Python/OS details, with pre-baking for compiled binaries:

Environment variables

click-extra auto-generates environment variables for all options and adds show_envvar as a global context setting:

Logging

click-extra’s logging module replaces the unmaintained click-log package:

Option parsing

Normalized arguments

ANSI rendering in documentation

click-extra provides ANSI-capable session lexers, an HTML formatter, and Sphinx integration for rendering ANSI-colored CLI output in documentation, with 24-bit true-color rendering enabled by default:

Sphinx click:source and click:run directives

click-extra maintains and extends the click:source/click:run directives originally from pallets-sphinx-themes:

Sphinx python:* directives and live document rendering

The python:source, python:run, python:render, python:render-myst, and python:render-rst directives extend the click:* family to arbitrary Python (no Click CLI required). The render* variants parse the captured stdout as live document content — generated tables, headings, admonitions, and cross-references become first-class document nodes rather than a code block. This replaces the docs_update.py regenerator + marker-region pattern that many downstream click-extra-consuming projects use (Meta Package Manager, Mail Deduplicate, …), so the rendered HTML is always current at build time without a separate generation step.

The click:* half of this story remains stuck upstream: the directives still live in pallets-sphinx-themes despite open requests to move them where Click users actually look for them, and MyST integration is unfinished:

The python:* half (rendering executed Python output as live document content) is click-extra’s own design rather than an answer to a single upstream ticket.

Declined by upstream

PRs and features rejected by upstream maintainers. click-extra provides the functionality regardless.

python-tabulate

click-extra maintains a local patch for GitHub-Flavored Markdown table alignment.

dbcli/cli_helpers

Open upstream

PRs and issues still pending upstream.

click

pygments

python-tabulate

executablebooks/MyST-Parser

click-contrib/click-log