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

Redefine click.pass_context and click.get_current_context to use cloup.Context in place of click.Context #171

Merged
merged 3 commits into from
Nov 13, 2023

Conversation

oeko2002
Copy link

@oeko2002 oeko2002 commented Nov 10, 2023

This PR redefines click.pass_context and click.get_current_context so that the type of the returned Context object is cloup.Context and not click.Context.

I (@janluke) used @overload to provide better type annotations for cloup.get_current_context: if the silent argument is not provided, the return type is Context, not Optional[Context].

@oeko2002
Copy link
Author

Would be good for somebody experienced to review. I am no full time dev.

@janluke janluke added the enhancement New feature or request label Nov 13, 2023
@janluke janluke changed the title Add cloup.pass_context being compatible with cloup.context Redefine click.pass_context and click.get_current_context to use cloup.Context in place of click.Context Nov 13, 2023
@janluke
Copy link
Owner

janluke commented Nov 13, 2023

@oeko2002 The PR was fine, thanks. I added get_current_context which presented the same problem as pass_context and moved the code up.

@janluke janluke merged commit 1d2a47f into janluke:master Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants