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

Add click.exception to __init__.py #1144

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

VikalpRusia
Copy link

Added more exceptions from click.exception to typer.init so that it has all exceptions.

Added more exceptions from click.exception to typer.__init__ so that it has all exceptions.
Copy link
Member

@svlandeg svlandeg left a comment

Choose a reason for hiding this comment

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

Could you explain more why we'd need this?

@svlandeg svlandeg added feature New feature, enhancement or request waiting labels Feb 6, 2025
@VikalpRusia
Copy link
Author

Could you explain more why we'd need this?

As there are few exceptions which are in init file while others are not there.

What I am suggesting is to have all or have None for uniformity

@github-actions github-actions bot removed the waiting label Feb 6, 2025
@svlandeg
Copy link
Member

svlandeg commented Feb 6, 2025

Could you explain more why we'd need this?

As there are few exceptions which are in init file while others are not there.

What I am suggesting is to have all or have None for uniformity

Well, the ones that are currently in there are there because they are being used in Typer's core codebase, e.g. to raise typer.Abort(). So we definitely can't remove those.

Conversely, I'm not sure it adds anything to import exceptions that are not used.

@VikalpRusia
Copy link
Author

VikalpRusia commented Feb 6, 2025

Could you explain more why we'd need this?

As there are few exceptions which are in init file while others are not there.
What I am suggesting is to have all or have None for uniformity

Well, the ones that are currently in there are there because they are being used in Typer's core codebase, e.g. to raise typer.Abort(). So we definitely can't remove those.

Conversely, I'm not sure it adds anything to import exceptions that are not used.

Won't it be better to import from typer instead of click?
just like fastapi provides starlette things
@svlandeg ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature, enhancement or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants