Skip to content

Commit

Permalink
Add ZoneInfo backport for Python3.8 support
Browse files Browse the repository at this point in the history
3.8 is EOL in October but easy enough to support it until then.
  • Loading branch information
ColeDCrawford committed May 30, 2024
1 parent faef987 commit 5db7fb5
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion catchpy/consumer/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
from django.db.models import CASCADE, CharField, DateTimeField, ForeignKey, Model, OneToOneField
from django.db.models.signals import post_save
from django.dispatch import receiver
from zoneinfo import ZoneInfo
try:
from zoneinfo import ZoneInfo
except ImportError:
from backports.zoneinfo import ZoneInfo


User = get_user_model()
Expand Down
1 change: 1 addition & 0 deletions catchpy/requirements/base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ python-dotenv>=1.0.0
requests>=2.31.0
django-log-request-id>=2.1.0
django-cors-headers>=4.2.0
backports.zoneinfo;python_version<"3.9"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ dependencies = [
"PyLD>=2.0.3, <3.0.0",
"python-dateutil>=2.8.2",
"python-dotenv>=1.0.0",
"pytz>=2023.3",
"requests>=2.31.0",
"django-log-request-id>=2.1.0",
"django-cors-headers>=4.2.0",
"backports.zoneinfo;python_version<'3.9'",
]

[tool.hatch.version]
Expand Down

0 comments on commit 5db7fb5

Please sign in to comment.