chore: pin all Python dependency versions in requirements.txt (#62) #63
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: cal/major-domo-database#63
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ai/major-domo-database-62"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Pins all Python dependencies to exact versions captured from production (
docker exec sba_db_api pip freeze), and moves dev/test deps into a newrequirements-dev.txt.Changes
requirements.txt: All 9 direct dependencies now use==exact versions:fastapi==0.133.0(was unpinned)uvicorn==0.41.0(was unpinned)starlette==0.52.1(explicitly pinned — transitive dep but root cause of 2026-03-09 outage)python-multipart==0.0.22(was unpinned)numpy==1.26.4(was<2.0.0)pandas==3.0.1(was unpinned)psycopg2-binary==2.9.11(was>=2.9.0)requests==2.32.5(was unpinned)redis==7.3.0(was>=4.5.0)peewee==3.13.3(already pinned, kept as-is)requirements-dev.txt(new file): Dev/test deps separated out:pytest==9.0.2pytest-asyncio==1.3.0Why starlette is explicitly pinned
Starlette is a transitive dependency of fastapi, but it was the direct cause of the production outage — an unpinned upgrade changed
redirect_slashesbehavior and broke all POST requests from the Discord bot. Pinning it explicitly prevents a fastapi upgrade from pulling in a new starlette version silently.Other observations
tiangolo/uvicorn-gunicorn-fastapi:python3.11) is not pinned to a digest. Pinning it would require knowing the exact digest and would need to be updated periodically. Left as a follow-up since the immediate risk is dependency versions, not the base image.requirements-dev.txtin test stages, but the current Dockerfile has no test stage — left as a follow-up.AI Code Review
Files Reviewed
requirements.txt(modified)requirements-dev.txt(added)Findings
Correctness
docker exec sba_db_api pip freeze— versions are production-proven and confirmed working together.starlette==0.52.1correctly pinned as an explicit dep despite being a fastapi transitive — this is the right approach after the redirect_slashes outage. Prevents a futurefastapiupgrade from silently pulling a new starlette.peewee==3.13.3was already pinned; unchanged. No issues.numpy==1.26.4+pandas==3.0.1: pandas 3.0 requires numpy >= 1.26.4 exactly, so these are compatible.pytest>=7.0.0andpytest-asyncio>=0.21.0correctly removed fromrequirements.txtand moved torequirements-dev.txtas exact-pinned versions.requirements.txt— prod image correctly excludes dev deps after this change.Security
Style & Conventions
requirements-dev.txtis a standard convention for separating dev/test deps.Suggestions
tiangolo/uvicorn-gunicorn-fastapi:python3.11isn't pinned to a digest — acknowledged as a follow-up. Worth tracking as an issue since the base image bundles its own fastapi/uvicorn/starlette which pip will then override; digest pinning would close that gap entirely.pip install -r requirements-dev.txtfor tests. A brief note in CLAUDE.md or README would help discoverability, but not a blocker.Verdict: APPROVED
Clean, well-motivated change that directly addresses the 2026-03-09 production outage. All versions are production-validated via pip freeze. Separation of dev deps from the production image is correct and overdue. No issues found.
Automated review by Claude PR Reviewer