Fix Python 3.13 compatibility (issue #2794)

- Update Python version constraint from '>=3.10,<3.13' to '>=3.10,<3.14' in all relevant files
- Add test to verify Python version compatibility
- Update GitHub Actions workflow to include Python 3.13 testing
- Add Docker test to verify installation on Python 3.13

Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
Devin AI
2025-05-09 02:17:48 +00:00
parent cb1a98cabf
commit 5bc01b15a0
9 changed files with 40 additions and 8 deletions

View File

@@ -14,7 +14,7 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
python-version: ['3.10', '3.11', '3.12', '3.13']
steps:
- name: Checkout code
uses: actions/checkout@v4

14
Dockerfile.test Normal file
View File

@@ -0,0 +1,14 @@
FROM python:3.13-slim-bookworm
WORKDIR /app
RUN pip install --upgrade pip
# Copy the current directory contents into the container
COPY . /app/
# Install the package
RUN pip install -e .
# Test importing the package
CMD ["python", "-c", "import crewai; print(f'Successfully imported crewai version {crewai.__version__}')"]

View File

@@ -3,7 +3,7 @@ name = "crewai"
version = "0.119.0"
description = "Cutting-edge framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks."
readme = "README.md"
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10,<3.14"
authors = [
{ name = "Joao Moura", email = "joao@crewai.com" }
]

View File

@@ -3,7 +3,7 @@ name = "{{folder_name}}"
version = "0.1.0"
description = "{{name}} using crewAI"
authors = [{ name = "Your Name", email = "you@example.com" }]
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10,<3.14"
dependencies = [
"crewai[tools]>=0.119.0,<1.0.0"
]

View File

@@ -3,7 +3,7 @@ name = "{{folder_name}}"
version = "0.1.0"
description = "{{name}} using crewAI"
authors = [{ name = "Your Name", email = "you@example.com" }]
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10,<3.14"
dependencies = [
"crewai[tools]>=0.119.0,<1.0.0",
]

View File

@@ -3,7 +3,7 @@ name = "{{folder_name}}"
version = "0.1.0"
description = "Power up your crews with {{folder_name}}"
readme = "README.md"
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10,<3.14"
dependencies = [
"crewai[tools]>=0.119.0"
]

View File

@@ -231,7 +231,7 @@ class TestDeployCommand(unittest.TestCase):
[project]
name = "test_project"
version = "0.1.0"
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10,<3.14"
dependencies = ["crewai"]
""",
)
@@ -250,7 +250,7 @@ class TestDeployCommand(unittest.TestCase):
[project]
name = "test_project"
version = "0.1.0"
requires-python = ">=3.10,<3.13"
requires-python = ">=3.10,<3.14"
dependencies = ["crewai"]
""",
)

View File

@@ -0,0 +1,18 @@
"""Tests for Python version compatibility."""
import sys
import pytest
def test_python_version_compatibility():
"""Test that the package supports the current Python version."""
# This test will fail if the package doesn't support the current Python version
import crewai
# Print the Python version for debugging
print(f"Python version: {sys.version}")
# Print the crewai version for debugging
print(f"CrewAI version: {crewai.__version__}")
# If we got here, the import worked, which means the package supports this Python version
assert True

2
uv.lock generated
View File

@@ -1,5 +1,5 @@
version = 1
requires-python = ">=3.10, <3.13"
requires-python = ">=3.10, <3.14"
resolution-markers = [
"python_full_version < '3.11' and platform_python_implementation == 'PyPy' and platform_system == 'Darwin' and sys_platform == 'darwin'",
"python_full_version < '3.11' and platform_machine == 'aarch64' and platform_python_implementation == 'PyPy' and platform_system == 'Linux' and sys_platform == 'darwin'",