Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop Django 3.2 support #251

Merged
merged 1 commit into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']
django-version: ['3.2', '4.2', '5.0', 'main']
django-version: ['4.2', '5.0', 'main']
exclude:
- python-version: '3.8'
django-version: '5.0'
Expand All @@ -23,10 +23,6 @@ jobs:
django-version: '5.0'
- python-version: '3.9'
django-version: 'main'
- python-version: '3.11'
django-version: '3.2'
- python-version: '3.12'
django-version: '3.2'
- python-version: '3.12'
django-version: '4.2'
steps:
Expand Down
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

### Changed
- Drop Django 3.2 support

## [6.2.1] - 2024-04-18
### Fixed
- Fix JDateFieldListFilter bug with jDateField
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Dependencies
------------

- jdatetime_
- Django_ > 3.2
- Django_ > 4.2

Looking for Django 1.X support? Checkout *2.4.6* version in pypi.org
- `Django REST Framework`_ > 3.12 (If install with ``drf`` dependency)
Expand Down Expand Up @@ -296,7 +296,7 @@ If you wish to limit the testing to specific environment(s), you can parametrize

.. code:: shell

$ tox -e py39-django32
$ tox -e py39-django42

.. _jdatetime: https://github.com/slashmili/python-jalali
.. _Django: https://www.djangoproject.com/
Expand Down
3 changes: 1 addition & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ classifiers =
Programming Language :: Python :: 3.12
Programming Language :: Python :: Implementation :: CPython
Framework :: Django
Framework :: Django :: 3.2
Framework :: Django :: 4.2
Framework :: Django :: 5.0

Expand All @@ -35,7 +34,7 @@ include_package_data = True
zip_safe = False
install_requires =
jdatetime>=5.0.0
django>=3.2
django>=4.2

[options.extras_require]
drf = djangorestframework>=3.12
Expand Down
4 changes: 1 addition & 3 deletions tests/test_admin.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from urllib.parse import unquote

import jdatetime
from django import get_version
from django.contrib.admin import site
from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.models import AnonymousUser
Expand Down Expand Up @@ -93,7 +92,6 @@ def get_changelist(self, request, model, modeladmin):
modeladmin.list_editable,
modeladmin,
modeladmin.sortable_by,
modeladmin.search_help_text,
]
if get_version() >= "4.0":
args.append(modeladmin.search_help_text)
return ChangeList(*args)
21 changes: 6 additions & 15 deletions tests/test_models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import datetime

import jdatetime
from django import get_version
from django.core.exceptions import ValidationError
from django.db.migrations.writer import MigrationWriter
from django.test import TestCase, override_settings, skipUnlessDBFeature
Expand Down Expand Up @@ -162,13 +161,9 @@ def test_filter_by_exact_datetime(self):
@override_settings(USE_TZ=True, TIME_ZONE="Asia/Tehran")
def test_lookup_date_with_use_tz(self):
current_timezone = timezone.get_current_timezone()
if get_version() >= "4.0":
jdt1 = jdatetime.datetime(
1392, 3, 12, 10, 22, 23, 240000, tzinfo=current_timezone
)
else:
jdt1 = jdatetime.datetime(1392, 3, 12, 10, 22, 23, 240000)
jdt1 = current_timezone.localize(jdt1)
jdt1 = jdatetime.datetime(
1392, 3, 12, 10, 22, 23, 240000, tzinfo=current_timezone
)

BarTime.objects.create(name="with timezone", datetime=jdt1)
k = BarTime.objects.filter(datetime=jdt1)
Expand Down Expand Up @@ -235,13 +230,9 @@ def test_serialize_default_datetime_value(self):
@override_settings(USE_TZ=True, TIME_ZONE="Asia/Tehran")
def test_timezone(self):
current_timezone = timezone.get_current_timezone()
if get_version() >= "4.0":
jdt1 = jdatetime.datetime(
1392, 3, 12, 10, 22, 23, 240000, tzinfo=current_timezone
)
else:
jdt1 = jdatetime.datetime(1392, 3, 12, 10, 22, 23, 240000)
jdt1 = current_timezone.localize(jdt1)
jdt1 = jdatetime.datetime(
1392, 3, 12, 10, 22, 23, 240000, tzinfo=current_timezone
)

new_bartime = BarTime.objects.create(name="with timezone", datetime=jdt1)
self.assertEqual(
Expand Down
3 changes: 0 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[tox]
envlist =
py{38,39,310}-dj32
py{38,39,310,311}-dj42
py{310,311,312}-dj{50,main}
py38-lint
Expand All @@ -15,15 +14,13 @@ python =

[gh-actions:env]
DJANGO =
3.2: dj32
4.2: dj42
5.0: dj50
main: djmain

[testenv]
deps =
-rrequirements-test.txt
dj32: Django==3.2.*
dj42: Django==4.2.*
dj50: Django==5.0.*
djmain: https://github.com/django/django/archive/main.tar.gz
Expand Down
Loading