FROM python:3.12-slim-bookworm

ARG SETUPTOOLS_SCM_PRETEND_VERSION=0.0.0

RUN useradd -m -s /bin/bash testpub

COPY pyproject.toml /tmp/test-publish/
COPY test_publish/ /tmp/test-publish/test_publish/

RUN pip install --no-cache-dir /tmp/test-publish && \
    rm -rf /tmp/test-publish

WORKDIR /workspace

USER testpub