diff --git a/poetry.lock b/poetry.lock index bbd4948..b9c4d2e 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1109,13 +1109,13 @@ cli = ["click (>=5.0)"] [[package]] name = "pytz" -version = "2023.4" +version = "2024.2" description = "World timezone definitions, modern and historical" optional = false python-versions = "*" files = [ - {file = "pytz-2023.4-py2.py3-none-any.whl", hash = "sha256:f90ef520d95e7c46951105338d918664ebfd6f1d995bd7d153127ce90efafa6a"}, - {file = "pytz-2023.4.tar.gz", hash = "sha256:31d4583c4ed539cd037956140d695e42c033a19e984bfce9964a3f7d59bc2b40"}, + {file = "pytz-2024.2-py2.py3-none-any.whl", hash = "sha256:31c7c1817eb7fae7ca4b8c7ee50c72f93aa2dd863de768e1ef4245d426aa0725"}, + {file = "pytz-2024.2.tar.gz", hash = "sha256:2aa355083c50a0f93fa581709deac0c9ad65cca8a9e9beac660adcbd493c798a"}, ] [[package]] @@ -1410,13 +1410,13 @@ files = [ [[package]] name = "tzdata" -version = "2024.1" +version = "2024.2" description = "Provider of IANA time zone data" optional = false python-versions = ">=2" files = [ - {file = "tzdata-2024.1-py2.py3-none-any.whl", hash = "sha256:9068bc196136463f5245e51efda838afa15aaeca9903f49050dfa2679db4d252"}, - {file = "tzdata-2024.1.tar.gz", hash = "sha256:2674120f8d891909751c38abcdfd386ac0a5a1127954fbc332af6b5ceae07efd"}, + {file = "tzdata-2024.2-py2.py3-none-any.whl", hash = "sha256:a48093786cdcde33cad18c2555e8532f34422074448fbc874186f0abd79565cd"}, + {file = "tzdata-2024.2.tar.gz", hash = "sha256:7d85cc416e9382e69095b7bdf4afd9e3880418a2413feec7069d533d6b4e31cc"}, ] [[package]] @@ -1559,4 +1559,4 @@ multidict = ">=4.0" [metadata] lock-version = "2.0" python-versions = "^3.10" -content-hash = "f33c7718be64a92e29e505e7eb5b9e81a0798f8f39dace72f84a5252929de461" +content-hash = "16927096e101f554ba000dca244fff62dbb5d70a4f99e21dd5cee3c6323823bd" diff --git a/pyproject.toml b/pyproject.toml index 1696ed9..b2c691e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" @@ -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" diff --git a/uqcsbot/utils/advent_utils.py b/uqcsbot/utils/advent_utils.py index 8df4a44..a7d294b 100644 --- a/uqcsbot/utils/advent_utils.py +++ b/uqcsbot/utils/advent_utils.py @@ -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 @@ -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) @@ -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)