Repository navigation
Releases
Releases · mpetazzoni/tslib
tslib 2.0
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_Angelesto retain Pacific-time output, or-t UTCfor host-independent output. - UTC datetime helpers use
datetime.timezone.utcinstead ofpytz.utc. Named zones usezoneinfo.ZoneInfo; migrate anypytz-specificlocalize/normalizecalls to standard-library datetime operations.
Improvements
- Fixes #1: default timezone conversion no longer requires the legacy
US/Pacificalias and uses each timestamp's local daylight-saving offset. tzdataprovides portable explicit IANA timezone lookup when the system database is absent; invalid timezone names produce a friendly CLI usage error.- Modern
pyproject.tomlpackaging, 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; passNonefor OS-local time or aZoneInfoobject 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.