Add psycopg2
Some checks failed
ci/woodpecker/push/check Pipeline failed

This commit is contained in:
PapaTutuWawa 2025-04-21 17:09:39 +02:00
parent c3581e330e
commit 0596c99bea
3 changed files with 24 additions and 5 deletions

View File

@ -2,14 +2,14 @@ FROM ghcr.io/astral-sh/uv:python3.13-alpine as builder
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=0
WORKDIR /app
ADD . /app
RUN apk add --no-cache cargo git && \
uv sync --frozen --no-install-project --no-dev
RUN apk add --no-cache cargo git libpq libpq-dev && \
uv sync --frozen --no-install-project --no-dev --extra postgres
RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --frozen --no-dev
FROM python:3.13-alpine3.20
# slixmpp requires libgcc
RUN apk add --no-cache libgcc
# slixmpp requires libgcc and libpq for Postgres support
RUN apk add --no-cache libgcc libpq
# Install the application
COPY --from=builder /app /app

View File

@ -18,6 +18,12 @@ dependencies = [
]
[project.optional-dependencies]
# For connecting to Postgres databases
postgres = [
"psycopg2>=2.9.10"
]
# Development tooling
dev = [
"ruff>=0.11.6",
"black>=25.1.0",

15
uv.lock
View File

@ -402,6 +402,15 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/6d/45/59578566b3275b8fd9157885918fcd0c4d74162928a5310926887b856a51/platformdirs-4.3.7-py3-none-any.whl", hash = "sha256:a03875334331946f13c549dbd8f4bac7a13a50a895a0eb1e8c6a8ace80d40a94", size = 18499 },
]
[[package]]
name = "psycopg2"
version = "2.9.10"
source = { registry = "https://pypi.org/simple" }
sdist = { url = "https://files.pythonhosted.org/packages/62/51/2007ea29e605957a17ac6357115d0c1a1b60c8c984951c19419b3474cdfd/psycopg2-2.9.10.tar.gz", hash = "sha256:12ec0b40b0273f95296233e8750441339298e6a572f7039da5b260e3c8b60e11", size = 385672 }
wheels = [
{ url = "https://files.pythonhosted.org/packages/ae/49/a6cfc94a9c483b1fa401fbcb23aca7892f60c7269c5ffa2ac408364f80dc/psycopg2-2.9.10-cp313-cp313-win_amd64.whl", hash = "sha256:91fd603a2155da8d0cfcdbf8ab24a2d54bca72795b90d2a3ed2b6da8d979dee2", size = 2569060 },
]
[[package]]
name = "pyasn1"
version = "0.6.1"
@ -850,6 +859,9 @@ dev = [
{ name = "mypy" },
{ name = "ruff" },
]
postgres = [
{ name = "psycopg2" },
]
[package.metadata]
requires-dist = [
@ -857,10 +869,11 @@ requires-dist = [
{ name = "black", marker = "extra == 'dev'", specifier = ">=25.1.0" },
{ name = "fastapi", extras = ["standard"] },
{ name = "mypy", marker = "extra == 'dev'", specifier = ">=1.15.0" },
{ name = "psycopg2", marker = "extra == 'postgres'", specifier = ">=2.9.10" },
{ name = "pydantic" },
{ name = "pydantic-yaml" },
{ name = "ruff", marker = "extra == 'dev'", specifier = ">=0.11.6" },
{ name = "slixmpp", git = "https://codeberg.org/poezio/slixmpp" },
{ name = "sqlmodel" },
]
provides-extras = ["dev"]
provides-extras = ["postgres", "dev"]