Commit 8409979
committed
fix(sdk/crewai): add type: ignore[attr-defined] for dynamic event_bus API
Pre-fix the new event-bus bridge in 0.13.9 imports
EventBusListener from crewai.events.event_bus and
calls crewai_event_bus.scoped_listener without type:
ignore[attr-defined]. CI mypy src/ fails with:
src/nullrun/instrumentation/crewai.py:188: error: Module
"crewai.events.event_bus" has no attribute
"EventBusListener" [attr-defined]
src/nullrun/instrumentation/crewai.py:208: error:
"CrewAIEventsBus" has no attribute "scoped_listener"
[attr-defined]
because the stubs published for these submodules don't
enumerate the public symbols we reach for at runtime. The
imports are guarded by except ImportError (pre-1.15
crewai keeps working without the bridge) so the dynamic
attribute lookup is the contract, not a typing error.
Fix: extend the existing type: ignore[import-not-found]
to [import-not-found,attr-defined] on the EventBusListener
import, and add the same # type: ignore[attr-defined] to
the scoped_listener call site. No runtime behaviour
change — pure typing-CI patch.
Local verification:
* pytest tests/test_crewai_patch.py
tests/test_runtime.py tests/test_runtime_branches.py
tests/test_track_batch_retry.py
tests/test_track_span_context.py
tests/test_v3_wire_contract.py —
142 passed, 1 skipped, 2 warnings (same as pre-fix).
CI fix; no public API change; no version bump.1 parent 5e379c9 commit 8409979
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
186 | | - | |
| 186 | + | |
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
0 commit comments