Uh oh!
There was an error while loading. Please reload this page.
Pin backend dependencies using pip-compile - #11
Conversation
Split requirements into requirements.in (direct dependencies with loose constraints) and requirements.txt (fully pinned lockfile with hashes, generated by pip-compile). This makes Docker builds deterministic and prevents unrelated PRs from pulling in breaking dependency updates. To update dependencies: docker run --rm -v "$(pwd)/backend:/app" -w /app python:3.13-slim-bookworm \ sh -c "pip install --quiet pip-tools && pip-compile --strip-extras \ --generate-hashes --output-file requirements.txt requirements.in" Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The production Dockerfile already uses python:3.13-slim-bookworm. Dev was on python:3.11-slim, which could mask compatibility issues. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Prevents merging PRs where someone edits requirements.in but forgets to regenerate the lockfile with pip-compile. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Pins backend Python dependencies using pip-compile to prevent deploy breakages from drifting/unpinned packages, and adds documentation + CI guardrails to keep the lockfile updated.
Changes:
- Introduce
backend/requirements.inand regeneratebackend/requirements.txtas a fully pinned, hashed lockfile. - Update docs with a repeatable
pip-compileworkflow for updating backend dependency pins. - Replace the dummy CI workflow with a PR check that enforces updating
requirements.txtwhenrequirements.inchanges.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
docker-README.md | Documents how to regenerate backend dependency pins with pip-tools. |
backend/requirements.txt | Replaces the old loosely-pinned requirements with a pip-compiled, hashed lockfile. |
backend/requirements.in | Adds the source-of-truth direct dependency list for pip-compile. |
backend/Dockerfile.dev | Updates the dev image base to Python 3.13 bookworm to match the lockfile generation context. |
README.md | Updates prerequisites and documents the backend lockfile update process. |
.github/workflows/ci.yml | Adds a PR-time check to ensure lockfile changes accompany input dependency changes. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Move pytest and pytest-asyncio to a separate requirements-dev.in so they don't ship in the production image. Add psycopg2-binary to requirements.in and remove the separate pip install from the prod Dockerfile. Update README Quick Start to use Docker commands instead of make targets. Update CI to check both lockfiles. Regenerate both lockfiles. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Move Makefile targets into a separate "Local Development (not recommended)" section. Standardize on "docker compose" (space) in all documentation. Add Docker command for populating mock data. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Uh oh!
There was an error while loading. Please reload this page.
Any merged PR triggers deploy events for both frontend and backend, and currently the backend requirements.txt is outdated with insufficient pinning, leading to a failed deploy.
This PR fixes that by employing
pip-compileto pin production deps and allow updating the pins painlessly.There's some semi-related documentation churn here, too, standardizing development on "docker compose". There wasn't a great place to put those changes in separately, so let's just be done with it now.