Skip to content

fix: clean up Python 2 remnants and resolve deprecation warnings#8

Merged
jcardozo-eth merged 4 commits intomasterfrom
fix/cleanup-python2-deprecations
Feb 27, 2026
Merged

fix: clean up Python 2 remnants and resolve deprecation warnings#8
jcardozo-eth merged 4 commits intomasterfrom
fix/cleanup-python2-deprecations

Conversation

@jcardozo-eth
Copy link
Member

@jcardozo-eth jcardozo-eth commented Feb 27, 2026

Summary

  • Replace deprecated datetime.utcnow() with datetime.now(timezone.utc) in server.py,
    stripping tzinfo to maintain compatibility with the naive-datetime convention enforced
    by datetime_to_datestamp() (Python docs)
  • Remove dead Python 2 try/except import blocks in test_client.py and fakeclient.py
  • Delete non-functional Python 2 data generation scripts (createdata.py,
    createdata_deleted_records.py)
  • Rename TestErrorFakeRequestError to fix PytestCollectionWarning

All changes remove dead code, fix deprecations, or correct naming
and should not impact functional behavior.

Test plan

  • uv run pytest — 58 tests pass
  • uv run pytest -W error::DeprecationWarning — zero deprecation warnings
  • Zero pytest warnings (PytestCollectionWarning resolved)

…tive

datetime.utcnow() has been deprecated since Python 3.12 and will be
removed in a future version. Replace with datetime.now(timezone.utc),
stripping tzinfo to maintain compatibility with the naive-datetime
convention used throughout the codebase (enforced by the assertion in
datetime_to_datestamp()).
Remove dead try/except import blocks where the except branch can never
execute on Python >= 3.10. Replace with direct imports of the Python 3
standard library modules.
These scripts use Python 2 print statements and hardcoded absolute
paths, making them non-functional on Python 3. The fixture XML files
they originally generated already exist in the fake1/–fake5/ test
directories.
Pytest attempts to collect TestError as a test class because its name
starts with 'Test'. Rename to FakeRequestError to follow the existing
Fake* naming convention in fakeclient.py and eliminate the warning.
@jcardozo-eth jcardozo-eth changed the title fix: clean up Python 2 cruft and resolve deprecation warnings fix: clean up Python 2 remnants and resolve deprecation warnings Feb 27, 2026
@jcardozo-eth jcardozo-eth merged commit a1af499 into master Feb 27, 2026
8 checks passed
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