v1.9.0.dev6
Pre-release
Pre-release
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. - Typer support:
rich-click typer_app --help. - 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-clickCLI 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_linebreaksconfig option.
- Unordered lists create newlines in help text, e.g.
- Better newline handling:
- Added a few
text_*config options, including notablytext_kwargswhich can control code styles in Markdown.
Backend (mostly invisible) changes:
- Overhauled our test suite to use inline-snapshot! 😁
- Improved test coverage and CI.
typing_extensionsnow only required for < Python 3.11.RichHelpFormatternow defers printing by default if a user does not specify a Console. [#231] (With contributions from @ofek)- This more closely aligns the
RichHelpFormatterwith how base Click works.
- This more closely aligns the
- 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.highlightermodule could load during CLI execution. We now assert in unit-tests that norichmodules are loaded during code execution, so going forward,richimports should no longer ever be a side-effect of CLI execution.