mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-19 21:08:13 +00:00
Add conda package support (closes #2673)
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
0
tests/conda/__init__.py
Normal file
0
tests/conda/__init__.py
Normal file
45
tests/conda/test_conda_compatibility.py
Normal file
45
tests/conda/test_conda_compatibility.py
Normal file
@@ -0,0 +1,45 @@
|
||||
"""Tests for conda compatibility."""
|
||||
import sys
|
||||
import unittest
|
||||
|
||||
|
||||
class TestCondaCompatibility(unittest.TestCase):
|
||||
"""Test conda compatibility."""
|
||||
|
||||
def test_python_version_compatibility(self):
|
||||
"""Test Python version compatibility."""
|
||||
version = sys.version_info
|
||||
self.assertGreaterEqual(version.major, 3)
|
||||
self.assertGreaterEqual(version.minor, 10)
|
||||
self.assertLess(version.minor, 13)
|
||||
|
||||
def test_typing_self_import(self):
|
||||
"""Test that Self can be imported from typing."""
|
||||
try:
|
||||
from typing import Self
|
||||
self.assertTrue(True)
|
||||
except ImportError:
|
||||
if sys.version_info.minor == 10:
|
||||
# In Python 3.10, Self might not be available directly from typing
|
||||
try:
|
||||
from typing_extensions import Self
|
||||
self.assertTrue(True)
|
||||
except ImportError:
|
||||
self.fail("Self not available from typing or typing_extensions in Python 3.10")
|
||||
else:
|
||||
self.fail("Self not available from typing")
|
||||
|
||||
def test_tokenizers_import(self):
|
||||
"""Test tokenizers import if it's installed."""
|
||||
try:
|
||||
import tokenizers
|
||||
# Only test if tokenizers is installed
|
||||
if sys.version_info.minor == 12:
|
||||
self.assertTrue(True, "tokenizers successfully imported in Python 3.12")
|
||||
except ImportError:
|
||||
# Skip test if tokenizers is not installed
|
||||
self.skipTest("tokenizers package not installed")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in New Issue
Block a user