chore: replace deprecated utcnow() with timezone-aware UTC timestamps#41
Merged
RichardAtCT merged 3 commits intoRichardAtCT:mainfrom Feb 19, 2026
Merged
Conversation
Contributor
Author
|
Update: addressed the remaining warning sources in this branch. Added in follow-up
Validation run
(That single deselected test remains environment-sensitive due to ANTHROPIC_API_KEY state in this runner.) |
Contributor
Author
|
Follow-up pushed to this PR ✅ I also applied the legacy session timestamp compatibility fix here:
Validation:
Commit: |
RichardAtCT
approved these changes
Feb 19, 2026
Owner
RichardAtCT
left a comment
There was a problem hiding this comment.
Clean maintenance PR. Tests pass (329 passed, 0 warnings), merges cleanly with main. Minor formatting issue in session.py (extra blank line) will be fixed post-merge.
5 tasks
RichardAtCT
added a commit
that referenced
this pull request
Feb 19, 2026
- Fix ProjectThreadModel.from_row() fromisoformat crash (datetime adapter from #41 returns datetime objects, not strings) - Bulk autofix: unused imports, unused vars, trailing whitespace, line length, formatting (black + isort + autoflake) - Add autoflake dev dependency
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR performs a repo-wide cleanup to replace deprecated
datetime.utcnow()usage with timezone-aware UTC timestamps.What changed
datetime.utcnow()withdatetime.now(UTC)across touched source and tests.default_factory=datetime.utcnowwithdefault_factory=lambda: datetime.now(UTC)for dataclass fields.UTCfromdatetime.Scope
Validation
poetry run pytest tests/unit/test_claude/test_session.py tests/unit/test_security/test_audit.py tests/unit/test_security/test_auth.py tests/unit/test_security/test_rate_limiter.py tests/unit/test_storage/test_repositories.py -q -r w82 passed, 53 warningspoetry run pytest -q -r w -k "not sdk_manager_initialization_without_api_key"270 passed, 1 deselected, 138 warningsNotes on remaining warnings
Remaining warnings are not from
utcnow()anymore:aiosqlite/sqlite datetime adapter deprecation warnings in storage testsPytestCollectionWarningintests/unit/test_events/test_bus.pyKnown unrelated test failure in this environment
Running full suite without exclusion fails at:
tests/unit/test_claude/test_sdk_integration.py::TestClaudeSDKManager::test_sdk_manager_initialization_without_api_keyReason: environment has
ANTHROPIC_API_KEYset (value present), which conflicts with that test's expectation.