Skip to content

Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.

Support Python 3.10+ (on CI) and remove redundant Self imports (#2553)

Lucas Gomided2caf11191bc
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
index f655dcc64..9ee0e999a 100644
--- a/.github/workflows/tests.yml
+++ b/.github/workflows/tests.yml
@@ -12,6 +12,9 @@ jobs:
tests:
runs-on: ubuntu-latest
timeout-minutes: 15
+ strategy:
+ matrix:
+ python-version: ['3.10', '3.11', '3.12']
steps:
- name: Checkout code
uses: actions/checkout@v4
@@ -21,9 +24,8 @@ jobs:
with:
enable-cache: true
-
- - name: Set up Python
- run: uv python install 3.12.8
+ - name: Set up Python ${{ matrix.python-version }}
+ run: uv python install ${{ matrix.python-version }}
- name: Install the project
run: uv sync --dev --all-extras
diff --git a/src/crewai/memory/external/external_memory.py b/src/crewai/memory/external/external_memory.py
index 4ecf3d065..be35f513b 100644
--- a/src/crewai/memory/external/external_memory.py
+++ b/src/crewai/memory/external/external_memory.py
@@ -1,4 +1,4 @@
-from typing import TYPE_CHECKING, Any, Dict, Optional, Self
+from typing import TYPE_CHECKING, Any, Dict, Optional
from crewai.memory.external.external_memory_item import ExternalMemoryItem
from crewai.memory.memory import Memory
@@ -52,7 +52,7 @@ class ExternalMemory(Memory):
def reset(self) -> None:
self.storage.reset()
- def set_crew(self, crew: Any) -> Self:
+ def set_crew(self, crew: Any) -> "ExternalMemory":
super().set_crew(crew)
if not self.storage:
diff --git a/src/crewai/memory/memory.py b/src/crewai/memory/memory.py
index ba8c10a29..20538a186 100644
--- a/src/crewai/memory/memory.py
+++ b/src/crewai/memory/memory.py
@@ -1,4 +1,4 @@
-from typing import Any, Dict, List, Optional, Self
+from typing import Any, Dict, List, Optional
from pydantic import BaseModel
@@ -38,6 +38,6 @@ class Memory(BaseModel):
query=query, limit=limit, score_threshold=score_threshold
)
- def set_crew(self, crew: Any) -> Self:
+ def set_crew(self, crew: Any) -> "Memory":
self.crew = crew
return self
diff --git a/tests/memory/external/test_external_memory.py b/tests/memory/external/external_memory_test.py
similarity index 100%
rename from tests/memory/external/test_external_memory.py
rename to tests/memory/external/external_memory_test.py