From 2c6e49014475172c5984f956382d435d0df962bd Mon Sep 17 00:00:00 2001 From: dwreeves Date: Tue, 14 May 2024 08:29:23 -0400 Subject: [PATCH] update --- CHANGELOG.md | 4 ++++ src/rich_click/__init__.py | 2 +- src/rich_click/rich_help_configuration.py | 24 ++++++++++++----------- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d54d500..b850da7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Version 1.8.2 (2023-05-14) + +- Fix another deprecation warning issue. + ## Version 1.8.1 (2023-05-07) - Fixed bad deprecation warning with `highlighter` diff --git a/src/rich_click/__init__.py b/src/rich_click/__init__.py index 8e0d246..bd9d193 100644 --- a/src/rich_click/__init__.py +++ b/src/rich_click/__init__.py @@ -6,7 +6,7 @@ customisation required. """ -__version__ = "1.8.1" +__version__ = "1.8.2" # Import the entire click API here. # We need to manually import these instead of `from click import *` to force diff --git a/src/rich_click/rich_help_configuration.py b/src/rich_click/rich_help_configuration.py index 510cc11..0e0afae 100644 --- a/src/rich_click/rich_help_configuration.py +++ b/src/rich_click/rich_help_configuration.py @@ -172,17 +172,19 @@ class RichHelpConfiguration: legacy_windows: Optional[bool] = field(default=None) def __post_init__(self) -> None: # noqa: D105 - if self.highlighter is not None: - import warnings - - warnings.warn( - "`highlighter` kwarg is deprecated in RichHelpConfiguration." - " Please do one of the following instead: either set highlighter_patterns=[...] if you want" - " to use regex; or for more advanced use cases where you'd like to use a different type" - " of rich.highlighter.Highlighter, subclass the `RichHelpFormatter` and update its `highlighter`.", - DeprecationWarning, - stacklevel=2, - ) + # Todo: Fix this so that the deprecation warning works properly. + + # if self.highlighter is not None: + # import warnings + # + # warnings.warn( + # "`highlighter` kwarg is deprecated in RichHelpConfiguration." + # " Please do one of the following instead: either set highlighter_patterns=[...] if you want" + # " to use regex; or for more advanced use cases where you'd like to use a different type" + # " of rich.highlighter.Highlighter, subclass the `RichHelpFormatter` and update its `highlighter`.", + # DeprecationWarning, + # stacklevel=2, + # ) self.__dataclass_fields__.pop("highlighter", None)