Skip to content

Commit caae9ea

Browse files
committed
Switch to uv package manager
1 parent ab87796 commit caae9ea

File tree

9 files changed

+1621
-42
lines changed

9 files changed

+1621
-42
lines changed

.dockerignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ README*
1818
TERMS_OF_SERVICE*
1919
.env
2020
.gitignore
21-
.ruff.toml
22-
dev-requirements.txt

.vscode/launch.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"configurations": [
44
{
55
"name": "Debug AraBot",
6-
"type": "python",
6+
"type": "debugpy",
77
"request": "launch",
88
"module": "arabot",
99
"justMyCode": true

Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM python:3.13-alpine
1+
FROM ghcr.io/astral-sh/uv:python3.13-alpine
22

33
WORKDIR /app
44

@@ -10,21 +10,22 @@ RUN apk update --no-cache && apk add --no-cache \
1010
opus \
1111
ffmpeg
1212

13-
COPY requirements.txt schema.prisma ./
13+
COPY pyproject.toml uv.lock ./
14+
RUN uv sync --locked --no-cache
1415

15-
RUN pip install --no-cache-dir -r requirements.txt
16+
COPY schema.prisma ./
1617
RUN --mount=type=secret,id=database-url,env=DATABASE_URL,required=true \
17-
prisma db push
18+
uv run prisma db push
1819

1920
RUN mv /root/.cache/prisma-python/binaries/*/*/node_modules/prisma/query-engine-* \
2021
prisma-query-engine-linux-musl && \
2122
rm -rf \
2223
/root/.cache \
2324
/root/.npm \
2425
/tmp/* \
25-
/app/requirements.txt \
26+
/app/pyproject.toml \
27+
/app/uv.lock \
2628
/app/schema.prisma
2729

28-
# `COPY arabot resources ./` copies the *contents* of both folders into workdir
29-
COPY --exclude=requirements.txt --exclude=schema.prisma . .
30-
CMD ["python", "-m", "arabot"]
30+
COPY --exclude=schema.prisma --exclude=pyproject.toml --exclude=uv.lock . .
31+
CMD ["uv", "run", "-m", "arabot"]

arabot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from dotenv import load_dotenv
44

5-
__version__ = "8.23.7"
5+
__version__ = "8.23.8"
66

77
load_dotenv()
88
TESTING = bool(getenv("TESTING"))

dev-requirements.txt

Lines changed: 0 additions & 4 deletions
This file was deleted.

.ruff.toml renamed to pyproject.toml

Lines changed: 40 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,41 @@
1+
2+
[project]
3+
name = "arabot"
4+
version = "8.23.8"
5+
requires-python = ">=3.13"
6+
dependencies = [
7+
"disnake[speed,voice]~=2.11.0",
8+
"prisma",
9+
"jikanpy-v4",
10+
"matplotlib",
11+
"numpy",
12+
"gacha-py",
13+
"python-dotenv",
14+
"tzdata",
15+
"async-lru",
16+
"waifu-py",
17+
"uvloop ; sys_platform != 'win32'",
18+
"winloop ; sys_platform == 'win32'",
19+
]
20+
license = "MPL-2.0"
21+
22+
[dependency-groups]
23+
dev = [
24+
"ruff",
25+
]
26+
27+
[tool.uv.sources]
28+
gacha-py = { url = "https://github.com/rexor12/gacha.py/releases/download/1.0.4/gacha.py-1.0.4-py3-none-any.whl" }
29+
30+
31+
[tool.ruff]
132
target-version = "py313"
233
line-length = 100
334

4-
[format]
35+
[tool.ruff.format]
536
docstring-code-format = true
637

7-
[lint]
38+
[tool.ruff.lint]
839
exclude = ["tools/database_editor.py"]
940
select = ["ALL"]
1041
ignore = [
@@ -38,25 +69,26 @@ ignore = [
3869
"TD003", # missing-todo-link
3970
"TRY003", # raise-vanilla-args
4071
"TRY400", # error-instead-of-exception
72+
"TRY400", # error-instead-of-exception
4173
]
4274

43-
[lint.flake8-annotations]
75+
[tool.ruff.lint.flake8-annotations]
4476
mypy-init-return = true
4577
allow-star-arg-any = true
4678

47-
[lint.flake8-comprehensions]
79+
[tool.ruff.lint.flake8-comprehensions]
4880
allow-dict-calls-with-keyword-arguments = true
4981

50-
[lint.flake8-import-conventions]
82+
[tool.ruff.lint.flake8-import-conventions]
5183
banned-from = ["json", "orjson"]
5284

53-
[lint.isort]
85+
[tool.ruff.lint.isort]
5486
classes = ["clean_content", "pfxless"]
5587

56-
[lint.pep8-naming]
88+
[tool.ruff.lint.pep8-naming]
5789
ignore-names = []
5890

59-
[lint.per-file-ignores]
91+
[tool.ruff.lint.per-file-ignores]
6092
"arabot/core/__init__.py" = ["F401", "F403"]
6193
"arabot/utils/__init__.py" = [
6294
"F401", # unused-import

requirements.txt

Lines changed: 0 additions & 12 deletions
This file was deleted.

tools/setup_venv.bat

Lines changed: 0 additions & 6 deletions
This file was deleted.

uv.lock

Lines changed: 1570 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)