chore(deps): drop transitives from requirements.txt, split prod from dev#28
chore(deps): drop transitives from requirements.txt, split prod from dev#28
Conversation
Only Flask and pytest are directly imported anywhere in the source. The other 13 pinned packages (blinker, click, colorama, exceptiongroup, iniconfig, itsdangerous, Jinja2, MarkupSafe, packaging, pluggy, tomli, typing_extensions, Werkzeug) are transitive deps that pip resolves automatically. - requirements.txt: keep Flask only. - requirements-dev.txt: -r requirements.txt + pytest, for tests. - ci.yml: split into a prod-install-smoke job (installs requirements.txt only and boots the app via test_client — catches future un-listed third-party imports before merge) and the existing pytest job (now installs requirements-dev.txt). - README: new Development section pointing at requirements-dev.txt for running the test suite. Closes #27
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
📝 WalkthroughWalkthroughThe PR separates production and development dependencies into two requirement files, creates a new requirements-dev.txt with pytest, strips requirements.txt to Flask only, adds a production smoke-test job to CI that verifies the app boots with production dependencies, and documents the development workflow in the README. ChangesDependency Separation and Verification
Sequence DiagramsequenceDiagram
actor CI as CI Runner
participant pip as pip
participant Flask as Flask App
participant Client as Test Client
CI->>pip: pip install -r requirements.txt
pip-->>Flask: Flask==3.1.3
CI->>Flask: import app
CI->>Flask: app.run() initialization
Flask-->>CI: app ready
CI->>Client: create test client
Client->>Flask: GET /
Flask-->>Client: HTTP 200
Client-->>CI: assertion passed ✓
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Problem
requirements.txtlisted 15 pinned packages, but only two are directly imported anywhere in the source:Flask(production) andpytest(test-only). The other 13 are transitive deps that pip resolves automatically. Side effects: production users following the README'spip install -r requirements.txtstep get a test framework they don't need, and there was no clean place to declare dev-only deps.Change
requirements.txt: keepFlask==3.1.3only.requirements-dev.txt:-r requirements.txt+pytest==9.0.2..github/workflows/ci.yml: split into two jobs:prod-install-smoke— installsrequirements.txtonly and boots the app viatest_client. Catches future PRs that add a direct third-party import without bumpingrequirements.txt.pytest— installsrequirements-dev.txt, runs the suite. Cache key now tracks both files.README.md: newDevelopmentsection pointing atrequirements-dev.txtfor tests.Test plan
pip install -r requirements.txtfrom a clean venv → 7 packages auto-resolved (Flask + 6 transitives)python app.py --port 5701on prod-only venv → boots,GET ///api/projects//api/search?q=xall 200,GET /api/sessions/x/y404 as expectedscripts/export.py --helpandscripts/export.py listwork on prod-only venvpip install -r requirements-dev.txtfrom a clean venv → 12 packagespytest tests/on dev venv → 92/92 passactionlint .github/workflows/ci.yml→ exit 0Closes #27
Summary by CodeRabbit
Chores
Documentation