fix: Replace deprecated typing imports with built-in types

- Replace Dict, List, Set, Tuple with dict, list, set, tuple throughout codebase
- Add missing type annotations to crew_events.py methods
- Add proper type annotations to test_crew_cancellation.py
- Use type: ignore[method-assign] comments for mock assignments
- Maintain backward compatibility while modernizing type hints

This resolves lint and type-checker failures in CI while preserving
the cancellation functionality.

Co-Authored-By: João <joao@crewai.com>
This commit is contained in:
Devin AI
2025-09-04 02:07:02 +00:00
parent 3a54cc859a
commit 3619d4dc50
108 changed files with 662 additions and 672 deletions

View File

@@ -1,4 +1,4 @@
from typing import Any, Tuple
from typing import Any
from pydantic import BaseModel, Field
@@ -65,14 +65,14 @@ class LLMGuardrail:
return result
def __call__(self, task_output: TaskOutput) -> Tuple[bool, Any]:
def __call__(self, task_output: TaskOutput) -> tuple[bool, Any]:
"""Validates the output of a task based on specified criteria.
Args:
task_output (TaskOutput): The output to be validated.
Returns:
Tuple[bool, Any]: A tuple containing:
tuple[bool, Any]: A tuple containing:
- bool: True if validation passed, False otherwise
- Any: The validation result or error message
"""