migrate the bot to uv
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
33bb8c2dc6
commit
51cc7e7cf8
7 files changed
+1145
-15
No files matched your search
@@ -0,0 +1,2 @@
|
||||
.venv
|
||||
__pycache__
|
||||
@@ -0,0 +1 @@
|
||||
3.14
|
||||
+9
-3
@@ -1,15 +1,21 @@
|
||||
FROM python:3.14
|
||||
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.13.5 /uv /uvx /bin/
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
RUN apt-get update && apt-get install -y pandoc
|
||||
|
||||
RUN python3 -m pip install --no-cache-dir -r requirements.txt
|
||||
ENV UV_COMPILE_BYTECODE=1 UV_NO_CACHE=1 UV_PYTHON_DOWNLOADS=never
|
||||
|
||||
COPY pyproject.toml uv.lock ./
|
||||
|
||||
RUN uv sync --locked --no-dev
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
VOLUME logs
|
||||
|
||||
CMD ["python3", "src/run.py"]
|
||||
+3
-3
@@ -22,16 +22,16 @@ docker compose up
|
||||
|
||||
### Option 2 - Manual
|
||||
|
||||
0. Install Python 3.12+
|
||||
0. Install [uv](https://docs.astral.sh/uv/getting-started/installation/). It installs the right Python version for you
|
||||
|
||||
1. Install dependencies
|
||||
|
||||
```
|
||||
pip install -r requirements.txt -U
|
||||
uv sync
|
||||
```
|
||||
|
||||
2. Run bot
|
||||
|
||||
```
|
||||
python src/run.py
|
||||
uv run src/run.py
|
||||
```
|
||||
@@ -0,0 +1,17 @@
|
||||
[project]
|
||||
name = "hmgrisen-bot"
|
||||
version = "0.1.0"
|
||||
description = "A multi-purpose Discord bot for the Discord server of The Norwegian Student Society"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"aiohttp==3.14.*",
|
||||
"asyncpg==0.32.*",
|
||||
"discord.py==2.7.*",
|
||||
"psutil==7.2.*",
|
||||
"pydantic==2.14.*",
|
||||
"pypandoc==1.17.*",
|
||||
"python-dotenv==1.2.*",
|
||||
"regex==2026.9.29",
|
||||
"tzdata", # This only needed if run on windows. I haven't set a version either to ensure it's up to date.
|
||||
]
|
||||
@@ -1,9 +0,0 @@
|
||||
aiohttp==3.14.*
|
||||
asyncpg==0.32.*
|
||||
discord.py==2.7.*
|
||||
psutil==7.2.*
|
||||
pydantic==2.14.*
|
||||
pypandoc==1.17.*
|
||||
python-dotenv==1.2.*
|
||||
regex==2026.9.29
|
||||
tzdata # This only needed if run on windows. I haven't set a version either to ensure it's up to date.
|
||||
Generated
+1113
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user