Skip to content
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

🗑️ Deprecate support for is_flag and flag_value parameters #987

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

svlandeg
Copy link
Member

@svlandeg svlandeg commented Sep 13, 2024

Fixes #986

  • Raise a DeprecationWarning when OptionInfo receives a value for is_flag and/or flag_value
  • TyperOption doesn't use flag_value anymore and its is_flag is now defined only by looking at whether or not main_type is bool

These parameters weren't actually functional (cf. #873) and they weren't documented, so I don't think this should be breaking. But it's always difficult to say - users could be relying on unspecified internals... 🫤

callback=install_callback,
expose_value=False,
help="Install completion for the current shell.",
),
show_completion: bool = Option(
None,
"--show-completion",
is_flag=True,
Copy link
Member Author

@svlandeg svlandeg Sep 13, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure why we had these is_flag specifications here. I think we can just remove them, because we removed the parameter_info.is_flag is not False condition. Would be good if you could double check, @tiangolo 🙏

@svlandeg svlandeg self-assigned this Sep 13, 2024
@svlandeg svlandeg marked this pull request as draft September 13, 2024 13:35
@svlandeg svlandeg changed the title 🔥 Deprecate support for is_flag and flag_value parameters 🗑️ Deprecate support for is_flag and flag_value parameters Sep 13, 2024
@svlandeg svlandeg marked this pull request as ready for review September 13, 2024 14:06
@svlandeg svlandeg removed their assignment Sep 13, 2024
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.

Deprecate support for is_flag and flag_value parameters
1 participant