File tree Expand file tree Collapse file tree 9 files changed +16
-33
lines changed
Expand file tree Collapse file tree 9 files changed +16
-33
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,12 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /usr/local/bin/
77WORKDIR /app
88
99# 先只拷贝依赖声明文件,利用 Docker 层缓存
10- COPY pyproject.toml requirements.txt ./
10+ COPY pyproject.toml ./
1111
1212# 使用 uv 安装生产依赖到 /app/.venv,离线不污染系统 Python
1313RUN uv venv .venv && \
1414 uv pip install --python .venv/bin/python \
15- -r requirements.txt \
15+ . \
1616 --index-url https://pypi.tuna.tsinghua.edu.cn/simple
1717
1818# ── 运行阶段:精简镜像 ────────────────────────────────────────────────────────
Original file line number Diff line number Diff line change @@ -4,9 +4,9 @@ RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple
44
55WORKDIR /DicePP
66
7- COPY ./requirements.txt /DicePP/requirements.txt
7+ COPY ./pyproject.toml /DicePP/pyproject.toml
88
9- RUN pip install --no-cache-dir --upgrade -r /DicePP/requirements.txt
9+ RUN pip install --no-cache-dir --upgrade .
1010
1111COPY ./ /DicePP
1212
Original file line number Diff line number Diff line change 88# ── 环境安装 ─────────────────────────────────────────────────────────────────
99install :
1010 uv venv .venv
11- uv pip install -r requirements.txt --index-url https://pypi.tuna.tsinghua.edu.cn/simple
11+ uv pip install . --index-url https://pypi.tuna.tsinghua.edu.cn/simple
1212
13- install-dev : install
13+ install-dev :
14+ uv venv .venv
1415 uv pip install " .[dev]" --index-url https://pypi.tuna.tsinghua.edu.cn/simple
1516
1617# ── 测试 ─────────────────────────────────────────────────────────────────────
Original file line number Diff line number Diff line change 1919
2020## 安装
2121
22- ### 使用 pip
22+ ### 使用 uv(推荐)
2323
2424``` bash
2525# 克隆项目
2626git clone https://github.com/your-repo/nonebot-dicepp.git
2727cd nonebot-dicepp
2828
2929# 安装依赖
30- pip install -r requirements.txt
30+ uv venv .venv
31+ uv pip install .
3132```
3233
33- ### 使用 uv(推荐)
34+ ### 使用 pip
3435
3536``` bash
3637# 克隆项目
3738git clone https://github.com/your-repo/nonebot-dicepp.git
3839cd nonebot-dicepp
3940
4041# 安装依赖
41- uv sync
42+ pip install .
4243```
4344
4445## 配置
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ cd /d "%PROJECT_DIR%"
1010echo ===== 安装 DicePP 依赖 =====
1111echo .
1212
13- pip install -r requirements.txt
13+ pip install .
1414
1515echo .
1616echo ===== 依赖安装完成 =====
Original file line number Diff line number Diff line change 1212echo 使用 nb-cli 启动机器人...
1313echo .
1414
15- call pip install -r requirements.txt
15+ call pip install .
1616
1717nb run
1818
Original file line number Diff line number Diff line change @@ -7,8 +7,7 @@ echo [1/2] 创建虚拟环境 .venv ...
77uv venv .venv
88
99echo [2/2] 安装依赖(使用清华镜像)...
10- uv pip install -r requirements.txt --index-url https://pypi.tuna.tsinghua.edu.cn/simple
11- uv pip install pytest pytest-asyncio pytest-cov --index-url https://pypi.tuna.tsinghua.edu.cn/simple
10+ uv pip install " .[dev]" --index-url https://pypi.tuna.tsinghua.edu.cn/simple
1211
1312echo .
1413echo [OK] 安装完成!
Original file line number Diff line number Diff line change @@ -256,8 +256,7 @@ nonebot-dicepp/
256256├── bot.py # 主入口
257257├── Dockerfile # 多阶段构建(uv 安装依赖,精简运行镜像)
258258├── docker-compose.yml # 容器编排
259- ├── pyproject.toml # 统一依赖声明(uv / pip / poetry 兼容)
260- ├── requirements.txt # 备用依赖列表
259+ ├── pyproject.toml # 统一依赖声明(uv / pip 兼容)
261260├── Makefile # Linux/Mac 快捷命令
262261├── .env # 环境变量(不提交 Git)
263262├── src/plugins/DicePP/
You can’t perform that action at this time.
0 commit comments