Bootstrap: docker
From: python:3.11-slim

%post
    apt-get update
    apt-get install -y --no-install-recommends imagemagick
    rm -rf /var/lib/apt/lists/*

    pip install --no-cache-dir jinja2 pyyaml coverage pytest pytest-cov
    mkdir -p /src

%files
    . /src

%environment
    export PYTHONPATH=/src

%runscript
    cd /src
    exec python3 generate_gallery.py "$@"

%test
    # Run container tests to validate the build
    echo "Running container validation tests..."
    cd /src
    python3 -m pytest tests/ -v