-
-
Notifications
You must be signed in to change notification settings - Fork 743
⬆️ Add compatibility with Click 8.2 #1222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Also, the docs reference using |
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 |
📝 Docs preview for commit 02f6565 at: https://a1cfb4c7.typertiangolo.pages.dev |
📝 Docs preview for commit 1cbcbc1 at: https://3eb7a4b8.typertiangolo.pages.dev |
Thanks a lot for offering help @davidism and especially for writing those docs! 🙌
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. |
📝 Docs preview for commit bd98584 at: https://ec702d88.typertiangolo.pages.dev |
📝 Docs preview for commit 17350f5 at: https://f7ea7382.typertiangolo.pages.dev |
…eping the same behavior of enums
📝 Docs preview for commit 3b8f9bc at: https://560ec3ed.typertiangolo.pages.dev |
📝 Docs preview for commit ce2f27b at: https://243fb83f.typertiangolo.pages.dev |
📝 Docs preview for commit a336edd at: https://530c5e42.typertiangolo.pages.dev |
📝 Docs preview for commit 7da4979 at: https://41a2b5ff.typertiangolo.pages.dev Modified Pages |
📝 Docs preview for commit 5c0b4a6 at: https://2203dc8e.typertiangolo.pages.dev Modified Pages |
📝 Docs preview for commit 45ca749 at: https://4703c015.typertiangolo.pages.dev Modified Pages |
This is now available in Typer 0.16.0 🚀 🎉 |
⬆️ Add compatibility with Click 8.2