]> git.ipfire.org Git - thirdparty/patchwork.git/commitdiff
Remove support for Django 1.8, 1.9, 1.10
authorStephen Finucane <stephen@that.guru>
Sun, 24 Jun 2018 19:55:50 +0000 (20:55 +0100)
committerDaniel Axtens <dja@axtens.net>
Sun, 26 Aug 2018 06:58:21 +0000 (16:58 +1000)
These are now all EOL and Debian Testing supports Django 1.11 (LTS). We
can and should drop them.

This change does not remove the many compat wrappers. These will be
removed separately (there are a lot of them).

This leaves 1.11 as the only supported version. This will be remedied
shortly with the inclusion of Django 2.0 support.

Signed-off-by: Stephen Finucane <stephen@that.guru>
Signed-off-by: Daniel Axtens <dja@axtens.net>
README.rst
patchwork/migrations/0021_django_1_10_fixes.py
patchwork/models.py
patchwork/settings/base.py
patchwork/settings/dev.py
patchwork/settings/production.example.py
requirements-dev.txt
requirements-prod.txt
tox.ini

index 94ac32c3b8b7d32572b2d3d29646e0dbe02ee9f0..062166e9e2d8b07b0c79654e0a34ba45ade06e6e 100644 (file)
@@ -43,9 +43,9 @@ Requirements
 
 - Python (2.7, 3.4 - 3.6)
 
-- Django (1.8 - 1.11)
+- Django (1.11 - 2.0)
 
-- Django REST Framework (3.4 - 3.8)
+- Django REST Framework (3.6 - 3.8)
 
 - Django Filters (1.0 - 1.1)
 
index 55aedbeca2edc369cd4e3cd6ce74648f980fb7a5..ff1d887589b1fd638a1137346cd62accdeb2019d 100644 (file)
@@ -18,10 +18,9 @@ class Migration(migrations.Migration):
         ),
     ]
 
-    if django.VERSION >= (1, 10):
-        operations += [
-            migrations.AlterModelOptions(
-                name='patch',
-                options={'base_manager_name': 'objects', 'verbose_name_plural': 'Patches'},
-            ),
-        ]
+    operations += [
+        migrations.AlterModelOptions(
+            name='patch',
+            options={'base_manager_name': 'objects', 'verbose_name_plural': 'Patches'},
+        ),
+    ]
index 6268f5b72e3c362315eec5e41fa7e9b509a0c218..71a07c944c191a100ffe44240d5f8fd28807eeb0 100644 (file)
@@ -26,7 +26,6 @@ import datetime
 import random
 import re
 
-import django
 from django.conf import settings
 from django.contrib.auth.models import User
 from django.core.exceptions import ValidationError
@@ -309,10 +308,6 @@ class PatchQuerySet(models.query.QuerySet):
 
 
 class PatchManager(models.Manager):
-    use_for_related_fields = True
-    # NOTE(stephenfin): This is necessary to silence a warning with Django >=
-    # 1.10. Remove when 1.10 is the minimum supported version.
-    silence_use_for_related_fields_deprecation = True
 
     def get_queryset(self):
         return PatchQuerySet(self.model, using=self.db)
@@ -595,8 +590,7 @@ class Patch(SeriesMixin, Submission):
 
     class Meta:
         verbose_name_plural = 'Patches'
-        if django.VERSION >= (1, 10):
-            base_manager_name = 'objects'
+        base_manager_name = 'objects'
 
 
 class Comment(EmailMixin, models.Model):
index 4b0d5513895aa5af0f266a5c0da362d493fad899..f96f3694b4f219091b769d95bec35205c074beb9 100644 (file)
@@ -4,14 +4,12 @@ Base settings for patchwork project.
 
 import os
 
-import django
-
 ROOT_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)),
                         os.pardir, os.pardir)
 
 #
 # Core settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings
+# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings
 #
 
 INSTALLED_APPS = [
@@ -26,7 +24,7 @@ INSTALLED_APPS = [
     'patchwork',
 ]
 
-_MIDDLEWARE_CLASSES = [
+MIDDLEWARE = [
     'django.middleware.common.CommonMiddleware',
     'django.contrib.sessions.middleware.SessionMiddleware',
     'django.contrib.auth.middleware.AuthenticationMiddleware',
@@ -37,11 +35,6 @@ _MIDDLEWARE_CLASSES = [
     'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
 ]
 
-if django.VERSION >= (1, 10):
-    MIDDLEWARE = _MIDDLEWARE_CLASSES
-else:
-    MIDDLEWARE_CLASSES = _MIDDLEWARE_CLASSES
-
 TIME_ZONE = 'Australia/Canberra'
 
 LANGUAGE_CODE = 'en-au'
@@ -83,7 +76,7 @@ SERVER_EMAIL = DEFAULT_FROM_EMAIL
 
 #
 # Auth settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#auth
+# https://docs.djangoproject.com/en/1.11/ref/settings/#auth
 #
 
 LOGIN_URL = 'auth_login'
@@ -93,7 +86,7 @@ LOGIN_REDIRECT_URL = 'user-profile'
 
 #
 # Sites settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#sites
+# https://docs.djangoproject.com/en/1.11/ref/settings/#sites
 #
 
 SITE_ID = 1
@@ -101,7 +94,7 @@ SITE_ID = 1
 
 #
 # Static files settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#static-files
+# https://docs.djangoproject.com/en/1.11/ref/settings/#static-files
 #
 
 STATIC_URL = '/static/'
index 0f79b61a390c4e4e760b00da7004dfd9836169a6..791488038dde1da6d0de4181dabd4c0c87b6892a 100644 (file)
@@ -9,13 +9,11 @@ Design based on:
 
 from __future__ import absolute_import
 
-import django
-
 from .base import *  # noqa
 
 #
 # Core settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings
+# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings
 #
 
 
@@ -47,11 +45,11 @@ EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'
 
 #
 # Auth settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#auth
+# https://docs.djangoproject.com/en/1.11/ref/settings/#auth
 #
 
 # Use a faster, though less secure, password hasher for faster tests
-# https://docs.djangoproject.com/es/1.9/topics/testing/overview/#password-hashing
+# https://docs.djangoproject.com/es/1.11/topics/testing/overview/#password-hashing
 PASSWORD_HASHERS = ['django.contrib.auth.hashers.MD5PasswordHasher']
 
 #
@@ -67,14 +65,9 @@ INSTALLED_APPS += [
 DEBUG_TOOLBAR_PATCH_SETTINGS = False
 
 # This should go first in the middleware classes
-if django.VERSION >= (1, 10):
-    MIDDLEWARE = [
-        'debug_toolbar.middleware.DebugToolbarMiddleware',
-    ] + MIDDLEWARE
-else:
-    MIDDLEWARE_CLASSES = [
-        'debug_toolbar.middleware.DebugToolbarMiddleware',
-    ] + MIDDLEWARE_CLASSES
+MIDDLEWARE = [
+    'debug_toolbar.middleware.DebugToolbarMiddleware',
+] + MIDDLEWARE
 
 INTERNAL_IPS = [
     '127.0.0.1', '::1',
index e97ba578b26e291c968a661aa1b261d640a16d10..0c7a88c03556f51cad9a3db39bfc6f535570dc55 100644 (file)
@@ -15,7 +15,7 @@ from .base import *  # noqa
 
 #
 # Core settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#core-settings
+# https://docs.djangoproject.com/en/1.11/ref/settings/#core-settings
 #
 
 # Security
@@ -51,7 +51,7 @@ ADMINS = (
 #
 # If you're using a postgres database, connecting over a local unix-domain
 # socket, then the following setting should work for you. Otherwise,
-# see https://docs.djangoproject.com/en/1.8/ref/settings/#databases
+# see https://docs.djangoproject.com/en/1.11/ref/settings/#databases
 
 DATABASES = {
     'default': {
@@ -66,8 +66,8 @@ DATABASES = {
 
 #
 # Static files settings
-# https://docs.djangoproject.com/en/1.8/ref/settings/#static-files
-# https://docs.djangoproject.com/en/1.8/ref/contrib/staticfiles/#manifeststaticfilesstorage
+# https://docs.djangoproject.com/en/1.11/ref/settings/#static-files
+# https://docs.djangoproject.com/en/1.11/ref/contrib/staticfiles/#manifeststaticfilesstorage
 #
 
 STATIC_ROOT = os.environ.get('STATIC_ROOT', '/srv/patchwork/htdocs/static')
index 1d58df71429095ae473677de6684a63f783ee94e..8bad8f07389b3638b9c99085374cb1d7d905e1ba 100644 (file)
@@ -1,4 +1,4 @@
-Django>=1.8,<2.0
+Django>=1.11,<2.0
 djangorestframework>=3.4,<3.9
 django-filter>=1.0,<1.2
 -r requirements-test.txt
index 59e2c1e6ce5380accc948e6e2ec71b58079ff80c..c30688cce1f967ed256aa5afc4f38dc91efca58d 100644 (file)
@@ -1,4 +1,4 @@
-Django>=1.8,<2.0
+Django>=1.11,<2.0
 djangorestframework>=3.4,<3.9
 django-filter>=1.0,<1.2
 psycopg2>=2.7,<2.8
diff --git a/tox.ini b/tox.ini
index 9aac824715238ecac1ec095f00960b7fe8ccd6aa..5f3d7e7255bbfb4a02c3c294f9dd3bf99b16a8b0 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -1,20 +1,14 @@
 [tox]
 minversion = 2.0
-envlist = pep8,docs,py{27,34,35}-django{18,19,110,111},py36-django111
+envlist = pep8,docs,py{27,34,35,36}-django111
 skipsdist = True
 
 [testenv]
 deps =
     -r{toxinidir}/requirements-test.txt
-    django18: django>=1.8,<1.9
-    django19: django>=1.9,<1.10
-    django110: django>=1.10,<1.11
     django111: django>=1.11,<2.0
-    django{18,19}: djangorestframework>=3.4,<3.7
-    django110: djangorestframework>=3.4,<3.9
     django111: djangorestframework>=3.6,<3.9
-    django18: django-filter>=1.0,<1.1
-    django{19,110,111}: django-filter>=1.0,<1.2
+    django111: django-filter>=1.0,<1.2
 setenv =
     DJANGO_SETTINGS_MODULE = patchwork.settings.dev
     PYTHONDONTWRITEBYTECODE = 1