FROM python:3.12-slim-bookworm
RUN apt-get update -q && apt-get install -y -q --no-install-recommends git ca-certificates procps ripgrep \
    && rm -rf /var/lib/apt/lists/* && pip install -q uv
ENV UV_CACHE_DIR=/uvcache UV_LINK_MODE=copy
# Warm the wheel cache once with the pinned commit's dependencies, so runs do not depend on PyPI latency
RUN git clone -q https://github.com/python-humanize/humanize /tmp/h && cd /tmp/h \
    && git checkout -q 785e5dcc0d0308ad0dff3f6cc0faa7085ad0375b \
    && uv venv -q --python /usr/local/bin/python3.12 .venv && uv pip install -q --python .venv/bin/python -e '.[tests]' pytest \
    && cd / && rm -rf /tmp/h && chmod -R a+rwX /uvcache
