Skip to content

fix: Handle mypy 2.0 related failures#6218

Merged
alexander-alderman-webb merged 17 commits intomasterfrom
webb/test-ci-3
May 7, 2026
Merged

fix: Handle mypy 2.0 related failures#6218
alexander-alderman-webb merged 17 commits intomasterfrom
webb/test-ci-3

Conversation

@alexander-alderman-webb
Copy link
Copy Markdown
Contributor

@alexander-alderman-webb alexander-alderman-webb commented May 7, 2026

Description

Non-integration failures:

sentry_sdk/_compat.py:57: error: Incompatible return value type (got "Literal[b'', ''] | Any | bool", expected "bool")  [return-value]
sentry_sdk/serializer.py:341: error: Argument 1 to "enumerate" has incompatible type "object"; expected "Iterable[Never]"  [arg-type]
sentry_sdk/serializer.py:343: error: Argument 1 to "len" has incompatible type "object"; expected "Sized"  [arg-type]
sentry_sdk/crons/api.py:21: error: Name "check_in_id" already defined on line 15  [no-redef]
sentry_sdk/crons/api.py:26: error: Incompatible types (expression has type "str | None", TypedDict item "check_in_id" has type "str")  [typeddict-item]
sentry_sdk/tracing.py:968: error: Name "scope" already defined on line 943  [no-redef]
sentry_sdk/scope.py:521: error: Need type annotation for "incoming_trace_information"  [var-annotated]
sentry_sdk/scope.py:1068: error: Name "crumb" already defined on line 1047  [no-redef]
sentry_sdk/scope.py:1069: error: Item "None" of "dict[str, Any] | None" has no attribute "update"  [union-attr]
sentry_sdk/scope.py:1073: error: Name "hint" already defined on line 1048  [no-redef]
sentry_sdk/client.py:867: error: Name "hint" already defined on line 854  [no-redef]
sentry_sdk/client.py:869: error: Argument 2 to "_should_capture" of "_Client" has incompatible type "dict[str, Any] | None"; expected "dict[str, Any]"  [arg-type]
sentry_sdk/client.py:877: error: Argument 2 to "_prepare_event" of "_Client" has incompatible type "dict[str, Any] | None"; expected "dict[str, Any]"  [arg-type]
sentry_sdk/client.py:893: error: Argument 2 to "_should_sample_error" of "_Client" has incompatible type "dict[str, Any] | None"; expected "dict[str, Any]"  [arg-type]
sentry_sdk/client.py:897: error: Item "None" of "dict[str, Any] | None" has no attribute "get"  [union-attr]
sentry_sdk/client.py:951: error: Unused "type: ignore" comment  [unused-ignore]
sentry_sdk/client.py:963: error: Unused "type: ignore" comment  [unused-ignore]
sentry_sdk/client.py:965: error: Unused "type: ignore" comment  [unused-ignore]
sentry_sdk/hub.py:149: error: Unused "type: ignore" comment  [unused-ignore]

openai-agents:

sentry_sdk/integrations/openai_agents/__init__.py:103: error: Item "None" of "Any | None" has no attribute "get_all_tools"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:109: error: Item "None" of "Any | None" has no attribute "get_all_tools"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:114: error: Item "None" of "Any | None" has no attribute "get_model"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:118: error: Item "None" of "Any | None" has no attribute "get_model"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:122: error: Item "None" of "Any | None" has no attribute "run_single_turn"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:126: error: Item "None" of "Any | None" has no attribute "run_single_turn"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:130: error: Item "None" of "Any | None" has no attribute "run_single_turn_streamed"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:135: error: Item "None" of "Any | None" has no attribute "run_single_turn_streamed"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:140: error: Item "None" of "Any | None" has no attribute "execute_handoffs"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:154: error: Item "None" of "Any | None" has no attribute "execute_final_output"  [union-attr]
sentry_sdk/integrations/openai_agents/__init__.py:156: error: Item "None" of "Any | None" has no attribute "execute_final_output"  [union-attr]

mcp:

sentry_sdk/integrations/mcp.py:499: error: Item "None" of "Any | None" has no attribute "scheme"  [union-attr]
sentry_sdk/integrations/mcp.py:642: error: Item "None" of "Any | None" has no attribute "_get_prompt_mcp"  [union-attr]
sentry_sdk/integrations/mcp.py:656: error: Item "None" of "Any | None" has no attribute "_get_prompt_mcp"  [union-attr]
sentry_sdk/integrations/mcp.py:659: error: Item "None" of "Any | None" has no attribute "_read_resource_mcp"  [union-attr]
sentry_sdk/integrations/mcp.py:673: error: Item "None" of "Any | None" has no attribute "_read_resource_mcp"  [union-attr]

dramatiq:

sentry_sdk/integrations/opentelemetry/integration.py:55: error: "None" not callable  [misc]

opentelemetry:

sentry_sdk/integrations/dramatiq.py:61: error: Need type annotation for "args"  [var-annotated]
sentry_sdk/integrations/dramatiq.py:73: error: Unused "type: ignore" comment  [unused-ignore]

cloud_resource_context:

