From fb788c28b176c121363b86a5441e8eec9a1c4270 Mon Sep 17 00:00:00 2001 From: Hasan Ramezani Date: Fri, 12 Jul 2024 13:56:58 +0200 Subject: [PATCH] Drop Django 3.2 support --- .github/workflows/test.yml | 6 +----- CHANGELOG.md | 3 +++ README.rst | 4 ++-- setup.cfg | 3 +-- tests/test_admin.py | 4 +--- tests/test_models.py | 21 ++++++--------------- tox.ini | 3 --- 7 files changed, 14 insertions(+), 30 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index e35087c..5ecd792 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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' @@ -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: diff --git a/CHANGELOG.md b/CHANGELOG.md index c7f069e..f8fff84 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +### Changed +- Drop Django 3.2 support + ## [6.2.1] - 2024-04-18 ### Fixed - Fix JDateFieldListFilter bug with jDateField diff --git a/README.rst b/README.rst index 6e5d2f8..113703f 100644 --- a/README.rst +++ b/README.rst @@ -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) @@ -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/ diff --git a/setup.cfg b/setup.cfg index a392718..d28d0c8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -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 @@ -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 diff --git a/tests/test_admin.py b/tests/test_admin.py index 2c37aa4..6ab47e0 100644 --- a/tests/test_admin.py +++ b/tests/test_admin.py @@ -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 @@ -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) diff --git a/tests/test_models.py b/tests/test_models.py index 5698b9d..85dc4b6 100644 --- a/tests/test_models.py +++ b/tests/test_models.py @@ -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 @@ -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) @@ -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( diff --git a/tox.ini b/tox.ini index 307d88f..01132b5 100644 --- a/tox.ini +++ b/tox.ini @@ -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 @@ -15,7 +14,6 @@ python = [gh-actions:env] DJANGO = - 3.2: dj32 4.2: dj42 5.0: dj50 main: djmain @@ -23,7 +21,6 @@ DJANGO = [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