Skip to content

replace deprecated startup + UTC timestamp APIs with Python 3.12#182

Open
matheusmaldaner wants to merge 1 commit into
mainfrom
public-release-fixes-lifespan
Open

replace deprecated startup + UTC timestamp APIs with Python 3.12#182
matheusmaldaner wants to merge 1 commit into
mainfrom
public-release-fixes-lifespan

Conversation

@matheusmaldaner

@matheusmaldaner matheusmaldaner commented May 20, 2026

Copy link
Copy Markdown
Collaborator
  • replace FastAPI @app.on_event("startup") with an async lifespan manager
  • replace deprecated datetime.utcnow() calls while preserving naive UTC timestamp strings and timestamp-based IDs

checked with:

  • Python 3.12 timestamp format check passes
  • FastAPI TestClient /status returns preinit; with SENTINEL_DEV=micromail returns ready
  • all 10 SENTINEL_DEV=<env> environments boot to ready
  • parsed 110 scenario eval_sql checks; none reference the rewritten dynamic timestamp fields or generated timestamp ID prefixes

@matheusmaldaner matheusmaldaner changed the title Replace deprecated startup and UTC timestamp APIs replace deprecated startup + UTC timestamp APIs with Python 3.12 May 20, 2026
Base automatically changed from public-release-fixes to main May 20, 2026 16:38
@matheusmaldaner matheusmaldaner marked this pull request as ready for review May 23, 2026 17:44
@matheusmaldaner matheusmaldaner requested a review from afourney May 26, 2026 23:31
server/server.py @app.on_event("startup") moved to an asynccontextmanager
lifespan attached via FastAPI(..., lifespan=_lifespan). Same startup body.

17 datetime.utcnow() call sites rewritten to
datetime.now(timezone.utc).replace(tzinfo=None) across server/server.py
and the microchat / micromail / microdin handlers. The .replace(tzinfo=None)
preserves the naive-UTC wall-clock value so downstream .isoformat() + "Z"
strings and .timestamp() ID generation stay byte-identical.

Both APIs were deprecated (FastAPI 0.93 / Python 3.12). CI pins 3.12 so the
warnings would surface on every run.
@matheusmaldaner matheusmaldaner force-pushed the public-release-fixes-lifespan branch from 79869d3 to c885269 Compare May 27, 2026 03:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant