mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-10 08:38:30 +00:00
ci: Add Python 3.10, 3.11 to test matrix
feat: Add basic import compatibility test Adds Python 3.10 and 3.11 to the GitHub Actions test matrix to ensure compatibility across the supported Python range (>=3.10, <3.13). Also adds a simple test_compatibility.py to catch basic import errors early, preventing regressions like the one reported in #2575 where caused issues on Python 3.10. Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
8
.github/workflows/tests.yml
vendored
8
.github/workflows/tests.yml
vendored
@@ -11,6 +11,10 @@ env:
|
|||||||
jobs:
|
jobs:
|
||||||
tests:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
python-version: ["3.10", "3.11", "3.12"]
|
||||||
|
fail-fast: false # Allow all matrix jobs to finish even if one fails
|
||||||
timeout-minutes: 15
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
@@ -22,8 +26,8 @@ jobs:
|
|||||||
enable-cache: true
|
enable-cache: true
|
||||||
|
|
||||||
|
|
||||||
- name: Set up Python
|
- name: Set up Python ${{ matrix.python-version }}
|
||||||
run: uv python install 3.12.8
|
run: uv python install ${{ matrix.python-version }}
|
||||||
|
|
||||||
- name: Install the project
|
- name: Install the project
|
||||||
run: uv sync --dev --all-extras
|
run: uv sync --dev --all-extras
|
||||||
|
|||||||
14
tests/test_compatibility.py
Normal file
14
tests/test_compatibility.py
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
import pytest
|
||||||
|
|
||||||
|
def test_basic_import():
|
||||||
|
"""
|
||||||
|
Tests that the crewai package can be imported without raising exceptions.
|
||||||
|
This helps catch basic installation and dependency issues, including import
|
||||||
|
errors related to Python version compatibility.
|
||||||
|
"""
|
||||||
|
try:
|
||||||
|
import crewai
|
||||||
|
except ImportError as e:
|
||||||
|
pytest.fail(f"Failed to import crewai package: {e}")
|
||||||
|
except Exception as e:
|
||||||
|
pytest.fail(f"An unexpected error occurred during crewai import: {e}")
|
||||||
Reference in New Issue
Block a user