Skip to content

Commit

Permalink
use zoneinfo + tzdata
Browse files Browse the repository at this point in the history
pytz stays around because of dependencies.
tzdata was also already transitively-required.
  • Loading branch information
katrinafyi committed Dec 1, 2024
1 parent 1fd826d commit 1c5eadc
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
14 changes: 7 additions & 7 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ python = "^3.10"
"discord.py" = "^2.3.2"
icalendar = "^5.0"
"python-dateutil" = "^2.9"
pytz = "^2023.3"
requests = "^2.31"
beautifulsoup4 = "^4.12"
APScheduler = "^3.10"
Expand All @@ -21,6 +20,7 @@ aio-mc-rcon = "^3.2.0"
PyYAML = "^6.0"
mcstatus = "^11.1.0"
pillow = "^11.0.0"
tzdata = "*"

[tool.poetry.scripts]
botdev = "dev.cli:main"
Expand Down
6 changes: 3 additions & 3 deletions uqcsbot/utils/advent_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
)
from collections import defaultdict
from datetime import datetime, timedelta
from zoneinfo import ZoneInfo
from io import BytesIO
from pytz import timezone

import PIL.Image
import PIL.ImageDraw
Expand All @@ -38,7 +38,7 @@
Leaderboard = list[str | ColourFragment]

# Puzzles are unlocked at midnight EST.
EST_TIMEZONE = timezone("US/Eastern")
EST_TIMEZONE = ZoneInfo("America/New_York")

# The time to cache results to limit requests to adventofcode.com. Note that 15 minutes is the recomended minimum time.
CACHE_TIME = timedelta(minutes=15)
Expand Down Expand Up @@ -95,7 +95,7 @@ def from_member_data(cls, data: Json, year: int) -> "Member":
times = member.times[day]

# timestamp of puzzle unlock (12AM EST)
DAY_START = EST_TIMEZONE.localize(datetime(year, 12, day))
DAY_START = datetime(year, 12, day, tzinfo=EST_TIMEZONE)

for s, star_data in day_data.items():
star = int(s)
Expand Down

0 comments on commit 1c5eadc

Please sign in to comment.