Skip to content

v1.9.0.dev4

Pre-release
Pre-release

Choose a tag to compare

@dwreeves dwreeves released this 06 Sep 21:35
· 164 commits to main since this release
c6b1ede

Warning

Version 1.9.0 deprecates support for a lot of old versions of things:

  • Python 3.7 support is removed. The minimum supported Python version is 3.8.
  • Click 7 support is removed. The minimum supported Click version is 8.0.
  • Rich 10 and 11 support is removed. The minimum supported Rich version is 12.

Warning

Version 1.9.0 introduces a minor breaking change:
The DEFAULT_STRING, ENVVAR_STRING, REQUIRED_STRING, and DEPRECATED_STRING config options are now rendered with Text.from_markup.
So for example, REQUIRED_STRING = "[required]" would be rendered as Rich markup.
You must now escape the rich markup: REQUIRED_STRING = "\\[required]"

Big changes:

  • Themes! Check them out with rich-click --themes.
  • RichPanels API introduced. This replaces the "groups" feature going forward (although groups will continue to be supported).
    • @click.option_panel()
    • @click.command_panel()
  • IDE tab completion support for decorators. Now you should no longer need to guess what goes in @click.option() or @click.command(context_settings=...) etc.
  • Help for arguments: help= is now a valid kwarg for @click.argument() decorator. See docs for more information.

Small changes:

  • "Deprecated" text properly handled and stylized in all places.
  • Command aliases: @cli.command(aliases=["foo"])
  • Improved rich-click CLI usability: improved patching and improved script detection+execution.
  • context_settings={"help_to_stderr": True} support.
  • Added suite of padding_* config options to control padding.
    • Better newline handling:
      • Unordered lists create newlines in help text, e.g. "\n- foo\n- bar" or "\n* foo\n* bar"
      • Newline control in help text with text_paragraph_linebreaks config option.
  • Added a few text_* config options, including notably text_kwargs which can control code styles in Markdown.

Backend (mostly invisible) changes:

  • Overhauled our test suite to use inline-snapshot! 😁
  • Improved test coverage and CI.
  • typing_extensions now only required for < Python 3.11.
  • RichHelpFormatter now defers printing by default if a user does not specify a Console. [#231] (With contributions from @ofek)
    • This more closely aligns the RichHelpFormatter with how base Click works.
  • Significant refactors to help text rendering.
  • Reintroduced deprecation warnings for a couple of features deprecated in 1.8.
  • There was an issue where the rich.highlighter module could load during CLI execution. We now assert in unit-tests that no rich modules are loaded during code execution, so going forward, rich imports should no longer ever be a side-effect of CLI execution.