Skip to content

Commit e10df97

Browse files
authored
Merge pull request #399 from peopledoc/drop-django1.11-support
Drop django1.11 support
2 parents 3dc6844 + 6c48b8e commit e10df97

File tree

9 files changed

+22
-65
lines changed

9 files changed

+22
-65
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ ChangeLog
55
master (unreleased)
66
===================
77

8+
- Drop support for Django 1.11 (#398, #395).
89
- Drop support for Django REST Framework 3.8 (#382).
9-
- Ensure ``jsonfield`` compatibility check. Documentation is amended, and an ``ImportWarning`` is thrown as soon as you're using Django 1.11 (#395).
1010
- Fix Postgresql configuration in CircleCI regarding the authentication (#395).
1111
- Small cleanups of Python2-related code.
1212

README.rst

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,11 @@ Warnings
1414
========
1515

1616
* Python Compatibility : 3.5, 3.6, 3.7, 3.8
17-
* Django compatibility : Django 1.11, 2.2.
17+
* Django compatibility : Django 2.2.
1818
* Django REST Framework : Compatible from the version 3.9.x to 3.10.x
1919

20-
.. warning::
21-
22-
Versions of ``jsonfield`` beyond 3.x are incompatible with Django 1.11.
23-
If you're still using Django 1.11, you'll have to freeze it with ``jsonfield<3`` in your project.
24-
2520
See the `Deprecation timeline <http://django-formidable.readthedocs.io/en/latest/deprecations.html>`_ document for more information on deprecated versions.
2621

27-
2822
License
2923
=======
3024

demo/demo/urls.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
from distutils.version import StrictVersion as version
2-
import django
31
from django.conf.urls import include, url
42
from django.contrib import admin
3+
from django.urls import path
54

65
from demo.views import FormPreview, DemoValidateViewFromSchema
76

@@ -14,14 +13,5 @@
1413
url(r'^preview/(?P<pk>\d+)/', FormPreview.as_view()),
1514
url(r'^forms/',
1615
include(('demo.builder.urls', 'builder'), namespace='builder')),
16+
path(r'admin/', admin.site.urls, 'admin'),
1717
]
18-
19-
if version(django.get_version()) < version("2.0"):
20-
urlpatterns += [
21-
url(r'^admin/', include(admin.site.urls)),
22-
]
23-
else:
24-
from django.urls import path # noqa
25-
urlpatterns += [
26-
path(r'admin/', admin.site.urls, 'admin'),
27-
]

demo/tests/test_app.py

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import warnings
22

3-
from distutils.version import StrictVersion as version
4-
5-
import django
63
from django.apps import apps
74
from django.test import TestCase
85

@@ -15,13 +12,5 @@ def test_apps(self):
1512
warnings.simplefilter("always")
1613
# Trigger a warning.
1714
config.ready()
18-
# Verify some things
19-
if version(django.get_version()) < version("2.0"):
20-
# Django 1.11 mainly
21-
assert len(w) == 1, w
22-
test_warning = w[0]
23-
assert issubclass(test_warning.category, ImportWarning)
24-
assert "jsonfield" in str(test_warning.message)
25-
else:
26-
# No warning beyond Django 2.
27-
assert len(w) == 0, w
15+
# Verify there's no warning.
16+
assert len(w) == 0, w

demo/tests/test_end_point.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import copy
2-
from functools import reduce
2+
from itertools import chain
33
from unittest import skipIf
44

55
from django.conf import settings
@@ -1026,17 +1026,13 @@ def test_create_field(self):
10261026

10271027
def test_create_ordering(self):
10281028
# aggregate fields
1029-
def extend(l, elt):
1030-
l.extend(elt)
1031-
return l
1032-
1033-
fields = reduce(extend, [
1029+
fields_aggregated = list(chain(
10341030
self.fields_with_items, self.fields_without_items,
10351031
self.format_field_helptext, self.format_field_separator,
10361032
self.format_field_title
1037-
], [])
1033+
))
10381034
data = copy.deepcopy(self.data)
1039-
data['fields'] = fields
1035+
data['fields'] = fields_aggregated
10401036
serializer = FormidableSerializer(data=data)
10411037
self.assertTrue(serializer.is_valid())
10421038
form = serializer.save()

docs/source/deprecations.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,19 @@ Deprecation timeline
55
From 4.0.1 to x.y.z
66
===================
77

8+
Django versions
9+
---------------
10+
811
.. deprecated:: x.y.z
912

10-
Drop support for Django Rest Framework 3.8
13+
Drop support for Django 1.11
1114

12-
.. warning:: x.y.z
15+
Django REST Framework versions
16+
------------------------------
17+
18+
.. deprecated:: x.y.z
1319

14-
As of February 2020, several releases of the library ``jsonfield`` have broken the compatibility with Django 1.11.
15-
As a consequence, if you want to use Django Formidable with Django 1.11, you'll have to make sure that you're freezing your requirements to ``jsonfield<3``.
20+
Drop support for Django Rest Framework 3.8
1621

1722

1823
From 3.3.0 to 4.0.0

formidable/app.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@
55
66
* post-update and post-create callbacks
77
"""
8-
import warnings
9-
from distutils.version import StrictVersion as version
10-
11-
import django
128
from django.apps import AppConfig
139

1410

@@ -24,11 +20,3 @@ def ready(self):
2420
"""
2521
from .views import check_callback_configuration
2622
check_callback_configuration()
27-
# Incompatibility between some version of jsonfield + Django.
28-
if version(django.get_version()) < version("2.0"):
29-
warnings.warn(
30-
"If you're using Django<2.0, you must pin jsonfield version in"
31-
" your requirements to ``jsonfield<3``. See deprecation"
32-
" documentation for more details",
33-
ImportWarning
34-
)

formidable/forms/conditions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,5 +175,4 @@ def __repr__(self):
175175
return "<Condition {name}: Display {fields} if {tests}>".format(
176176
fields=self.fields_ids,
177177
tests=self.tests,
178-
action=self.action,
179178
name=self.name)

tox.ini

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
[tox]
22
envlist =
3-
django111-py{35,36,37,38}-drf{39,310}-{sqlite,pg}
43
django22-py{35,36,37,38}-drf{39,310}-{sqlite,pg}
54
spectest
65
flake8
@@ -14,17 +13,13 @@ usedevelop = True
1413
changedir = demo
1514
deps =
1615
; Django versions
17-
django111: Django>=1.11,<1.12
1816
django22: Django>=2.2,<2.3
1917
; DRF versions
2018
drf39: djangorestframework<3.10
2119
drf310: djangorestframework<3.11
2220
; When testing with postgresql
2321
pg: psycopg2-binary
2422

25-
; jsonfield compatibility with Django 1.11
26-
django111: jsonfield<3
27-
2823
; Requirements from demo project
2924
-rdemo/requirements-demo.pip
3025
commands =
@@ -77,9 +72,10 @@ commands =
7772

7873
; Not included in the test env run with `tox`
7974
[testenv:docs]
75+
basepython = python3
8076
deps =
81-
; doc building is using the latest LTS version to date (april 2018)
82-
Django>=1.11,<1.12
77+
; doc building is using the latest LTS version to date (june 2020)
78+
Django>=2.2,<2.3
8379
-rdocs/requirements.pip
8480
whitelist_externals = make
8581
changedir = docs

0 commit comments

Comments
 (0)