pytest-dev-pytest
SUCCESS
57m 42s
History Source
SummaryIterations3Transcript62Dockerfile
Dockerfile34 lines · 950 chars
FROM python:3.12-slim

# Build-time version pretend to satisfy setuptools_scm when git metadata is absent
ARG PRETEND_VERSION=0.0.0
ENV SETUPTOOLS_SCM_PRETEND_VERSION=${PRETEND_VERSION}
ENV SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST=${PRETEND_VERSION}

# Install build tools and dependencies
RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
        build-essential \
        libffi-dev \
        libssl-dev \
        zlib1g-dev \
        python3-dev \
        git && \
    rm -rf /var/lib/apt/lists/*

# Upgrade packaging tooling
RUN python -m pip install --upgrade pip setuptools wheel

# Set working directory
WORKDIR /workspace

# Copy metadata and source; building from source uses pyproject.toml and src/
COPY pyproject.toml ./
COPY src/ ./src/

# Install the package from source
RUN pip install --no-cache-dir .

# Smoke test: verify pytest can report a version
CMD ["pytest", "--version"]