-
|
Hi ! But starting with rich-click 1.9, the help page doesn't show commands anymore. My root group code looks like this: @click.group(
cls=ClickAppGroup,
lazy_subcommands={
"build": "it4c.builder.cli.run",
"products": "it4c.products.cli.run",
"ci": "it4c.ci.cli.run",
"export_api_versions": "it4c.apiversions.cli.run",
"karma": "it4c.karma.cli.run",
"test": "it4c.test.cli.run",
},
)( Adding a @click.command_panel(
"Test", commands=["build", "products", "ci", "export_api_versions", "karma", "test"]
)
Is there a fix or a workaround I could use to get the old behavior ? (knowing I really expected the panels feature to group subcommands options!) Thanks ! |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments 1 reply
-
|
I just found a workaround: renaming my |
Beta Was this translation helpful? Give feedback.
-
|
Hi @gdlx, There are two sources of issues here, and I will chalk them both up to a regression on our end, and we can look into fixing it. The first is the command names failing to load into the panel by default. This issue is easy to explain, and this is the reason why: rich-click/src/rich_click/rich_panel.py Lines 313 to 318 in f041971 There was a reason I did it this way but I sort of forget the full reasoning. In any case, it seems to be a potential source of issues, so we can move to the public interface so that it's easier to override. The second issue-- everything being named rich-click/tests/help/fixtures/panels_sorting.py Lines 127 to 132 in f041971 rich-click/tests/help/test_panels_sorting.py Lines 271 to 294 in f041971 Unfortunately I don't have time in the next few days to fix this, but by next weekend we can probably have a fix in? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the detailed answer. def __init__(
self,
*args,
lazy_subcommands: dict[str, str] | None = None,
**kwargs,
) -> None:
super().__init__(*args, **kwargs)
self.lazy_subcommands = lazy_subcommands or {}
self.add_panel(
rich_click.RichCommandPanel(
"Commands", commands=list(self.lazy_subcommands.keys())
)
)It's far from perfect but those both fixes allow me to get the same result as before 1.9 until a fix is released. |
Beta Was this translation helpful? Give feedback.
-
|
Ahhh, I forgot to address this in rich-click 1.9.2, as I was looking at the issues tab. This should be an issue, and I'll open one. That said, I don't think it is a high priority, as there is a way around it and in general, subclassed behavior is not always expected to be perfectly stable across minor versions. |
Beta Was this translation helpful? Give feedback.
-
|
Yes, sorry, I should have opened an issue but I wasn't sure it was on rich-click side. Do you want me to open one ? |
Beta Was this translation helpful? Give feedback.
-
It's fine. It should be fixed now. Another large library had a similar issue and I figured this was too widespread an issue and needed to address more quickly. Thanks for reporting! |
Beta Was this translation helpful? Give feedback.



Hi @gdlx,
There are two sources of issues here, and I will chalk them both up to a regression on our end, and we can look into fixing it.
The first is the command names failing to load into the panel by default. This issue is easy to explain, and this is the reason why:
rich-click/src/rich_click/rich_panel.py
Lines 313 to 318 in f041971
There was a reason I did it this way but I sort of forget the full reasoning. In any case, it seems to be a potential source of…