Skip to content

Commit

Permalink
Merge pull request #152 from dwreeves/fix-deprecation-warning
Browse files Browse the repository at this point in the history
Fix deprecation warning
  • Loading branch information
dwreeves authored Jan 5, 2024
2 parents 8aba9a7 + 42a592b commit 7d40b91
Show file tree
Hide file tree
Showing 27 changed files with 39 additions and 7 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
# Changelog: rich-click

## Version 1.7.3

- Fix false deprecation warning.

## Version 1.7.2

- Add support for rich formatting in epilog text [[#146](https://github.com/ewels/rich-click/pull/146)]

## Version 1.7.1

- Fix bug with `rich-click` CLI not working with Python 3.12. [#141](https://github.com/ewels/rich-click/issues/141)
- Fix bug with `rich-click` CLI not working with Python 3.12. [[#141](https://github.com/ewels/rich-click/issues/141)]
- Fix compatibility issue with `dbt-core` CLI. [[#140](https://github.com/ewels/rich-click/issues/140)]

## Version 1.7.0
Expand Down
2 changes: 1 addition & 1 deletion src/rich_click/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
customisation required.
"""

__version__ = "1.7.1"
__version__ = "1.7.3"

# Import the entire click API here.
# We need to manually import these instead of `from click import *` to force mypy to recognize a few type annotation overrides for the rich_click decorators.
Expand Down
10 changes: 5 additions & 5 deletions src/rich_click/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,16 @@
from importlib import metadata # type: ignore[import,unused-ignore]
except ImportError:
# Python < 3.8
import importlib_metadata as metadata # type: ignore[no-redef,import-not-found]
import importlib_metadata as metadata # type: ignore[no-redef,import-not-found,unused-ignore]

import click
from rich.console import Console
from rich.padding import Padding
from rich.panel import Panel
from rich.text import Text

from rich_click import command as rich_command
from rich_click import group as rich_group
from rich_click import RichCommand, RichCommandCollection, RichGroup, RichMultiCommand
from rich_click.decorators import command as rich_command
from rich_click.decorators import group as rich_group
from rich_click.rich_click import (
ALIGN_ERRORS_PANEL,
ERRORS_PANEL_TITLE,
Expand All @@ -29,6 +28,7 @@
STYLE_USAGE,
STYLE_USAGE_COMMAND,
)
from rich_click.rich_command import RichCommand, RichCommandCollection, RichGroup, RichMultiCommand

console = Console()

Expand Down Expand Up @@ -70,7 +70,7 @@ def patch() -> None:
click.Command = RichCommand # type: ignore[misc]
click.CommandCollection = RichCommandCollection # type: ignore[misc]
if "MultiCommand" in dir(click):
click.MultiCommand = RichMultiCommand # type: ignore[assignment,misc]
click.MultiCommand = RichMultiCommand # type: ignore[assignment,misc,unused-ignore]


def entry_points(*, group: str) -> "metadata.EntryPoints": # type: ignore[name-defined]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"style_metavar_append": "dim yellow",
"style_metavar_separator": "dim",
"style_header_text": "",
"style_epilog_text": "",
"style_footer_text": "",
"style_usage": "yellow",
"style_usage_command": "bold",
Expand Down

0 comments on commit 7d40b91

Please sign in to comment.