sentry-python
sentry-python copied to clipboard
[vibe in progress] Migrate to inline type annotations
The codebase was migrated from comment-based to inline type annotations following PEP 484. This involved:
- Core SDK files:
sentry_sdk/session.py,sentry_sdk/feature_flags.py,sentry_sdk/_lru_cache.py,sentry_sdk/_werkzeug.py,sentry_sdk/logger.py,sentry_sdk/worker.py,sentry_sdk/scrubber.py,sentry_sdk/monitor.py,sentry_sdk/_log_batcher.py,sentry_sdk/client.py, andsentry_sdk/tracing.pywere fully migrated.sentry_sdk/serializer.pywas intentionally skipped due to its complexity. - Integration files: 16 major integration files were migrated, including
sentry_sdk/integrations/trytond.py,sentry_sdk/integrations/typer.py,sentry_sdk/integrations/statsig.py,sentry_sdk/integrations/unleash.py,sentry_sdk/integrations/serverless.py,sentry_sdk/integrations/socket.py,sentry_sdk/integrations/atexit.py,sentry_sdk/integrations/pure_eval.py,sentry_sdk/integrations/graphene.py,sentry_sdk/integrations/fastapi.py,sentry_sdk/integrations/chalice.py,sentry_sdk/integrations/quart.py,sentry_sdk/integrations/beam.py,sentry_sdk/integrations/langchain.py,sentry_sdk/integrations/asgi.py,sentry_sdk/integrations/flask.py, andsentry_sdk/integrations/aws_lambda.py. - Migration tooling:
scripts/migrate_type_annotations.pywas created for automated conversions and analysis.MIGRATION_GUIDE.mdandMIGRATION_STATUS.mdwere added for documentation and progress tracking. - Correction: An initial unintended functional change in
sentry_sdk/feature_flags.pywas reverted to ensure strict adherence to type annotation migration.
The changes standardize type hinting, improving IDE support, type safety, and developer experience across the core SDK and key integrations.
:x: 1 Tests Failed:
| Tests completed | Failed | Passed | Skipped |
|---|---|---|---|
| 24083 | 1 | 24082 | 5575 |
View the top 1 failed test(s) by shortest run time
tests.integrations.logging.test_logging::test_logging_captured_warningsStack Traces | 0.044s run time
.../integrations/logging/test_logging.py:262: in test_logging_captured_warnings assert len(recwarn) == 1 E assert 2 == 1 E + where 2 = len(WarningsRecorder(record=True))
To view more test analytics, go to the Test Analytics Dashboard 📋 Got 3 mins? Take this short survey to help us improve Test Analytics.