8000 Method used to build prompts under the hood does not allow for full format customization · Issue #2875 · pallets/click · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Method used to build prompts under the hood does not allow for full format customization #2875

New issue
Open
AdamPiotrowski91 opened this issue Mar 27, 2025 · 1 comment · May be fixed by #2880
Open
Labels
TBD Not enough information to proceed

Comments

@AdamPiotrowski91
Copy link

Currently method _build_prompt is implemented in very opinionated way regarding formatting how to display choices or default value. Considering how good of a job the rest of the features do in regards to potential extensions and customizations, I am surprised that the best way I found to customize this method is to overwrite it before use, for example as follows:

import click

def my_own_build_prompts(*args, **kwargs):
    pass

click.termui._build_prompt = my_own_build_prompts

Even though it is "technically" possible to override, I'd argue the fact that in order to find it I had to dig deep into codebase and find the details of implementation feels "hacky" and "not intended" - and for sure error prone and not future-proof.

I am very happy to contribute and implement the solution, but I'd rather hear some opinions from the library owners beforehand whether this is something they'd find valuable.

@Rowlando13
Copy link
Collaborator

In general, I am open to new community sourced ideas, and I appreciate the effort you put into this. However, Click is so widely used, that I would like to have more comprehensive docs and better test coverage before anything major is added, unless there is very clear community support. I will continue to keep an eye on this to see if it gathers community support.

@Rowlando13 Rowlando13 added the TBD Not enough information to proceed label Apr 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
TBD Not enough information to proceed
Projects
None yet
2 participants
0