mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
Fix OpenTelemetry version conflict with OpenLit (Fixes #2623)
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
@@ -17,9 +17,9 @@ dependencies = [
|
|||||||
"pdfplumber>=0.11.4",
|
"pdfplumber>=0.11.4",
|
||||||
"regex>=2024.9.11",
|
"regex>=2024.9.11",
|
||||||
# Telemetry and Monitoring
|
# Telemetry and Monitoring
|
||||||
"opentelemetry-api>=1.30.0",
|
"opentelemetry-api==1.32.1",
|
||||||
"opentelemetry-sdk>=1.30.0",
|
"opentelemetry-sdk==1.32.1",
|
||||||
"opentelemetry-exporter-otlp-proto-http>=1.30.0",
|
"opentelemetry-exporter-otlp-proto-http==1.32.1",
|
||||||
# Data Handling
|
# Data Handling
|
||||||
"chromadb>=0.5.23",
|
"chromadb>=0.5.23",
|
||||||
"openpyxl>=3.1.5",
|
"openpyxl>=3.1.5",
|
||||||
|
|||||||
28
tests/utilities/test_openlit_compatibility.py
Normal file
28
tests/utilities/test_openlit_compatibility.py
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
import sys
|
||||||
|
import pytest
|
||||||
|
from unittest.mock import patch, MagicMock
|
||||||
|
|
||||||
|
def test_openlit_compatibility():
|
||||||
|
"""Test that OpenLit can be imported and initialized with CrewAI."""
|
||||||
|
try:
|
||||||
|
import openlit
|
||||||
|
except ImportError:
|
||||||
|
pytest.skip("OpenLit not installed, skipping compatibility test")
|
||||||
|
|
||||||
|
with patch.object(openlit, 'init', return_value=None) as mock_init:
|
||||||
|
openlit.init(disable_metrics=True)
|
||||||
|
mock_init.assert_called_once_with(disable_metrics=True)
|
||||||
|
|
||||||
|
assert True
|
||||||
|
|
||||||
|
def test_opentelemetry_version_compatibility():
|
||||||
|
"""Test that the OpenTelemetry version is compatible with OpenLit."""
|
||||||
|
pytest.importorskip("openlit")
|
||||||
|
|
||||||
|
import pkg_resources
|
||||||
|
|
||||||
|
otel_api_version = pkg_resources.get_distribution("opentelemetry-api").version
|
||||||
|
otel_sdk_version = pkg_resources.get_distribution("opentelemetry-sdk").version
|
||||||
|
|
||||||
|
assert otel_api_version == "1.32.1", f"Expected opentelemetry-api==1.32.1, got {otel_api_version}"
|
||||||
|
assert otel_sdk_version == "1.32.1", f"Expected opentelemetry-sdk==1.32.1, got {otel_sdk_version}"
|
||||||
Reference in New Issue
Block a user