Skip to content

[vibe in progress] Migrate to inline type annotations #4487

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

Draft
wants to merge 16 commits into
base: potel-base
Choose a base branch
from

Conversation

sl0thentr0py
Copy link
Member

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, and sentry_sdk/tracing.py were fully migrated. sentry_sdk/serializer.py was 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, and sentry_sdk/integrations/aws_lambda.py.
  • Migration tooling: scripts/migrate_type_annotations.py was created for automated conversions and analysis. MIGRATION_GUIDE.md and MIGRATION_STATUS.md were added for documentation and progress tracking.
  • Correction: An initial unintended functional change in sentry_sdk/feature_flags.py was 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.

@sl0thentr0py sl0thentr0py requested a review from a team as a code owner June 17, 2025 14:37
@sl0thentr0py sl0thentr0py marked this pull request as draft June 17, 2025 14:37
@sl0thentr0py sl0thentr0py force-pushed the cursor/migrate-to-inline-type-annotations-4d48 branch from f43c850 to 931cdd5 Compare June 17, 2025 15:05
Copy link

codecov bot commented Jun 17, 2025

❌ 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_warnings
Stack 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants