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 Typer integration #3869

Merged
merged 9 commits into from
Dec 18, 2024

Conversation

patrick91
Copy link
Contributor

This PR adds an integration for Typer

The integration works by mocking typer.main.except_hook, I was chatting with Sebastian and he's willing to add a hook in typer to avoid mocking, but I think it's also fine to keep the code as is 😊

The code is inspired by the ExcepthookIntegration, same thing for the test, unfortunately there's no way to test a custom except_hook with pytest, so I'm running the CLI using subprocess.

Shall I add this to the default integrations? 😊

Closes #1612
Closes #1604

@sentrivana
Copy link
Contributor

Thank you @patrick91 ❤️ We will take a look at this next week!

Shall I add this to the default integrations? 😊

As with all new integrations I'd prefer we leave this as opt-in for a couple of releases and then re-evaluate, just to be safe.

Copy link

codecov bot commented Dec 13, 2024

Codecov Report

Attention: Patch coverage is 63.33333% with 11 lines in your changes missing coverage. Please review.

Project coverage is 79.89%. Comparing base (2666022) to head (1837c5f).
Report is 1 commits behind head on master.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
sentry_sdk/integrations/typer.py 63.33% 10 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3869      +/-   ##
==========================================
- Coverage   79.93%   79.89%   -0.05%     
==========================================
  Files         137      138       +1     
  Lines       15403    15433      +30     
  Branches     2620     2623       +3     
==========================================
+ Hits        12313    12330      +17     
- Misses       2219     2229      +10     
- Partials      871      874       +3     
Files with missing lines Coverage Δ
sentry_sdk/integrations/typer.py 63.33% <63.33%> (ø)

... and 2 files with indirect coverage changes

@sentrivana sentrivana added the Trigger: tests using secrets PR code is safe; run CI label Dec 17, 2024
@github-actions github-actions bot removed the Trigger: tests using secrets PR code is safe; run CI label Dec 18, 2024
@sentrivana sentrivana added the Trigger: tests using secrets PR code is safe; run CI label Dec 18, 2024
@sentrivana sentrivana enabled auto-merge (squash) December 18, 2024 10:48
@sentrivana sentrivana merged commit 4e69cb7 into getsentry:master Dec 18, 2024
136 of 137 checks passed
@patrick91 patrick91 deleted the feature/typer-integration branch December 18, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Trigger: tests using secrets PR code is safe; run CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sentry won't work properly with typer
2 participants