Skip to content

Build and run agents you can see, understand and trust.

Add uv package manager support in AgentScope (#847)

qbcc7ee6b1b7807
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index 4e2ef6557..b26df494c 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -101,7 +101,7 @@ repos:
--disable=C3001,
]
- repo: https://github.com/regebro/pyroma
- rev: "4.0"
+ rev: "5.0"
hooks:
- id: pyroma
args: [--min=10, .]
diff --git a/README.md b/README.md
index a61a0d3b0..9a696b8f5 100644
--- a/README.md
+++ b/README.md
@@ -128,6 +128,7 @@ Welcome to join our community on
- [🚀 Quickstart](#-quickstart)
- [💻 Installation](#-installation)
- [🛠️ From source](#-from-source)
+ - [🔄 Using uv (recommended for faster installs)](#-using-uv-recommended-for-faster-installs)
- [📦 From PyPi](#-from-pypi)
- [📝 Example](#-example)
- [👋 Hello AgentScope!](#-hello-agentscope)
@@ -159,12 +160,31 @@ cd agentscope
pip install -e .
```
+#### 🔄 Using uv (recommended for faster installs)
+
+[uv](https://github.com/astral-sh/uv) is a fast Python package installer and resolver, written in Rust.
+
+```bash
+# Clone the repository
+git clone -b main https://github.com/agentscope-ai/agentscope.git
+cd agentscope
+
+# Install with uv
+uv pip install -e .
+```
+
#### 📦 From PyPi
```bash
pip install agentscope
```
+Or with uv:
+
+```bash
+uv pip install agentscope
+```
+
## 📝 Example
### 👋 Hello AgentScope!
diff --git a/README_zh.md b/README_zh.md
index 5ac3656b8..cf86a575c 100644
--- a/README_zh.md
+++ b/README_zh.md
@@ -129,6 +129,7 @@ AgentScope v1.0 新功能概览:
- [🚀 快速开始](#-%E5%BF%AB%E9%80%9F%E5%BC%80%E5%A7%8B)
- [💻 安装](#-%E5%AE%89%E8%A3%85)
- [🛠️ 从源码安装](#-%E4%BB%8E%E6%BA%90%E7%A0%81%E5%AE%89%E8%A3%85)
+ - [🔄 使用 uv 安装(推荐,安装更快)](#-%E4%BD%BF%E7%94%A8-uv-%E5%AE%89%E8%A3%85%E6%8E%A8%E8%8D%90%E5%AE%89%E8%A3%85%E6%9B%B4%E5%BF%AB)
- [📦 从PyPi安装](#-%E4%BB%8Epypi%E5%AE%89%E8%A3%85)
- [📝 样例](#-%E6%A0%B7%E4%BE%8B)
- [👋 Hello AgentScope!](#-hello-agentscope)
@@ -160,12 +161,31 @@ cd agentscope
pip install -e .
```
+#### 🔄 使用 uv 安装(推荐,安装更快)
+
+[uv](https://github.com/astral-sh/uv) 是一个用 Rust 编写的快速 Python 包安装程序和解析器。
+
+```bash
+# 克隆仓库
+git clone -b main https://github.com/agentscope-ai/agentscope.git
+cd agentscope
+
+# 使用 uv 安装
+uv pip install -e .
+```
+
#### 📦 从PyPi安装
```bash
pip install agentscope
```
+或者使用 uv:
+
+```bash
+uv pip install agentscope
+```
+
## 📝 样例
### 👋 Hello AgentScope!
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 000000000..6f552fdff
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,85 @@
+
+[project]
+name = "agentscope"
+dynamic = ["version"]
+description = "AgentScope: A Flexible yet Robust Multi-Agent Platform."
+readme = "README.md"
+authors = [
+ { name = "SysML team of Alibaba Tongyi Lab", email = "[email protected]" }
+]
+license = "Apache-2.0"
+keywords = ["deep-learning", "multi agents", "agents"]
+classifiers = [
+ "Development Status :: 4 - Beta",
+ "Programming Language :: Python :: 3",
+ "Programming Language :: Python :: 3.10",
+ "Operating System :: OS Independent",
+ "Intended Audience :: Developers",
+ "Intended Audience :: Science/Research",
+ "Topic :: Scientific/Engineering :: Artificial Intelligence",
+]
+requires-python = ">=3.10"
+dependencies = [
+ "aioitertools",
+ "anthropic",
+ "dashscope",
+ "docstring_parser",
+ "json5",
+ "json_repair",
+ "mcp>=1.13",
+ "numpy",
+ "openai",
+ "python-datauri",
+ "opentelemetry-api",
+ "opentelemetry-sdk",
+ "opentelemetry-exporter-otlp",
+ "python-socketio",
+ "shortuuid",
+ "tiktoken",
+ "sounddevice",
+]
+
+[project.optional-dependencies]
+full = [
+ # Model
+ "ollama",
+ "google-genai",
+ "Pillow",
+ "transformers",
+ "jinja2",
+ # Evaluator
+ "ray",
+ # Long-term memory
+ "mem0ai",
+ "packaging",
+ # RAG
+ "pypdf",
+ "nltk",
+ "qdrant-client",
+]
+dev = [
+ # Include full dependencies from local package
+ "agentscope[full]",
+ # Development tools
+ "pre-commit",
+ "pytest",
+ "sphinx-gallery",
+ "furo",
+ "myst_parser",
+ "matplotlib",
+]
+
+[project.urls]
+Homepage = "https://github.com/agentscope-ai/agentscope"
+Documentation = "https://doc.agentscope.io/"
+Repository = "https://github.com/agentscope-ai/agentscope"
+
+[tool.setuptools]
+packages = { find = { where = ["src"] } }
+
+[build-system]
+requires = ["setuptools>=45", "wheel"]
+build-backend = "setuptools.build_meta"
+
+[tool.setuptools.dynamic]
+version = {attr = "agentscope._version.__version__"}
diff --git a/setup.py b/setup.py
deleted file mode 100644
index fd76e31bf..000000000
--- a/setup.py
+++ /dev/null
@@ -1,94 +0,0 @@
-# -*- coding: utf-8 -*-
-"""Setup script for AgentScope."""
-import re
-import setuptools
-
-# obtain version from src/agentscope/_version.py
-with open("src/agentscope/_version.py", encoding="UTF-8") as f:
- VERSION = re.search(
- r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
- f.read(),
- re.MULTILINE,
- ).group(1)
-
-NAME = "agentscope"
-URL = "https://github.com/agentscope-ai/agentscope"
-
-minimal_requires = [
- "aioitertools",
- "anthropic",
- "dashscope",
- "docstring_parser",
- "json5",
- "json_repair",
- "mcp>=1.13",
- "numpy",
- "openai",
- "python-datauri",
- "opentelemetry-api",
- "opentelemetry-sdk",
- "opentelemetry-exporter-otlp",
- "python-socketio",
- "shortuuid",
- "tiktoken",
- "sounddevice",
-]
-
-extra_requires = [
- # Model
- "ollama",
- "google-genai",
- "Pillow",
- "transformers",
- "jinja2",
- # Evaluator
- "ray",
- # Long-term memory
- "mem0ai",
- "packaging",
- # RAG
- "pypdf",
- "nltk",
- "qdrant-client",
-]
-
-dev_requires = [
- "pre-commit",
- "pytest",
- "sphinx-gallery",
- "furo",
- "myst_parser",
- "matplotlib",
-]
-
-with open("README.md", "r", encoding="UTF-8") as fh:
- long_description = fh.read()
-
-setuptools.setup(
- name=NAME,
- version=VERSION,
- author="SysML team of Alibaba Tongyi Lab ",
- author_email="[email protected]",
- description="AgentScope: A Flexible yet Robust Multi-Agent Platform.",
- long_description=long_description,
- long_description_content_type="text/markdown",
- url=URL,
- download_url=f"{URL}/archive/v{VERSION}.tar.gz",
- keywords=["deep-learning", "multi agents", "agents"],
- package_dir={"": "src"},
- packages=setuptools.find_packages("src"),
- install_requires=minimal_requires,
- extras_require={
- "full": minimal_requires + extra_requires,
- "dev": minimal_requires + extra_requires + dev_requires,
- },
- license="Apache-2.0",
- classifiers=[
- "Development Status :: 4 - Beta",
- "Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.10",
- "Operating System :: OS Independent",
- ],
- python_requires=">=3.10",
- entry_points={},
-)