mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-12 01:28:30 +00:00
Address PR review feedback and fix CI failures
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -1,10 +1,31 @@
|
||||
"""Tests for Python version compatibility."""
|
||||
import pytest
|
||||
import sys
|
||||
|
||||
import pytest
|
||||
from packaging import version
|
||||
|
||||
|
||||
def validate_python_version():
|
||||
"""Validate that the current Python version is supported."""
|
||||
min_version = (3, 10)
|
||||
max_version = (3, 14)
|
||||
current = sys.version_info[:2]
|
||||
|
||||
if not (min_version <= current < max_version):
|
||||
raise RuntimeError(
|
||||
f"This package requires Python {min_version[0]}.{min_version[1]} to "
|
||||
f"{max_version[0]}.{max_version[1]-1}. You have Python {current[0]}.{current[1]}"
|
||||
)
|
||||
|
||||
|
||||
def test_python_version_compatibility():
|
||||
"""Test that the package supports the current Python version."""
|
||||
assert isinstance(sys.version_info, tuple), "Version Information must be a tuple"
|
||||
|
||||
current_version = version.parse(f"{sys.version_info.major}.{sys.version_info.minor}")
|
||||
assert current_version >= version.parse("3.10"), "Python version too old"
|
||||
assert current_version < version.parse("3.14"), "Python version too new"
|
||||
|
||||
# This test will fail if the package doesn't support the current Python version
|
||||
import crewai
|
||||
|
||||
@@ -14,5 +35,5 @@ def test_python_version_compatibility():
|
||||
# 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
|
||||
# Validate Python version
|
||||
validate_python_version()
|
||||
|
||||
Reference in New Issue
Block a user