Skip to content

fix(#1): modernize tslib and default to OS-local time - #2

Merged
mpetazzoni merged 3 commits into
mainfrom
max/bugfix/1-modernize-timezones
Nov 15, 2026
Merged

mpetazzoni merged 3 commits into
mainfrom
max/bugfix/1-modernize-timezones

Conversation

@mpetazzoni

@mpetazzoni mpetazzoni commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Why

Fixes #1: ts no longer assumes the legacy US/Pacific alias exists. Its default display timezone now follows the OS, using the offset appropriate to each timestamp.

What

  • Replace pytz/six with datetime/zoneinfo, with tzdata as a portable fallback for explicit IANA names and friendly errors for invalid names.
  • Move to pyproject.toml and Python 3.11+, documenting the timezone-object API change while retaining the library's UTC display default.
  • Add 51 regression tests and Linux/macOS/Windows CI for Python 3.11–3.14; refresh usage and development docs.

Verification

  • All 51 tests pass locally on macOS with Python 3.11, 3.12, 3.13, and 3.14, with warnings treated as errors. Python 3.11 tests, lint, builds, and metadata checks were rerun after raising the minimum version.
  • Ruff, wheel/sdist builds, and Twine metadata/README validation pass; installed-wheel CLI smoke tests run outside the checkout.
  • Tests cover historical winter/summer OS-local offsets without named timezone files, explicit named zones, and tzdata fallback without a system database.
  • The final 2.0 revision passed all 12 Python 3.11–3.14 matrix jobs on both push and PR runs. CI actions use current Node 24 releases pinned to commit SHAs.
  • Independent reviewer agent was unavailable due to its usage limit; manual diff review completed.

Version is bumped to 2.0 to reflect the compatibility changes. Merged and released as tslib 2.0 with wheel and source archive; PyPI publication is not configured.

@mpetazzoni
mpetazzoni force-pushed the max/bugfix/1-modernize-timezones branch from f2b5e16 to f154b5e Compare November 15, 2026 21:13
@mpetazzoni
mpetazzoni force-pushed the max/bugfix/1-modernize-timezones branch from f154b5e to d5354ce Compare November 15, 2026 21:25
@mpetazzoni
mpetazzoni marked this pull request as ready for review November 15, 2026 21:27
@mpetazzoni
mpetazzoni merged commit 9325cbb into main Nov 15, 2026
24 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.

Old-style default for timezone.

1 participant