/ setup.py
setup.py
1 """Setup script for MetaGPT.""" 2 import subprocess 3 from pathlib import Path 4 5 from setuptools import Command, find_packages, setup 6 7 8 class InstallMermaidCLI(Command): 9 """A custom command to run `npm install -g @mermaid-js/mermaid-cli` via a subprocess.""" 10 11 description = "install mermaid-cli" 12 user_options = [] 13 14 def run(self): 15 try: 16 subprocess.check_call(["npm", "install", "-g", "@mermaid-js/mermaid-cli"]) 17 except subprocess.CalledProcessError as e: 18 print(f"Error occurred: {e.output}") 19 20 21 here = Path(__file__).resolve().parent 22 long_description = (here / "README.md").read_text(encoding="utf-8") 23 requirements = (here / "requirements.txt").read_text(encoding="utf-8").splitlines() 24 25 26 extras_require = { 27 "selenium": ["selenium>4", "webdriver_manager", "beautifulsoup4"], 28 "search-google": ["google-api-python-client==2.94.0"], 29 "search-ddg": ["duckduckgo-search~=4.1.1"], 30 # "ocr": ["paddlepaddle==2.4.2", "paddleocr~=2.7.3", "tabulate==0.9.0"], 31 "rag": [ 32 "llama-index-core==0.10.15", 33 "llama-index-embeddings-azure-openai==0.1.6", 34 "llama-index-embeddings-openai==0.1.5", 35 "llama-index-embeddings-gemini==0.1.6", 36 "llama-index-embeddings-ollama==0.1.2", 37 "llama-index-llms-azure-openai==0.1.4", 38 "llama-index-readers-file==0.1.4", 39 "llama-index-retrievers-bm25==0.1.3", 40 "llama-index-vector-stores-faiss==0.1.1", 41 "llama-index-vector-stores-elasticsearch==0.1.6", 42 "llama-index-vector-stores-chroma==0.1.6", 43 "llama-index-postprocessor-cohere-rerank==0.1.4", 44 "llama-index-postprocessor-colbert-rerank==0.1.1", 45 "llama-index-postprocessor-flag-embedding-reranker==0.1.2", 46 "docx2txt==0.8", 47 ], 48 } 49 50 extras_require["test"] = [ 51 *set(i for j in extras_require.values() for i in j), 52 "pytest", 53 "pytest-asyncio", 54 "pytest-cov", 55 "pytest-mock", 56 "pytest-html", 57 "pytest-xdist", 58 "pytest-timeout", 59 "connexion[uvicorn]~=3.0.5", 60 "azure-cognitiveservices-speech~=1.31.0", 61 "aioboto3~=12.4.0", 62 "gradio==3.0.0", 63 "google-api-core==2.17.1", 64 "protobuf~=4.25.5", 65 "pylint==3.0.3", 66 "pybrowsers", 67 ] 68 69 extras_require["pyppeteer"] = [ 70 "pyppeteer>=1.0.2" 71 ] # pyppeteer is unmaintained and there are conflicts with dependencies 72 extras_require["dev"] = (["pylint~=3.0.3", "black~=23.3.0", "isort~=5.12.0", "pre-commit~=3.6.0"],) 73 extras_require["android_assistant"] = [ 74 "pyshine==0.0.9", 75 "opencv-python==4.6.0.66", 76 "protobuf<3.20,>=3.9.2", 77 "modelscope", 78 "tensorflow==2.9.1; os_name == 'linux'", 79 "tensorflow==2.9.1; os_name == 'win32'", 80 "tensorflow-macos==2.9; os_name == 'darwin'", 81 "keras==2.9.0", 82 "torch", 83 "torchvision", 84 "transformers", 85 "opencv-python", 86 "matplotlib", 87 "pycocotools", 88 "SentencePiece", 89 "tf_slim", 90 "tf_keras", 91 "pyclipper", 92 "shapely", 93 "groundingdino-py", 94 "datasets==2.18.0", 95 "clip-openai", 96 ] 97 98 setup( 99 name="metagpt", 100 version="1.0.0", 101 description="The Multi-Agent Framework", 102 long_description=long_description, 103 long_description_content_type="text/markdown", 104 url="https://github.com/geekan/MetaGPT", 105 author="Alexander Wu", 106 author_email="alexanderwu@deepwisdom.ai", 107 license="MIT", 108 keywords="metagpt multi-agent multi-role programming gpt llm metaprogramming", 109 packages=find_packages(exclude=["contrib", "docs", "examples", "tests*"]), 110 python_requires=">=3.9, <3.12", 111 install_requires=requirements, 112 extras_require=extras_require, 113 cmdclass={ 114 "install_mermaid": InstallMermaidCLI, 115 }, 116 entry_points={ 117 "console_scripts": [ 118 "metagpt=metagpt.software_company:app", 119 ], 120 }, 121 include_package_data=True, 122 )