Migrate typing for core files
extracted from https://github.com/getsentry/sentry-python/pull/4487/files with lots of manual fixes
- migrate old style
# type: blato inline types - most importantly use
__future__.annotationsso that we can simply use forward annotations without wrapping them in strings like we did before, this simplifies things substantially - also guard only things that shouldn't be imported under
TYPE_CHECKING, in the future it seems we should avoid usingTYPE_CHECKINGcompletely
Codecov Report
Attention: Patch coverage is 97.98032% with 39 lines in your changes missing coverage. Please review.
Project coverage is 84.86%. Comparing base (
06ef70c) to head (7bfc6a0). Report is 1 commits behind head on potel-base.
:white_check_mark: All tests successful. No failed tests found.
Additional details and impacted files
@@ Coverage Diff @@
## potel-base #4500 +/- ##
==============================================
+ Coverage 84.84% 84.86% +0.01%
==============================================
Files 144 144
Lines 14882 15005 +123
Branches 2362 2374 +12
==============================================
+ Hits 12627 12734 +107
- Misses 1533 1541 +8
- Partials 722 730 +8
| Files with missing lines | Coverage Δ | |
|---|---|---|
| sentry_sdk/_init_implementation.py | 100.00% <100.00%> (ø) |
|
| sentry_sdk/_log_batcher.py | 79.76% <100.00%> (+0.24%) |
:arrow_up: |
| sentry_sdk/_lru_cache.py | 100.00% <100.00%> (ø) |
|
| sentry_sdk/_queue.py | 60.00% <100.00%> (ø) |
|
| sentry_sdk/_werkzeug.py | 50.00% <100.00%> (+1.85%) |
:arrow_up: |
| sentry_sdk/ai/monitoring.py | 88.88% <100.00%> (+0.15%) |
:arrow_up: |
| sentry_sdk/ai/utils.py | 85.71% <100.00%> (+0.71%) |
:arrow_up: |
| sentry_sdk/api.py | 96.77% <100.00%> (+0.03%) |
:arrow_up: |
| sentry_sdk/attachments.py | 100.00% <100.00%> (ø) |
|
| sentry_sdk/client.py | 84.88% <100.00%> (ø) |
|
| ... and 124 more |
@sentrivana fixed the casts and needed some changes to fix the resulting problems which were actually bad type signatures so fixed those too
also I will keep this draft and stack the other PRs on top and merge all at once into potel-base at the end