Skip to content

Commit

Permalink
🔧 Change pdm to uv
Browse files Browse the repository at this point in the history
  • Loading branch information
omg-xtao committed Nov 8, 2024
1 parent 79db305 commit b393e59
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 14 deletions.
16 changes: 6 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 main --recursive https://github.com/PaiGramTeam/PaiGram.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
Expand All @@ -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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,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:**
Expand Down
2 changes: 1 addition & 1 deletion plugins/system/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ async def update(self, update: Update, context: CallbackContext):
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:
Expand Down

0 comments on commit b393e59

Please sign in to comment.