Repository navigation
chore(WOF-53): clear the remaining deprecation warnings - #126
Conversation
The suite now passes with -W error::DeprecationWarning (and with -W error::UserWarning) on CPython 3.12. - Move the 15 class-based Pydantic Config blocks in src/api/schemas/ to model_config = ConfigDict(...). from_attributes and json_schema_extra carry over unchanged. - create_session_cookie uses datetime.now(timezone.utc), so expires_at is an aware ISO 8601 value with a +00:00 offset. No server code parses or compares expires_at; the cookie max_age in the login route enforces expiry, so the change cannot cause a naive/aware TypeError. New tests pin the aware UTC form. - test_schedule_override_service compares against naive UTC, because schedule_override.created_at is a naive DateTime that SQLite fills in UTC. - Add httpx2 to requirements-dev.txt. Starlette 1.10.0 TestClient prefers httpx2 and warns when it falls back to httpx. httpx stays in requirements.txt because settings.py catches its exceptions at runtime.
|
Important Review skippedAuto reviews are limited based on label configuration. 🏷️ Required labels (at least one): 1
Please check the settings in the CodeRabbit UI or the
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | ✅ 0 (≤ 100 complexity) |
| Duplication | ✅ 0 (≤ 5 duplication) |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
Plane: WOF-53. Follow-up to WOF-52 (#124).
pytest -W error::DeprecationWarningcollects and passes on CPython 3.12.13: 760 passed, 83.04% coverage, zero warnings (also with-W error::UserWarning).Changes
Configblocks insrc/api/schemas/move tomodel_config = ConfigDict(...).from_attributesandjson_schema_extraare unchanged; the OpenAPI examples still render.create_session_cookieinsrc/auth/utils.pyusesdatetime.now(timezone.utc).expires_atbecomes an aware ISO 8601 value with a+00:00offset.expires_at. The cookiemax_agein the login route enforces expiry, so a naive/awareTypeErrorcannot occur.test_expires_at_is_aware_utcpins the aware form, and the duration tests use aware bounds.test_override_in_range_returnedcompares against naive UTC, becauseschedule_override.created_atis a naiveDateTimethat SQLite fills in UTC.httpx2==2.16.2goes intorequirements-dev.txt. Starlette 1.10.0 (pinned through FastAPI 0.165.0) documents httpx2 as the TestClient backend and warns when it falls back to httpx.httpxstays inrequirements.txtbecausesrc/api/routes/settings.pycatches httpx exceptions at runtime. The production image is unchanged.