🔧 Change pdm to uv

This commit is contained in:
xtaodada 2024-11-08 23:56:22 +08:00
parent b0ed1f9550
commit 46aa8461db
Signed by: xtaodada
GPG Key ID: 4CBB3F4FA8C85659
3 changed files with 12 additions and 16 deletions

View File

@ -10,13 +10,10 @@ RUN echo "deb http://ftp.us.debian.org/debian bookworm main non-free" >> /etc/ap
&& apt install git wget curl ffmpeg -y \
&& git clone -b zzz --recursive https://github.com/PaiGramTeam/MibooGram.git /app \
# install dependencies \
&& pip install virtualenv pdm \
&& python3 -m virtualenv venv/ \
&& . venv/bin/activate \
&& pdm use -f venv \
&& pdm config pypi.url https://pypi.tuna.tsinghua.edu.cn/simple/ \
&& pdm install \
&& pdm install -G :all \
&& pip install virtualenv uv \
&& python3 -m uv venv .venv \
&& . .venv/bin/activate \
&& uv sync --all-extras \
&& playwright install chromium \
&& playwright install-deps chromium \
## set timezone
@ -31,9 +28,8 @@ RUN echo "deb http://ftp.us.debian.org/debian bookworm main non-free" >> /etc/ap
/var/lib/apt/lists/* \
/var/tmp/* \
~/.cache/pip \
~/.cache/pypoetry \
~/.cache/pdm \
~/.cache/uv \
# Add the wait script to the image
&& wget -O /wait https://github.com/ufoscout/docker-compose-wait/releases/download/2.12.1/wait \
&& chmod +x /wait
ENTRYPOINT /wait && venv/bin/alembic upgrade head && venv/bin/python run.py
ENTRYPOINT /wait && .venv/bin/alembic upgrade head && .venv/bin/python run.py

View File

@ -36,8 +36,9 @@ For contributors using WSL2 on Ubuntu 22.04, follow the [detailed guide here](/d
#### 1. Clone PaiGram from Git
```bash
git clone git@github.com:PaiGramTeam/PaiGram.git --recurse-submodules
git clone git@github.com:PaiGramTeam/PaiGram.git
cd PaiGram/
git submodule update --init --recursive
```
#### 2. Project Setup
@ -73,15 +74,15 @@ venv\Scripts\activate.bat
**Install Dependencies:**
```bash
pip install pdm
pdm install
pip install uv
uv sync
playwright install chromium
```
Optional Dependencies
```bash
pdm install -G :all
uv sync --all-extras
```
**Edit Config:**

View File

@ -1,6 +1,5 @@
import asyncio
import os
from sys import executable
from aiofiles import open as async_open
from telegram import Message, Update
@ -59,7 +58,7 @@ class UpdatePlugin(Plugin):
await execute("git pull --all")
await execute("git submodule update")
if len(args) > 1:
await execute(f"{executable} -m pdm install")
await execute("uv sync --all-extras")
logger.info("更新成功 正在重启")
await reply_text.edit_text("更新成功 正在重启")
async with async_open(UPDATE_DATA, mode="w", encoding="utf-8") as file: