mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-01-11 00:58:30 +00:00
Add conda package support (closes #2673)
Co-Authored-By: Joe Moura <joao@crewai.com>
This commit is contained in:
47
conda/README.md
Normal file
47
conda/README.md
Normal file
@@ -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
|
||||||
2
conda/bld.bat
Normal file
2
conda/bld.bat
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
"%PYTHON%" -m pip install . --no-deps -vv
|
||||||
|
if errorlevel 1 exit 1
|
||||||
3
conda/build.sh
Executable file
3
conda/build.sh
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
$PYTHON -m pip install . --no-deps -vv
|
||||||
66
conda/meta.yaml
Normal file
66
conda/meta.yaml
Normal file
@@ -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
|
||||||
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