Skip to content

Replace unmaintained tonyg-rfc3339 with stdlib datetime parsing - #170

Merged
omarryhan merged 1 commit into
masterfrom
fix/drop-tonyg-rfc3339
Jul 9, 2026
Merged

omarryhan merged 1 commit into
masterfrom
fix/drop-tonyg-rfc3339

Conversation

@omarryhan

Copy link
Copy Markdown
Owner

Fixes #169

Why

tonyg-rfc3339 is unmaintained — thesis/python-rfc3339 was archived in 2021 and the original tonyg/python-rfc3339 in January 2026. It ships no wheel and no pyproject.toml, so once pip 25.3 removes the legacy setup.py bdist_wheel build path it will stop installing entirely.

What

Its only use was parse_date/parse_datetime in the opt-in request validators in aiogoogle/validate.py. Those validators' own error messages already tell users to produce values with datetime.isoformat(), so the stdlib fromisoformat() is the semantically matching check (it was even already sitting there commented out).

  • date_validator → datetime.date.fromisoformat()
  • datetime_validator → datetime.datetime.fromisoformat() via a small helper that maps the RFC 3339 Z/z UTC suffix to +00:00, since fromisoformat() only accepts it natively from Python 3.11
  • tonyg-rfc3339 removed from requirements.txt, test_requirements.txt, and docs_requirements.txt
  • New unit tests for both validators, including Z-suffixed, fractional-second, and offset datetimes

Testing

Full unit suite (2939 tests) passes on Python 3.9 — i.e. on the pre-3.11 code path that needs the Z shim — in a venv without tonyg-rfc3339 installed.

Note: pre-3.11 fromisoformat() is slightly stricter than full RFC 3339 (no lowercase t separator, fractional seconds limited to 3 or 6 digits). Since these validators check user-constructed request payloads rather than Google's responses, that strictness matches the documented contract.

🤖 Generated with Claude Code

tonyg-rfc3339 is unmaintained (both upstream repos archived), ships no
wheel and no pyproject.toml, so it will stop installing when pip 25.3
removes the legacy setup.py bdist_wheel build path.

Its only use was parsing date/date-time strings in the opt-in request
validators, whose error messages already tell users to produce values
with datetime.isoformat() — so stdlib fromisoformat() is the matching
check. A small shim keeps the RFC 3339 'Z' suffix working on
Python < 3.11.

Fixes #169

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@omarryhan
omarryhan force-pushed the fix/drop-tonyg-rfc3339 branch from 8dfcd1e to 029ca79 Compare July 9, 2026 07:34
@omarryhan
omarryhan merged commit 1690f0a into master Jul 9, 2026
16 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.

Dependency tonyg-rfc3339 is unmaintained and has looming pip incompatibility

1 participant