Commit 7fe8daf
committed
fix(sdk/crewai): split EventBusListener import + attr-defined ignore on module
CI ruff check src/ fails on the 0.13.9-rc3 candidate
with:
I001 Import block is un-sorted or un-formatted
--> src/nullrun/instrumentation/crewai.py:187:9
The two from crewai.events.* import lines had to share an
import block per isort default rules — but the existing
type-ignore comments attached them to a single line, which
ruff flagged. ruff check --fix collapses the second line
into a multi-line parenthesised block, but the
# type: ignore[attr-defined] then lands on the attribute
line (EventBusListener) instead of the module line, and
mypy needs it on the module line to silence the
"Module has no attribute 'EventBusListener'" error.
Fix: split the import into a parenthesised block and put the
attr-defined ignore on the module-level line, not the
attribute line. Ruff is now satisfied (single block, sorted)
and mypy is also satisfied (attr-defined error suppressed
at the correct scope).
Local verification:
* ruff check src/ — "All checks passed!".
* mypy src/nullrun/instrumentation/crewai.py —
"Success: no issues found in 1 source file".
* pytest tests/test_crewai_patch.py
tests/test_runtime.py tests/test_runtime_branches.py
test_track_batch_retry.py test_track_span_context.py
test_v3_wire_contract.py —
142 passed, 1 skipped, 2 warnings.
No runtime change; pure lint/typing patch.1 parent 6dbc6d5 commit 7fe8daf
1 file changed
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| |||
0 commit comments