sentry_sdk/integrations/cloud_resource_context.py:193: error: Value of type "None" is not indexable  [index]
sentry_sdk/integrations/cloud_resource_context.py:198: error: Value of type "None" is not indexable  [index]
sentry_sdk/integrations/cloud_resource_context.py:206: error: Value of type "None" is not indexable  [index]
sentry_sdk/integrations/cloud_resource_context.py:213: error: Value of type "None" is not indexable  [index]

grpc:

sentry_sdk/integrations/grpc/__init__.py:155: error: Name "interceptors" already defined on line 151  [no-redef]
sentry_sdk/integrations/grpc/__init__.py:166: error: Argument 1 to "tuple" has incompatible type "Sequence[Any] | None"; expected "Iterable[Any]"  [arg-type]

sanic:

sentry_sdk/integrations/sanic.py:76: error: Incompatible types in assignment (expression has type "tuple[int, ...] | None", variable has type "None")  [assignment]

starlette:

sentry_sdk/integrations/starlette.py:478: error: "Any | Callable[..., Any]" not callable  [operator]

wsgi:

sentry_sdk/integrations/_wsgi_common.py:113: error: Exception type must be derived from BaseException (or be a tuple of exception classes)  [misc]
sentry_sdk/integrations/_wsgi_common.py:178: error: Exception type must be derived from BaseException (or be a tuple of exception classes)  [misc]

gnu_backtrace:

sentry_sdk/integrations/gnu_backtrace.py:72: error: Item "str" of "str | Pattern[str]" has no attribute "match"  [union-attr]

django:

sentry_sdk/integrations/django/asgi.py:47: error: Unused "type: ignore" comment  [unused-ignore]
sentry_sdk/integrations/django/__init__.py:144: error: Incompatible types in assignment (expression has type "bool", variable has type "None")  [assignment]
sentry_sdk/integrations/django/__init__.py:146: error: Incompatible types in assignment (expression has type "bool", variable has type "None")  [assignment]
sentry_sdk/integrations/django/__init__.py:149: error: Incompatible types in assignment (expression has type "bool", variable has type "None")  [assignment]

Issues

Reminders

@alexander-alderman-webb alexander-alderman-webb marked this pull request as draft May 7, 2026 06:26
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

Codecov Results 📊

13 passed | Total: 13 | Pass Rate: 100% | Execution Time: 9.73s

📊 Comparison with Base Branch

Metric Change
Total Tests
Passed Tests
Failed Tests
Skipped Tests

✨ No test changes detected

All tests are passing successfully.

❌ Patch coverage is 16.42%. Project has 15051 uncovered lines.
❌ Project coverage is 31.31%. Comparing base (base) to head (head).

Files with missing lines (19)
File Patch % Lines
__init__.py 5.08% ⚠️ 374 Missing
starlette.py 5.84% ⚠️ 371 Missing
scope.py 71.73% ⚠️ 253 Missing and 84 partials
client.py 59.67% ⚠️ 217 Missing and 69 partials
mcp.py 5.86% ⚠️ 257 Missing
tracing.py 70.58% ⚠️ 143 Missing and 39 partials
sanic.py 9.60% ⚠️ 160 Missing
cloud_resource_context.py 0.00% ⚠️ 147 Missing
asgi.py 0.00% ⚠️ 109 Missing
hub.py 45.60% ⚠️ 105 Missing and 3 partials
__init__.py 0.00% ⚠️ 93 Missing
_wsgi_common.py 31.30% ⚠️ 90 Missing and 1 partials
__init__.py 4.55% ⚠️ 84 Missing
gnu_backtrace.py 0.00% ⚠️ 51 Missing
serializer.py 84.95% ⚠️ 28 Missing and 10 partials
integration.py 0.00% ⚠️ 32 Missing
_compat.py 41.03% ⚠️ 23 Missing
dramatiq.py 90.91% ⚠️ 10 Missing and 9 partials
api.py 100.00% ⚠️ 1 partials
Coverage diff
@@            Coverage Diff             @@
##          main       #PR       +/-##
==========================================
- Coverage    31.32%    31.31%    -0.01%
==========================================
  Files          190       190         —
  Lines        21903     21912        +9
  Branches      7364      7372        +8
==========================================
+ Hits          6860      6861        +1
- Misses       15043     15051        +8
- Partials       579       579         —

Generated by Codecov Action

Comment thread sentry_sdk/integrations/openai_agents/__init__.py
@alexander-alderman-webb alexander-alderman-webb changed the title [do not merge] Test CI fix(openai-agents): Gate patches against ImportError May 7, 2026
@alexander-alderman-webb alexander-alderman-webb marked this pull request as ready for review May 7, 2026 09:44
@alexander-alderman-webb alexander-alderman-webb requested a review from a team as a code owner May 7, 2026 09:44
@alexander-alderman-webb alexander-alderman-webb changed the title fix(openai-agents): Gate patches against ImportError fix: Handle mypy 2.0 related failures May 7, 2026
Comment thread sentry_sdk/integrations/_wsgi_common.py
@alexander-alderman-webb alexander-alderman-webb merged commit bd567bd into master May 7, 2026
154 of 156 checks passed
@alexander-alderman-webb alexander-alderman-webb deleted the webb/test-ci-3 branch May 7, 2026 11:08
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