diff --git a/conda/README.md b/conda/README.md new file mode 100644 index 000000000..8d192ed0d --- /dev/null +++ b/conda/README.md @@ -0,0 +1,47 @@ +# Conda Package for CrewAI + +This directory contains the necessary files to build a conda package for CrewAI. + +## Files + +- `meta.yaml`: The main conda recipe file that defines package metadata, dependencies, and build requirements +- `build.sh`: Build script for Unix-like systems (Linux, macOS) +- `bld.bat`: Build script for Windows + +## Building the Package + +To build the package, you need to have conda-build installed: + +```bash +conda install conda-build +``` + +Then, from the repository root directory: + +```bash +conda build conda +``` + +## Testing the Package + +After building, you can install and test the package: + +```bash +conda install --use-local crewai +``` + +## Uploading to Anaconda + +To upload the package to Anaconda, you need to have anaconda-client installed: + +```bash +conda install anaconda-client +anaconda login +anaconda upload /path/to/conda-bld/noarch/crewai-*.tar.bz2 +``` + +## Compatibility Notes + +This package addresses compatibility issues with: +- Python 3.10: Adds typing_extensions as a dependency to provide the Self type +- Python 3.12: Ensures compatibility with the tokenizers package diff --git a/conda/bld.bat b/conda/bld.bat new file mode 100644 index 000000000..1f9753fdf --- /dev/null +++ b/conda/bld.bat @@ -0,0 +1,2 @@ +"%PYTHON%" -m pip install . --no-deps -vv +if errorlevel 1 exit 1 diff --git a/conda/build.sh b/conda/build.sh new file mode 100755 index 000000000..15eee861e --- /dev/null +++ b/conda/build.sh @@ -0,0 +1,3 @@ +#!/bin/bash + +$PYTHON -m pip install . --no-deps -vv diff --git a/conda/meta.yaml b/conda/meta.yaml new file mode 100644 index 000000000..a3cf4a896 --- /dev/null +++ b/conda/meta.yaml @@ -0,0 +1,66 @@ +{% set name = "crewai" %} +{% set version = "0.86.0" %} + +package: + name: {{ name|lower }} + version: {{ version }} + +source: + path: .. + +build: + noarch: python + number: 0 + script: {{ PYTHON }} -m pip install . -vv + entry_points: + - crewai = crewai.cli.cli:crewai + +requirements: + host: + - python >=3.10,<3.13 + - pip + - hatchling + run: + - python >=3.10,<3.13 + - pydantic >=2.4.2 + - openai >=1.13.3 + - opentelemetry-api >=1.22.0 + - opentelemetry-sdk >=1.22.0 + - opentelemetry-exporter-otlp-proto-http >=1.22.0 + - instructor >=1.3.3 + - regex >=2024.9.11 + - click >=8.1.7 + - python-dotenv >=1.0.0 + - appdirs >=1.4.4 + - jsonref >=1.1.0 + - json-repair >=0.25.2 + - auth0-python >=4.7.1 + - litellm >=1.44.22 + - pyvis >=0.3.2 + - uv >=0.4.25 + - tomli-w >=1.1.0 + - tomli >=2.0.2 + - chromadb >=0.5.23 + - pdfplumber >=0.11.4 + - openpyxl >=3.1.5 + - blinker >=1.9.0 + +test: + imports: + - crewai + commands: + - pip check + - crewai --help + +about: + home: https://crewai.com + doc_url: https://docs.crewai.com + dev_url: https://github.com/crewAIInc/crewAI + summary: Cutting-edge framework for orchestrating role-playing, autonomous AI agents + license: MIT + +extra: + recipe-maintainers: + - joaomoura + # For Python 3.10 compatibility (Self type) + - typing_extensions >=4.0.0 diff --git a/tests/conda/__init__.py b/tests/conda/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/conda/test_conda_compatibility.py b/tests/conda/test_conda_compatibility.py new file mode 100644 index 000000000..3680c3397 --- /dev/null +++ b/tests/conda/test_conda_compatibility.py @@ -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()