mirror of
https://github.com/UiO-Gaming/mustafa.git
synced 2026-11-05 13:56:48 +01:00
migrate to uv
This commit is contained in:
1 parent
53c7e92304
commit
4ccf15d355
10 files changed
+2134
-28
No files matched your search
@@ -0,0 +1,5 @@
|
||||
.git
|
||||
.venv/
|
||||
logs/
|
||||
__pycache__/
|
||||
*.pyc
|
||||
@@ -5,6 +5,7 @@ __pycache__/
|
||||
.vscode/
|
||||
.idea/
|
||||
venv/
|
||||
.venv/
|
||||
.env/
|
||||
lib64
|
||||
pyvenv.cfg
|
||||
|
||||
@@ -4,7 +4,6 @@ repos:
|
||||
hooks:
|
||||
- id: end-of-file-fixer
|
||||
- id: trailing-whitespace
|
||||
- id: requirements-txt-fixer
|
||||
- id: end-of-file-fixer
|
||||
|
||||
- repo: https://github.com/psf/black
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
3.14
|
||||
+1
-1
@@ -76,7 +76,7 @@ Generelt sett unngår vi bruk av leading underscores for variabelnavn og metoder
|
||||
|
||||
### Avhengigheter
|
||||
|
||||
Hvis en ny avhengighet trengs, sørg for å spesifisere major og minor versjon i requirementsfila.
|
||||
Hvis en ny avhengighet trengs, legg den til med `uv add "pakke==X.Y.*"` slik at major og minor versjon er spesifisert.
|
||||
|
||||
## Ønsket utforming av ny funksjonalitet
|
||||
|
||||
|
||||
+10
-4
@@ -1,15 +1,21 @@
|
||||
FROM python:3.14
|
||||
|
||||
COPY --from=ghcr.io/astral-sh/uv:0.13.5 /uv /uvx /bin/
|
||||
|
||||
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=never
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
RUN python3 -m pip install --no-cache-dir -r requirements.txt
|
||||
|
||||
RUN apt-get update && apt-get install -y ffmpeg graphviz pandoc
|
||||
|
||||
COPY pyproject.toml uv.lock .python-version ./
|
||||
|
||||
RUN uv sync --locked --no-dev --no-cache
|
||||
|
||||
COPY . .
|
||||
|
||||
ENV PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
VOLUME logs
|
||||
|
||||
CMD ["python3", "src/run.py"]
|
||||
@@ -26,18 +26,18 @@ docker compose up
|
||||
|
||||
Du bør ha gjort følgende:
|
||||
|
||||
- Installert Python 3.12+
|
||||
- Installert [uv](https://docs.astral.sh/uv/)
|
||||
|
||||
1. Installer avhengigheter
|
||||
|
||||
```
|
||||
pip install -r requirements.txt -U
|
||||
uv sync
|
||||
```
|
||||
|
||||
2. Kjør bot
|
||||
|
||||
```
|
||||
python src/run.py
|
||||
uv run src/run.py
|
||||
```
|
||||
|
||||
## Bidra
|
||||
|
||||
@@ -1,3 +1,36 @@
|
||||
[project]
|
||||
name = "mustafa"
|
||||
version = "0.1.0"
|
||||
description = "UiO Gaming Discord Bot"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.12"
|
||||
dependencies = [
|
||||
"dateparser==1.4.*",
|
||||
"discord.py==2.7.*",
|
||||
"graphviz==0.21.*",
|
||||
"Japanera==2.1.*",
|
||||
"mcrcon==0.7.*",
|
||||
"moviepy==2.2.*",
|
||||
"nltk==3.10.*",
|
||||
"numpy==2.5.*",
|
||||
"opencv-python==5.0.*",
|
||||
"pillow>=9.2,<12.0",
|
||||
"psutil==7.2.*",
|
||||
"psycopg2-binary==2.9.*",
|
||||
"pypandoc==1.17.*",
|
||||
"pyyaml==6.0.*",
|
||||
"regex==2026.9.29",
|
||||
"requests==2.34.*",
|
||||
"tzdata", # This only needed if run on windows. I haven't set a version either to ensure it's up to date.
|
||||
"wordcloud==1.9.*",
|
||||
"yt-dlp==2026.10.21",
|
||||
]
|
||||
|
||||
[dependency-groups]
|
||||
dev = [
|
||||
"pre-commit==4.7.*",
|
||||
]
|
||||
|
||||
[tool.black]
|
||||
line-length = 120
|
||||
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
dateparser==1.4.*
|
||||
discord.py==2.7.*
|
||||
graphviz==0.21.*
|
||||
Japanera==2.1.*
|
||||
mcrcon==0.7.*
|
||||
moviepy==2.2.*
|
||||
nltk==3.10.*
|
||||
numpy==2.5.*
|
||||
opencv-python==5.0.*
|
||||
pillow>=9.2,<12.0
|
||||
psutil==7.2.*
|
||||
psycopg2-binary==2.9.*
|
||||
pypandoc==1.17.*
|
||||
pyyaml==6.0.*
|
||||
regex==2026.9.29
|
||||
requests==2.34.*
|
||||
tzdata # This only needed if run on windows. I haven't set a version either to ensure it's up to date.
|
||||
wordcloud==1.9.*
|
||||
yt-dlp==2026.10.21
|
||||
Reference in new issue
Block a user