mirror of
https://github.com/kurbezz/discord-bot.git
synced 2025-12-06 15:15:37 +01:00
Move to uv
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -1,4 +1,4 @@
|
|||||||
venv
|
.venv
|
||||||
|
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
|
||||||
|
|||||||
@@ -1,33 +1,17 @@
|
|||||||
FROM python:3.12-slim AS build
|
FROM ghcr.io/astral-sh/uv:python3.12-slim
|
||||||
|
|
||||||
ARG POETRY_EXPORT_EXTRA_ARGS=''
|
|
||||||
|
|
||||||
WORKDIR /opt/venv
|
|
||||||
RUN python -m venv /opt/venv && /opt/venv/bin/pip install --upgrade pip && /opt/venv/bin/pip install --no-cache-dir httpx poetry poetry-plugin-export
|
|
||||||
|
|
||||||
COPY ./pyproject.toml ./poetry.lock ./
|
|
||||||
RUN --mount=type=ssh /opt/venv/bin/poetry export --without-hashes ${POETRY_EXPORT_EXTRA_ARGS} > requirements.txt \
|
|
||||||
&& /opt/venv/bin/pip install --no-cache-dir -r requirements.txt
|
|
||||||
|
|
||||||
|
|
||||||
FROM python:3.12-slim AS runtime
|
|
||||||
|
|
||||||
RUN apt update && \
|
|
||||||
apt install -y --no-install-recommends curl jq && \
|
|
||||||
apt clean
|
|
||||||
|
|
||||||
COPY ./src/ /app
|
|
||||||
|
|
||||||
COPY ./scripts/*.sh /
|
COPY ./scripts/*.sh /
|
||||||
RUN chmod +x /*.sh
|
RUN chmod +x /*.sh
|
||||||
|
|
||||||
ENV PATH="/opt/venv/bin:$PATH"
|
|
||||||
ENV VENV_PATH=/opt/venv
|
|
||||||
|
|
||||||
COPY --from=build /opt/venv /opt/venv
|
|
||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
|
COPY ./pyproject.toml ./
|
||||||
|
COPY ./uv.lock ./
|
||||||
|
|
||||||
|
RUN uv env && uv sync
|
||||||
|
|
||||||
|
ENV PATH="/app/.venv/bin:$PATH"
|
||||||
|
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
|
||||||
CMD ["python", "main.py"]
|
CMD ["uv", "run", "src/main.py"]
|
||||||
|
|||||||
2152
poetry.lock
generated
2152
poetry.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -1,30 +1,34 @@
|
|||||||
[tool.poetry]
|
[project]
|
||||||
name = "discord-bot"
|
name = "discord-bot"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = ""
|
description = ""
|
||||||
authors = ["Bulat Kurbanov <kurbanovbul@gmail.com>"]
|
authors = [{ name = "Bulat Kurbanov", email = "kurbanovbul@gmail.com" }]
|
||||||
|
requires-python = "~=3.12"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
packages = [{include = "discord_bot"}]
|
dependencies = [
|
||||||
|
"discord-py>=2.4.0,<3",
|
||||||
|
"twitchapi>=4.4.0,<5",
|
||||||
|
"pydantic>=2.10.5,<3",
|
||||||
|
"pydantic-settings>=2.7.1,<3",
|
||||||
|
"httpx>=0.28.1,<0.29",
|
||||||
|
"icalendar>=6.1.0,<7",
|
||||||
|
"pytz~=2024.2",
|
||||||
|
"mongojet>=0.2.7,<0.3",
|
||||||
|
"taskiq>=0.11.11,<0.12",
|
||||||
|
"taskiq-redis>=1.0.2,<2",
|
||||||
|
"redis[hiredis]>=5.2.1,<6",
|
||||||
|
"fastapi>=0.115.8,<0.116",
|
||||||
|
"authx>=1.4.1,<2",
|
||||||
|
"httpx-oauth>=0.16.1,<0.17",
|
||||||
|
"uvicorn[standard]>=0.34.0,<0.35",
|
||||||
|
]
|
||||||
|
|
||||||
[tool.poetry.dependencies]
|
[tool.hatch.build.targets.sdist]
|
||||||
python = "^3.11"
|
include = ["discord_bot"]
|
||||||
discord-py = "^2.4.0"
|
|
||||||
twitchapi = "^4.4.0"
|
|
||||||
pydantic = "^2.10.5"
|
|
||||||
pydantic-settings = "^2.7.1"
|
|
||||||
httpx = "^0.28.1"
|
|
||||||
icalendar = "^6.1.0"
|
|
||||||
pytz = "^2024.2"
|
|
||||||
mongojet = "^0.2.7"
|
|
||||||
taskiq = "^0.11.11"
|
|
||||||
taskiq-redis = "^1.0.2"
|
|
||||||
redis = {extras = ["hiredis"], version = "^5.2.1"}
|
|
||||||
fastapi = "^0.115.8"
|
|
||||||
authx = "^1.4.1"
|
|
||||||
httpx-oauth = "^0.16.1"
|
|
||||||
uvicorn = {extras = ["standard"], version = "^0.34.0"}
|
|
||||||
|
|
||||||
|
[tool.hatch.build.targets.wheel]
|
||||||
|
include = ["discord_bot"]
|
||||||
|
|
||||||
[build-system]
|
[build-system]
|
||||||
requires = ["poetry-core"]
|
requires = ["hatchling"]
|
||||||
build-backend = "poetry.core.masonry.api"
|
build-backend = "hatchling.build"
|
||||||
|
|||||||
Reference in New Issue
Block a user