Skip to content

Commit 21c152c

Browse files
committed
fix: remove use of click-help-colors
Removes dependency on click-help-colors which is not maintained and causes some warnings with py314. Partial: #4568
1 parent 0c71607 commit 21c152c

File tree

4 files changed

+0
-43
lines changed

4 files changed

+0
-43
lines changed

.pre-commit-config.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ repos:
108108
additional_dependencies:
109109
- ansible-compat>=25.1.4
110110
- click
111-
- click-help-colors
112111
- enrich>=1.2.7
113112
- filelock
114113
- jsonschema
@@ -124,7 +123,6 @@ repos:
124123
additional_dependencies:
125124
- ansible-compat>=25.1.4
126125
- click
127-
- click-help-colors
128126
- enrich
129127
- pytest
130128
- pytest-mock

pyproject.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ dependencies = [
3131
"ansible-compat>=25.1.4",
3232
"ansible-core>=2.15.0",
3333
"click>=8.0,<9",
34-
"click-help-colors>=0.9.4",
3534
"enrich>=1.2.7",
3635
"jinja2>=2.11.3",
3736
"jsonschema>=4.9.1",
@@ -131,7 +130,6 @@ strict = true
131130
[[tool.mypy.overrides]]
132131
ignore_missing_imports = true
133132
module = [
134-
"click_help_colors", # https://github.com/click-contrib/click-help-colors/issues/20
135133
"testinfra.*", # https://github.com/pytest-dev/pytest-testinfra/issues/619
136134
]
137135

src/molecule/click_cfg.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@
1515

1616
import click
1717

18-
from click_help_colors import HelpColorsCommand, HelpColorsGroup
19-
2018
from molecule import util
2119
from molecule.ansi_output import should_do_markup
2220
from molecule.api import drivers
@@ -524,14 +522,6 @@ def __init__(self, *args: object, **kwargs: object) -> None:
524522
self.help = first_line
525523

526524

527-
class FirstLineHelpCommand(FirstLineHelpMixin, HelpColorsCommand):
528-
"""Override the default help generation to remove the args section."""
529-
530-
531-
class FirstLineHelpGroup(FirstLineHelpMixin, HelpColorsGroup):
532-
"""Override the default help generation to remove the args section."""
533-
534-
535525
def click_group_ex() -> ClickGroup:
536526
"""Return extended version of click.group().
537527
@@ -544,25 +534,13 @@ def click_group_ex() -> ClickGroup:
544534
# blue : molecule own command, not dependent on scenario
545535
# yellow : special commands, like full test sequence, or login
546536
return click.group(
547-
cls=FirstLineHelpGroup,
548537
# Workaround to disable click help line truncation to ~80 chars
549538
# https://github.com/pallets/click/issues/486
550539
context_settings={
551540
"max_content_width": 9999,
552541
"color": should_do_markup(),
553542
"help_option_names": ["-h", "--help"],
554543
},
555-
help_headers_color="yellow",
556-
help_options_color="green",
557-
help_options_custom_colors={
558-
"drivers": "blue",
559-
"init": "blue",
560-
"list": "blue",
561-
"matrix": "blue",
562-
"login": "bright_yellow",
563-
"reset": "blue",
564-
"test": "bright_yellow",
565-
},
566544
)
567545

568546

@@ -605,10 +583,7 @@ def wrapper(*args: object, **kwargs: object) -> object:
605583

606584
# Apply the click.command decorator to the wrapper
607585
return click.command(
608-
cls=FirstLineHelpCommand,
609586
name=name,
610-
help_headers_color="yellow",
611-
help_options_color="green",
612587
)(wrapper)
613588

614589
return decorator

uv.lock

Lines changed: 0 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)