Skip to content

Replace pytz with standard library zoneinfo#27

Merged
csett86 merged 3 commits into
mainfrom
copilot/replace-pytz-with-standard-library
Jan 17, 2026
Merged

Replace pytz with standard library zoneinfo#27
csett86 merged 3 commits into
mainfrom
copilot/replace-pytz-with-standard-library

Conversation

Copilot AI commented Jan 17, 2026

Copy link
Copy Markdown

Removes pytz dependency in favor of Python 3.9+ standard library zoneinfo module.

Changes

Core replacements:

  • pytz.timezone()ZoneInfo()
  • pytz.utctimezone.utc
  • pytz.UnknownTimeZoneErrorZoneInfoNotFoundError
  • tzinfo.localize(dt)dt.replace(tzinfo=tzinfo)

Files modified:

  • Source: utils.py, app.py, render/glyph.py, render/attime.py
  • Tests: test_attime.py, test_functions.py
  • Config: pyproject.toml, docs/conf.py

Example

# Before
import pytz
tzinfo = pytz.timezone('America/Los_Angeles')
dt = tzinfo.localize(datetime.strptime(time_string, '%H:%M%Y%m%d'))

# After
from zoneinfo import ZoneInfo
tzinfo = ZoneInfo('America/Los_Angeles')
dt = datetime.strptime(time_string, '%H:%M%Y%m%d').replace(tzinfo=tzinfo)

All 486 tests pass.

Original prompt

Replace pytz with standard library code


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits January 17, 2026 19:40
Co-authored-by: csett86 <1392875+csett86@users.noreply.github.com>
Co-authored-by: csett86 <1392875+csett86@users.noreply.github.com>
Copilot AI changed the title [WIP] Replace pytz library with standard library code Replace pytz with standard library zoneinfo Jan 17, 2026
Copilot AI requested a review from csett86 January 17, 2026 19:45
@csett86 csett86 marked this pull request as ready for review January 17, 2026 19:51
@csett86 csett86 merged commit 5d27755 into main Jan 17, 2026
10 checks passed
@csett86 csett86 deleted the copilot/replace-pytz-with-standard-library branch January 17, 2026 19:51
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.

2 participants