Skip to content

Commit afc782b

Browse files
wangjuntaowangjuntao
authored andcommitted
迁移项目管理器从Poetry到uv
- 重构 pyproject.toml:使用标准PEP 621格式替代Poetry格式 - 添加 uv.lock:新的依赖锁定文件,提供更快的依赖解析 - 删除 poetry.lock:移除Poetry锁定文件 - 更新文档:README.md、AGENT.md、copilot-instructions.md中的所有Poetry命令替换为uv命令 - 配置hatchling构建后端,支持services包的正确打包 优势: - 10-100倍更快的依赖安装速度 - 标准化项目配置格式 - 更好的Python版本管理 - 简化的工具链
1 parent ef7f9fc commit afc782b

6 files changed

Lines changed: 2289 additions & 2196 deletions

File tree

.github/copilot-instructions.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,11 @@ def initialize_service():
8686
## 开发工作流
8787

8888
### 依赖管理
89-
使用 **Poetry** 进行依赖管理:
90-
- `poetry install` - 安装依赖
91-
- `poetry start` - HTTP服务器模式(生产环境)
92-
- `poetry stdio` - stdio模式(MCP客户端集成)
93-
- `poetry run python main.py` - 直接执行
89+
使用 **uv** 进行依赖管理:
90+
- `uv sync` - 安装依赖
91+
- `uv run start` - HTTP服务器模式(生产环境)
92+
- `uv run stdio` - stdio模式(MCP客户端集成)
93+
- `uv run python main.py` - 直接执行
9494

9595
### 服务器模式
9696
1. **HTTP模式**: `start_server()` → 运行在 `127.0.0.1:8080`

AGENT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ echo '{"private_key": "0x...", "testnet": true}' > config.json
2626
2. **启动服务器**
2727
```bash
2828
# HTTP模式(推荐)
29-
poetry start
29+
uv run start
3030

3131
# Stdio模式(MCP客户端)
32-
poetry stdio
32+
uv run stdio
3333
```
3434

3535
## 核心工具使用指南

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -38,21 +38,21 @@ A comprehensive Model Context Protocol (MCP) server for HyperLiquid trading usin
3838
### Prerequisites
3939

4040
- Python 3.11 or higher (project uses Python 3.13)
41-
- [Poetry](https://python-poetry.org/) package manager
41+
- [uv](https://docs.astral.sh/uv/) package manager
4242

4343
### Setup
4444

45-
1. **Install Poetry (if not already installed):**
45+
1. **Install uv (if not already installed):**
4646

4747
```bash
4848
# On macOS and Linux:
49-
curl -sSL https://install.python-poetry.org | python3 -
49+
curl -LsSf https://astral.sh/uv/install.sh | sh
5050

5151
# On Windows:
52-
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py -
52+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
5353

5454
# Or with pip:
55-
pip install poetry
55+
pip install uv
5656
```
5757

5858
2. **Clone the repository:**
@@ -62,14 +62,14 @@ A comprehensive Model Context Protocol (MCP) server for HyperLiquid trading usin
6262
cd hyperliquid-mcp-python
6363
```
6464

65-
3. **Install dependencies with Poetry:**
65+
3. **Install dependencies with uv:**
6666

6767
```bash
6868
# Install dependencies and create virtual environment
69-
poetry install
69+
uv sync
7070

7171
# Or install without development dependencies
72-
poetry install --without dev
72+
uv sync --no-dev
7373
```
7474

7575
This will install all dependencies defined in `pyproject.toml`:
@@ -132,24 +132,26 @@ The server can be started in two modes:
132132

133133
```bash
134134
# Start HTTP server on http://127.0.0.1:8080
135-
poetry start
135+
uv run start
136136
```
137137

138138
#### Stdio Mode (For MCP Client Integration)
139139

140140
```bash
141141
# Start stdio server for MCP client connections
142-
poetry stdio
142+
uv run stdio
143143
```
144144

145145
#### Alternative: Manual Startup
146146

147147
```bash
148-
# Using Poetry (manual method)
149-
poetry run python main.py
148+
# Using uv (manual method)
149+
uv run python main.py
150150

151151
# Or activate the virtual environment first
152-
poetry shell
152+
source .venv/bin/activate # On Unix/macOS
153+
# or
154+
.venv\Scripts\activate # On Windows
153155
python main.py
154156
```
155157

0 commit comments

Comments
 (0)