Skip to content

tslib 2.0

Latest

Choose a tag to compare

@mpetazzoni mpetazzoni released this 15 Nov 21:28
· 2 commits to main since this release
9325cbb

tslib 2.0

A Python 3 refresh with portable timezones and an OS-local default for ts.

Breaking changes

  • Requires Python 3.11 or newer.
  • The CLI's default display timezone follows the operating system instead of assuming US/Pacific. Use -t America/Los_Angeles to retain Pacific-time output, or -t UTC for host-independent output.
  • UTC datetime helpers use datetime.timezone.utc instead of pytz.utc. Named zones use zoneinfo.ZoneInfo; migrate any pytz-specific localize/normalize calls to standard-library datetime operations.

Improvements

  • Fixes #1: default timezone conversion no longer requires the legacy US/Pacific alias and uses each timestamp's local daylight-saving offset.
  • tzdata provides portable explicit IANA timezone lookup when the system database is absent; invalid timezone names produce a friendly CLI usage error.
  • Modern pyproject.toml packaging, refreshed usage/development documentation, 51 regression tests, and Python 3.11–3.14 CI on Linux, macOS, and Windows.
  • The library's render_date(date) display default remains UTC; pass None for OS-local time or a ZoneInfo object for a named zone.

The attached wheel and source archive are also published to PyPI as tslib 2.0 via GitHub Actions Trusted Publishing. The PyPI distributions have the same SHA-256 checksums as these release assets.