ARG PYTHON_VERSION=3.12
FROM python:${PYTHON_VERSION}-slim

WORKDIR /app

# Install uv for fast dependency resolution
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv

# Copy project files
COPY pyproject.toml ./
COPY sygaldry/ sygaldry/
COPY tests/ tests/

# Install project with test and lint extras via uv
RUN uv pip install --system -e ".[test]" \
    && uv pip install --system ruff pytest pytest-cov pytest-sugar

# Default: run lint then tests
CMD ["sh", "-c", "ruff check sygaldry tests && ruff format --check sygaldry tests && pytest"]
