fix: clear the two Starlette deprecation warnings - #218
Conversation
Starlette 1.3.1 deprecated `HTTP_413_REQUEST_ENTITY_TOO_LARGE` in favour of `HTTP_413_CONTENT_TOO_LARGE`. Both resolve to 413, so the swap at the single call site in the project-import size guard is warning-only with no behaviour change. `starlette.testclient` now prefers `httpx2` and warns when it falls back to `httpx`. Add `httpx2` to the dev group so TestClient picks it up. `httpx` stays a runtime dependency — auth, github_service, user_service, the OpenAI embedding provider and sitemap_notifier all use it directly, and several test modules mock `httpx.Response` / `httpx.HTTPStatusError` against that runtime code. The test suite now runs with zero deprecation warnings. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe import endpoint now uses the current HTTP 413 status constant. The development dependency group now includes ChangesImport status response
Development dependency
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to This PR updates a deprecated status-code name and adds the test dependency needed to remove deprecation warnings without changing runtime behavior; no actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Clears both
DeprecationWarnings the test suite was emitting after the dependency bumps in #215. Neither changes behaviour.HTTP_413_REQUEST_ENTITY_TOO_LARGE→HTTP_413_CONTENT_TOO_LARGEStarlette 1.3.1 deprecated the old spelling. Both constants resolve to
413, and there is a single call site — the upload size guard inimport_project(ontokit/api/routes/projects.py:197). The test assertingresponse.status_code == 413is unaffected.starlette.testclient→httpx2starlette.testclientnow importshttpx2and falls back tohttpxwith a warning. Addinghttpx2to the dev group makes TestClient pick it up:httpxdeliberately stays a runtime dependency —core/auth.py,services/github_service.py,services/user_service.py,services/embedding_providers/openai_provider.pyandservices/sitemap_notifier.pyall use it directly, andtest_auth_routes.py/test_github_service.pymockhttpx.Responseandhttpx.HTTPStatusErroragainst that runtime code.Verification
ruff check,ruff format --check,mypystrict,pyright— all clean (0 errors)uv lock --checkconsistentSummary by CodeRabbit