Skip to content

⬆️ Add compatibility with Click 8.2#1222

Merged
tiangolo merged 23 commits intomasterfrom
click-8.2
May 26, 2025
Merged

⬆️ Add compatibility with Click 8.2#1222
tiangolo merged 23 commits intomasterfrom
click-8.2

Conversation

@tiangolo
Copy link
Copy Markdown
Member

⬆️ Add compatibility with Click 8.2

@thewhaleking
Copy link
Copy Markdown

Also, the docs reference using mix_stderr=False for CliRunner, but this is not longer available in Click 8.2.0

Comment thread typer/core.py Outdated
@davidism
Copy link
Copy Markdown

I haven't looked over this PR, but we did just add a new doc page about supporting multiple versions in Click, with an example for the get_metavar signature change. https://click.palletsprojects.com/en/stable/support-multiple-versions/ If there are other parts that you think we should document, or need help figuring out compatibility with, please let us (Click maintainers) know.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@tiangolo
Copy link
Copy Markdown
Member Author

tiangolo commented May 22, 2025

Thanks a lot for offering help @davidism and especially for writing those docs! 🙌


I'm currently debugging the output showing errors for required parameters, with the update it doesn't show what was the (missing) required parameter, I probably have something wrong here... still debugging. 🤓 This was mainly about updating output formatting.

Now I'm debugging something related to shell completion. The shell completion thing was only about accessing the result.output.


The challenge was finding something related to the new support for enums in Click. In Click 8.2, choice types can use enums, but they expect the command to pass the name of the enum, not the value. And Typer has supported enums but using the value as the input instead of the enum name. This was handled by creating a custom Typer class type for choice that handles the input with the old Typer behavior.

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

kiinami added a commit to kamihi-dev/kamihi that referenced this pull request May 26, 2025
@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

@tiangolo tiangolo marked this pull request as ready for review May 26, 2025 14:18
@tiangolo tiangolo merged commit 74e0923 into master May 26, 2025
24 checks passed
@tiangolo tiangolo deleted the click-8.2 branch May 26, 2025 14:22
@tiangolo
Copy link
Copy Markdown
Member Author

This is now available in Typer 0.16.0 🚀 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants