8000 Adding support for Django 2.2 LTS (#6655) (#6691) · django-cms/django-cms@93fb1a3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 93fb1a3

Browse files
FinalAngeljonathan-s
authored andcommitted
Adding support for Django 2.2 LTS (#6655) (#6691)
* Fix typo * Fixed issue with force_color * Removed unused import * Added docs to index.rst * Fixed travis jobs * Changes after review * Fixed django version in setup * Update django-2.2.txt
1 parent d7b3f58 commit 93fb1a3

File tree

9 files changed

+45
-6
lines changed

9 files changed

+45
-6
lines changed

.travis.yml

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ python:
88

99
sudo: false
1010

11+
services:
12+
- mysql
13+
- postgresql
14+
1115
addons:
1216
apt:
1317
packages:
@@ -18,7 +22,6 @@ cache:
1822
- node_modules
1923
- $HOME/.pip/cache
2024

21-
2225
env:
2326
global:
2427
# coveralls
@@ -83,6 +86,28 @@ matrix:
8386
env: DJANGO=2.1 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
8487
- python: 3.6
8588
env: TEST_DOCS=1 DJANGO=2.1 DATABASE_URL='sqlite://localhost/:memory:'
89+
90+
# DJANGO 2.2
91+
- python: 3.5
92+
env: DJANGO=2.2 DATABASE_URL='sqlite://localhost/:memory:'
93+
dist: xenial
94+
sudo: true
95+
- python: 3.5
96+
env: DJANGO=2.2 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
97+
- python: 3.6
98+
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
99+
- python: 3.6
100+
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
101+
- python: 3.6
102+
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
103+
- python: 3.6
104+
env: TEST_DOCS=1 DJANGO=2.2 DATABASE_URL='sqlite://localhost/:memory:'
105+
dist: xenial
106+
sudo: true
107+
108+
allow_failures:
109+
- python: 2.7
110+
env: DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
86111
exclude:
87112
- python: 2.7
88113
- python: 3.4

CHANGELOG.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1+
12
=== 3.6.0 (unreleased) ===
23

4+
* Introduced Django 2.2 support.
35
* Removed the ``cms moderator`` command.
46
* Dropped Django < 1.11 support.
57
* Removed the translatable content get / set methods from ``CMSPlugin`` model.

cms/management/commands/subcommands/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@
55
from collections import OrderedDict
66

77
from django.core.management.base import BaseCommand, CommandParser
8-
from django.core.management.color import no_style
8+
from django.core.management.color import no_style, color_style
99

10-
from cms.utils.compat import DJANGO_2_0
10+
from cms.utils.compat import DJANGO_2_0, DJANGO_2_2
1111

1212

1313
def add_builtin_arguments(parser):
@@ -37,6 +37,9 @@ def add_builtin_arguments(parser):
3737
help='Raise on CommandError exceptions')
3838
parser.add_argument('--no-color', action='store_true', dest='no_color', default=False,
3939
help="Don't colorize the command output.")
40+
if DJANGO_2_2:
41+
parser.add_argument('--force-color', action='store_true', dest='force_color', default=False,
42+
help="Colorize the command output.")
4043

4144

4245
class SubcommandsCommand(BaseCommand):
@@ -85,6 +88,8 @@ def handle(self, *args, **options):
8588
if options.get('no_color'):
8689
command.style = no_style()
8790
command.stderr.style_func = None
91+
if DJANGO_2_2 and options.get('force_color'):
92+
command.style = color_style(force_color=True)
8893
if options.get('stdout'):
8994
command.stdout._out = options.get('stdout')
9095
if options.get('stderr'):

cms/test_utils/util/context_managers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __enter__(self):
2626
def __exit__(self, type, value, traceback):
2727
setattr(sys, 'std%s' % self.std, getattr(sys, '__std%s__' % self.std))
2828

29+
2930
class StdoutOverride(StdOverride):
3031
"""
3132
This overrides Python's the standard output and redirects it to a StringIO

cms/tests/test_docs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
import sys
88

99
from django.utils.six.moves import StringIO
10-
from sphinx.application import Sphinx, SphinxWarning
10+
from sphinx.errors import SphinxWarning
11+
from sphinx.application import Sphinx
1112

1213
try:
1314
import enchant

cms/utils/compat/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@
1111
DJANGO_1_11 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.0')
1212
DJANGO_2_0 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.1')
1313
DJANGO_2_1 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.2')
14+
DJANGO_2_2 = LooseVersion(DJANGO_VERSION) < LooseVersion('3.0')

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,16 @@
1818
'Programming Language :: Python :: 3.4',
1919
'Programming Language :: Python :: 3.5',
2020
'Programming Language :: Python :: 3.6',
21+
'Programming Language :: Python :: 3.7',
2122
'Framework :: Django',
2223
'Framework :: Django :: 1.11',
2324
'Framework :: Django :: 2.0',
2425
'Framework :: Django :: 2.1',
26+
'Framework :: Django :: 2.2',
2527
]
2628

2729
INSTALL_REQUIREMENTS = [
28-
'Django>=1.11,<2.2',
30+
'Django>=1.11,<3.0',
2931
'django-classy-tags>=0.7.2',
3032
'django-formtools>=2.1',
3133
'django-treebeard>=4.3',

test_requirements/django-2.2.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
-r requirements_base.txt
2+
Django>=2.2,<3.0

test_requirements/requirements_base.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ https://github.com/divio/djangocms-text-ckeditor/archive/support/4.0.x.zip
1212
https://github.com/ojii/django-better-test/archive/8aa2407d097fe3789b74682f0e6bd7d15d449416.zip#egg=django-better-test
1313
https://github.com/ojii/django-app-manage/archive/65da18ef234a4e985710c2c0ec760023695b40fe.zip#egg=django-app-manage
1414
iptools
15-
sphinx==1.4.5
15+
sphinx==1.8.5
1616
sphinxcontrib-spelling
1717
pyflakes==1.1.0
1818
pyenchant

0 commit comments

Comments
 (0)
0