8000 Adding support for Django 2.2 LTS to django-cms 4.0 by jonathan-s · Pull Request #6790 · django-cms/django-cms · GitHub
[go: up one dir, main page]

Skip to content

Adding support for Django 2.2 LTS to django-cms 4.0 #6790

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 26 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ language: python
python:
- 3.6
- 3.5
- 3.4
- 2.7

sudo: false

services:
- mysql
- postgresql

addons:
apt:
packages:
Expand All @@ -18,7 +21,6 @@ cache:
- node_modules
- $HOME/.pip/cache


env:
global:
# coveralls
Expand Down Expand Up @@ -47,8 +49,6 @@ matrix:
# DJANGO 1.11
- python: 2.7
env: DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.4
env: DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.5
env: DJANGO=1.11 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.6
Expand All @@ -59,8 +59,6 @@ matrix:
env: DJANGO=1.11 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'

# DJANGO 2.0
- python: 3.4
env: DJANGO=2.0 DATABASE_URL='sqlite://localhost/:memory:'
- python: 3.5
env: DJANGO=2.0 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.6
Expand All @@ -83,9 +81,30 @@ matrix:
env: DJANGO=2.1 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.6
env: TEST_DOCS=1 DJANGO=2.1 DATABASE_URL='sqlite://localhost/:memory:'

# DJANGO 2.2
- python: 3.5
env: DJANGO=2.2 DATABASE_URL='sqlite://localhost/:memory:'
dist: xenial
sudo: true
- python: 3.5
env: DJANGO=2.2 DATABASE_URL='mysql://root@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test'
- python: 3.6
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='emailuserapp.EmailUser'
- python: 3.6
env: DJANGO=2.2 DATABASE_URL='postgres://postgres@127.0.0.1/djangocms_test' AUTH_USER_MODEL='customuserapp.User'
- python: 3.6
env: TEST_DOCS=1 DJANGO=2.2 DATABASE_URL='sqlite://localhost/:memory:'
dist: xenial
sudo: true

allow_failures:
- python: 2.7
env: DJANGO=1.11 DATABASE_URL='sqlite://localhost/:memory:'
exclude:
- python: 2.7
- python: 3.4
- python: 3.5
- python: 3.6
fast_finish: true
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@

=== 3.6.0 (unreleased) ===

* Introduced Django 2.2 support.
* Removed the ``cms moderator`` command.
* Dropped Django < 1.11 support.
* Removed the translatable content get / set methods from ``CMSPlugin`` model.
Expand Down
9 changes: 7 additions & 2 deletions cms/management/commands/subcommands/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from collections import OrderedDict

from django.core.management.base import BaseCommand, CommandParser
from django.core.management.color import no_style
from django.core.management.color import no_style, color_style

from cms.utils.compat import DJANGO_2_0
from cms.utils.compat import DJANGO_2_0, DJANGO_2_2


def add_builtin_arguments(parser):
Expand Down Expand Up @@ -37,6 +37,9 @@ def add_builtin_arguments(parser):
help='Raise on CommandError exceptions')
parser.add_argument('--no-color', action='store_true', dest='no_color', default=False,
help="Don't colorize the command output.")
if DJANGO_2_2:
parser.add_argument('--force-color', action='store_true', dest='force_color', default=False,
help="Colorize the command output.")


class SubcommandsCommand(BaseCommand):
Expand Down Expand Up @@ -85,6 +88,8 @@ def handle(self, *args, **options):
if options.get('no_color'):
command.style = no_style()
command.stderr.style_func = None
if DJANGO_2_2 and options.get('force_color'):
command.style = color_style(force_color=True)
if options.get('stdout'):
command.stdout._out = options.get('stdout')
if options.get('stderr'):
Expand Down
1 change: 1 addition & 0 deletions cms/test_utils/util/context_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def __enter__(self):
def __exit__(self, type, value, traceback):
setattr(sys, 'std%s' % self.std, getattr(sys, '__std%s__' % self.std))


class StdoutOverride(StdOverride):
"""
This overrides Python's the standard output and redirects it to a StringIO
Expand Down
3 changes: 2 additions & 1 deletion cms/tests/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
import sys

from django.utils.six.moves import StringIO
from sphinx.application import Sphinx, SphinxWarning
from sphinx.errors import SphinxWarning
from sphinx.application import Sphinx

try:
import enchant
Expand Down
1 change: 1 addition & 0 deletions cms/utils/compat/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@
DJANGO_1_11 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.0')
DJANGO_2_0 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.1')
DJANGO_2_1 = LooseVersion(DJANGO_VERSION) < LooseVersion('2.2')
DJANGO_2_2 = LooseVersion(DJANGO_VERSION) < LooseVersion('3.0')
4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Framework :: Django',
'Framework :: Django :: 1.11',
'Framework :: Django :: 2.0',
'Framework :: Django :: 2.1',
'Framework :: Django :: 2.2',
]

INSTALL_REQUIREMENTS = [
'Django>=1.11,<2.2',
'Django>=1.11,<3.0',
'django-classy-tags>=0.7.2',
'django-formtools>=2.1',
'django-treebeard>=4.3',
Expand Down
2 changes: 2 additions & 0 deletions test_requirements/django-2.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements_base.txt
Django>=2.2,<3.0
2 changes: 1 addition & 1 deletion test_requirements/requirements_base.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ https://github.com/divio/djangocms-text-ckeditor/archive/support/4.0.x.zip
https://github.com/ojii/django-better-test/archive/8aa2407d097fe3789b74682f0e6bd7d15d449416.zip#egg=django-better-test
https://github.com/ojii/django-app-manage/archive/65da18ef234a4e985710c2c0ec760023695b40fe.zip#egg=django-app-manage
iptools
sphinx==1.4.5
sphinx==1.8.5
sphinxcontrib-spelling
pyflakes==1.1.0
pyenchant
Expand Down
0