From fb91cca331c5214a808d27a283b5dad2e4fc73d1 Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Fri, 22 Jul 2022 15:08:20 +0200 Subject: [PATCH] Django 4 --- CHANGELOG.md | 6 ++++++ fnpdjango/actions.py | 2 +- fnpdjango/utils/settings.py | 4 ++-- setup.py | 4 ++-- tests/urls.py | 6 +++--- tox.ini | 12 ++++++------ 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0208d6e..98ea96e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ This document records all notable changes to fnpdjango. +## 0.6 (2022-07-22) + +- Support for Django up to 4.0. +- Drop support for Django 1.11. + + ## 0.5 (2021-07-05) - Support for Django up to 3.2. diff --git a/fnpdjango/actions.py b/fnpdjango/actions.py index 0855f72..a6da12b 100644 --- a/fnpdjango/actions.py +++ b/fnpdjango/actions.py @@ -1,7 +1,7 @@ # Source: https://gist.github.com/jeremyjbowers/e8d007446155c12033e6 import csv from django.http import HttpResponse -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ def export_as_csv_action(description=_("Export selected objects as CSV file"), fields=None, exclude=None, header=True): diff --git a/fnpdjango/utils/settings.py b/fnpdjango/utils/settings.py index 83b0302..b6df2b3 100644 --- a/fnpdjango/utils/settings.py +++ b/fnpdjango/utils/settings.py @@ -17,8 +17,8 @@ class LazyUGettextLazy(Promise): def __str__(self): if not self.real: - from django.utils.translation import ugettext_lazy - LazyUGettextLazy._ = staticmethod(ugettext_lazy) + from django.utils.translation import gettext_lazy + LazyUGettextLazy._ = staticmethod(gettext_lazy) LazyUGettextLazy.real = True return str(self._(self.text)) diff --git a/setup.py b/setup.py index 448d1f2..6f3d8ee 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ def whole_trees(package_dir, paths): setup( name='fnpdjango', - version='0.5', + version='0.6', author='Radek Czajka', author_email='radekczajka@nowoczesnapolska.org.pl', url='', @@ -32,7 +32,7 @@ setup( 'fnpdjango.management.commands': ['babel.cfg'], }, install_requires=[ - 'Django>=1.11,<4.0', + 'Django>=1.11,<4.1', ], extras_require={ 'textile': [ diff --git a/tests/urls.py b/tests/urls.py index bffe5bb..06536d8 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,9 +1,9 @@ -from django.conf.urls import url +from django.urls import path from django.contrib import admin from . import views urlpatterns = [ - url(r'^admin/', admin.site.urls), - url(r'^ip/$', views.ip), + path('admin/', admin.site.urls), + path('ip/', views.ip), ] diff --git a/tox.ini b/tox.ini index dc820d4..c21675b 100644 --- a/tox.ini +++ b/tox.ini @@ -3,26 +3,26 @@ # [tox] envlist=clear, - d111-py{36,37}, d20-py{36,37}, d21-py{36,37}, - d22-py{36,37,38}, - d30-py{36,37,38}, + d22-py{36,37,38,39}, + d30-py{36,37,38,39}, d31-py{36,37,38,39}, - d32-py{36,37,38,39}, + d32-py{36,37,38,39,310}, + d40-py{38,39,310} stats [testenv] commands=coverage run --source=fnpdjango --append --branch runtests.py deps= - django-pipeline==2.0.5 - d111: Django>=1.11,<2.0 + django-pipeline==2.0.8 d20: Django>=2.0,<2.1 d21: Django>=2.1,<2.2 d22: Django>=2.2,<3.0 d30: Django>=3.0,<3.1 d31: Django>=3.1,<3.2 d32: Django>=3.2,<4.0 + d40: Django>=4.0,<4.1 coverage extras= textile -- 2.20.1