Skip to content

Commit

Permalink
Django 5 update
Browse files Browse the repository at this point in the history
- Update github ci testing matrix
Note that python 3.8 and django 5 are not compatible so add an exception
not to run that combination

- Update timezone import
Starting from django 5 the utc timezone should be imported from the
default python datetime library instead of the django specific library

- Fix get_fixed_timezone
The get_fixed_timezone method however is still needed from the django
library so import that seperatly
  • Loading branch information
Bob Booij-Liewes committed Dec 18, 2024
1 parent 90d07e0 commit cf96d06
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,11 @@ jobs:
strategy:
matrix:
python-version: ["3.8", "3.12"]
django-version: ["3.2.25", "4.2.11"]
django-version: ["3.2.25", "4.2.17", "5.1.4"]
database-engine: ["postgres", "mysql"]
exclude:
- python-version: 3.8
django-version: 5.1.4

services:
postgres:
Expand Down
6 changes: 4 additions & 2 deletions binder/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
from django.db.models import signals
from django.core.exceptions import ValidationError
from django.db.models.query_utils import Q
from django.utils import timezone
from datetime import timezone
from django.utils.timezone import get_fixed_timezone

from django.utils.translation import gettext_lazy as _
from django.utils.dateparse import parse_date, parse_datetime

Expand Down Expand Up @@ -343,7 +345,7 @@ def clean_value(self, qualifier, v):
offset = int(tzinfo[1:3]) * 60 + int(tzinfo[3:5])
if tzinfo.startswith('-'):
offset = -offset
tzinfo = timezone.get_fixed_timezone(offset)
tzinfo = get_fixed_timezone(offset)
# Create time object
return time(
hour=hour,
Expand Down
2 changes: 1 addition & 1 deletion ci-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
psycopg2<3.0
psycopg2<3.2.3
mysqlclient
Pillow
django-request-id
Expand Down
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='django-binder',
version='1.6.0',
version='1.7.0',
package_dir={'binder': 'binder'},
packages=find_packages(),
include_package_data=True,
Expand All @@ -27,6 +27,7 @@
'Framework :: Django',
'Framework :: Django :: 3.0',
'Framework :: Django :: 4.0',
'Framework :: Django :: 5.0',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Operating System :: OS Independent',
Expand All @@ -36,7 +37,7 @@
'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
],
install_requires=[
'Django >= 3.0, < 4.0',
'Django >= 3.0, < 6.0',
'Pillow >= 3.2.0',
'django-request-id >= 1.0.0',
'requests >= 2.13.0',
Expand Down

0 comments on commit cf96d06

Please sign in to comment.