diff --git a/.container/Dockerfile b/.container/Dockerfile index 2cfcbef7..e72d336a 100644 --- a/.container/Dockerfile +++ b/.container/Dockerfile @@ -1,22 +1,37 @@ FROM python:3.10-bookworm -# Install uv and common tools -RUN apt-get update && apt-get install -y curl git && \ - pip install uv && \ - rm -rf /var/lib/apt/lists/* +# Install system dependencies and Poetry +RUN apt-get update && apt-get install -y \ + curl \ + git \ + build-essential \ + && rm -rf /var/lib/apt/lists/* && \ + pip install poetry # Set workdir WORKDIR /app/oasis -# Copy code -COPY . . +# Copy Poetry files and README first for better caching +COPY pyproject.toml README.md ./ -# Set up venv + install dev deps -RUN uv venv .venv --python=3.10 && \ - . .venv/bin/activate && \ - uv pip install -e ".[dev]" && \ - pip install pre-commit mypy && \ - pre-commit install +# Configure Poetry +RUN poetry config virtualenvs.create false + +# Generate new lock file and install dependencies without the root package +RUN poetry lock && poetry install --with dev --no-root --no-interaction --no-ansi + +# Copy remaining source code +COPY oasis/ ./oasis/ + +# Install the root package now that source is available +RUN poetry install --only-root --no-interaction --no-ansi + +# Install pre-commit hooks (development) +RUN poetry run pre-commit install || true + +# Set environment variables +ENV PYTHONPATH=/app/oasis +ENV PYTHONUNBUFFERED=1 # Keep container alive for development CMD ["tail", "-f", "/dev/null"] diff --git a/pyproject.toml b/pyproject.toml index ba99dcde..043a3fad 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -26,12 +26,9 @@ python = ">=3.10.0,<3.12" pandas = "2.2.2" igraph = "0.11.6" cairocffi = "1.7.1" -pytest = "8.2.0" -pytest-asyncio = "0.23.6" pillow = "10.3.0" unstructured = "0.13.7" sentence-transformers = "3.0.0" -pre-commit = "3.7.1" prance = "23.6.21.0" openapi-spec-validator = "0.7.1" slack_sdk = "3.31.0" @@ -39,6 +36,11 @@ neo4j = "5.23.0" camel-ai = "0.2.70" requests_oauthlib = "2.0.0" +[tool.poetry.group.dev.dependencies] +pytest = "8.2.0" +pytest-asyncio = "0.23.6" +pre-commit = "3.7.1" + [build-system] requires = ["poetry-core>=1.0.0"] build-backend = "poetry.core.masonry.api"