Skip to content
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

Add support for django CMS 3.9 #389

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
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
Empty file added changes/.directory
Empty file.
1 change: 1 addition & 0 deletions changes/388.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add support for django CMS 3.9
12 changes: 11 additions & 1 deletion djangocms_installer/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,10 @@ def parse(args):

if args.cms_version in ("rc", "develop"):
requirements.extend(data.REQUIREMENTS["cms-master"])
elif LooseVersion(cms_version) >= LooseVersion("3.9"):
requirements.extend(data.REQUIREMENTS["cms-3.9"])
elif LooseVersion(cms_version) >= LooseVersion("3.8"):
requirements.extend(data.REQUIREMENTS["cms-3.8"])
elif LooseVersion(cms_version) >= LooseVersion("3.7"):
requirements.extend(data.REQUIREMENTS["cms-3.7"])

Expand All @@ -437,7 +441,11 @@ def parse(args):
if not args.no_plugins:
if args.cms_version in ("rc", "develop"):
requirements.extend(data.REQUIREMENTS["plugins-master"])
elif LooseVersion(cms_version) >= LooseVersion("3.7"):
elif LooseVersion(cms_version) >= LooseVersion("3.9"):
requirements.extend(data.REQUIREMENTS["plugins-3.9"])
elif LooseVersion(cms_version) >= LooseVersion("3.8"):
requirements.extend(data.REQUIREMENTS["plugins-3.8"])
elif LooseVersion(cms_version) >= LooseVersion("3.7") :
requirements.extend(data.REQUIREMENTS["plugins-3.7"])
requirements.extend(data.REQUIREMENTS["filer"])

Expand All @@ -457,6 +465,8 @@ def parse(args):
requirements.extend(data.REQUIREMENTS["django-3.0"])
elif django_version == "3.1":
requirements.extend(data.REQUIREMENTS["django-3.1"])
elif django_version == "3.2":
requirements.extend(data.REQUIREMENTS["django-3.2"])

requirements.extend(data.REQUIREMENTS["default"])

Expand Down
28 changes: 22 additions & 6 deletions djangocms_installer/config/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@
]

DJANGOCMS_DEVELOP = "https://github.com/yakky/django-cms/archive/develop.zip?{bust}".format(**bust)
DJANGOCMS_RC = "https://github.com/divio/django-cms/archive/release/3.7.x.zip?{bust}".format(**bust)
DJANGOCMS_RC = "https://github.com/divio/django-cms/archive/release/3.9.x.zip?{bust}".format(**bust)
DJANGOCMS_BETA = DJANGOCMS_RC
DJANGOCMS_37 = "django-cms>=3.7,<3.8"
DJANGOCMS_38 = "django-cms>=3.8,<3.9"
DJANGOCMS_39 = "django-cms>=3.9,<3.10"

DJANGOCMS_SUPPORTED = ("3.8", "3.7", "stable", "lts", "develop")
DJANGOCMS_STABLE = "3.8"
DJANGOCMS_SUPPORTED = ("3.9", "3.8", "3.7", "stable", "lts", "develop")
DJANGOCMS_STABLE = "3.9"
DJANGOCMS_LTS = "3.8"
DJANGOCMS_DEFAULT = DJANGOCMS_STABLE

Expand Down Expand Up @@ -53,13 +54,15 @@
VERSION_MATRIX = {
"3.7": ("2.2", "3.0"),
"3.8": ("2.2", "3.0", "3.1"),
DJANGOCMS_BETA: ("2.2", "3.1"),
DJANGOCMS_RC: ("2.2", "3.1"),
DJANGOCMS_DEVELOP: ("2.2", "3.1"),
"3.9": ("2.2", "3.0", "3.1", "3.2"),
DJANGOCMS_BETA: ("2.2", "3.1", "3.2"),
DJANGOCMS_RC: ("2.2", "3.1", "3.2"),
DJANGOCMS_DEVELOP: ("2.2", "3.1", "3.2"),
}
PACKAGE_MATRIX = {
"3.7": DJANGOCMS_37,
"3.8": DJANGOCMS_38,
"3.9": DJANGOCMS_39,
DJANGOCMS_RC: DJANGOCMS_RC,
DJANGOCMS_BETA: DJANGOCMS_BETA,
DJANGOCMS_DEVELOP: DJANGOCMS_DEVELOP,
Expand All @@ -70,8 +73,10 @@
"django-2.2": ["django-classy-tags>=0.9", "django-sekizai>=1.0", "django-mptt>0.9"],
"django-3.0": ["django-classy-tags>=0.9", "django-sekizai>=1.0", "django-mptt>0.9"],
"django-3.1": ["django-classy-tags>=2.0", "django-sekizai>=2.0", "django-mptt>0.9"],
"django-3.2": ["django-classy-tags>=2.0", "django-sekizai>=2.0", "django-mptt>0.9"],
"cms-3.7": ["djangocms-admin-style>=2.0,<3.0", "django-treebeard>=4.0,<5.0"],
"cms-3.8": ["djangocms-admin-style>=2.0,<3.0", "django-treebeard>=4.0,<5.0"],
"cms-3.9": ["djangocms-admin-style>=2.0,<3.0", "django-treebeard>=4.0,<5.0"],
"cms-master": [
"https://github.com/divio/djangocms-admin-style/archive/master.zip?{bust}".format(**bust),
"django-treebeard>=4.0,<5.0",
Expand All @@ -98,6 +103,17 @@
"djangocms-picture>=3.0,<4.0",
"djangocms-bootstrap4>=2.0,<3.0",
],
"plugins-3.9": [
"djangocms-text-ckeditor>=4.0,<5.0",
"djangocms-link>=3.0,<4.0",
"djangocms-icon>=2.0,<3.0",
"djangocms-style>=3.0,<4.0",
"djangocms-googlemap>=2.0,<3.0",
"djangocms-video>=3.0,<4.0",
"djangocms-file>=3.0,<4.0",
"djangocms-picture>=3.0,<4.0",
"djangocms-bootstrap4>=2.0,<3.0",
],
"plugins-master": [
"https://github.com/divio/djangocms-text-ckeditor/archive/master.zip?{bust}" "".format(**bust),
"https://github.com/divio/djangocms-file/archive/master.zip?{bust}".format(**bust),
Expand Down
20 changes: 10 additions & 10 deletions tests/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def test_default_config(self):

self.assertEqual(conf_data.project_name, "example_prj")

self.assertEqual(conf_data.cms_version, "3.8")
self.assertEqual(conf_data.cms_version, "3.9")
self.assertEqual(conf_data.django_version, dj_version)
self.assertEqual(conf_data.i18n, "yes")
self.assertEqual(conf_data.reversion, "yes")
Expand Down Expand Up @@ -364,11 +364,11 @@ def test_latest_version(self):
def test_supported_versions(self):
dj_version, dj_match = get_stable_django(latest=True)

self.assertEqual(supported_versions("stable", "stable"), (dj_version, "3.8"))
self.assertEqual(supported_versions("stable", "stable"), (dj_version, "3.9"))
self.assertEqual(supported_versions("stable", "3.1.10"), (dj_version, None))
self.assertEqual(supported_versions("stable", "beta"), (dj_version, data.DJANGOCMS_BETA))
self.assertEqual(supported_versions("stable", "develop"), (dj_version, data.DJANGOCMS_DEVELOP))
self.assertEqual(supported_versions("lts", "stable"), ("2.2", "3.8"))
self.assertEqual(supported_versions("lts", "stable"), ("2.2", "3.9"))
self.assertEqual(supported_versions("lts", "lts"), ("2.2", "3.8"))

with self.assertRaises(RuntimeError):
Expand Down Expand Up @@ -425,7 +425,7 @@ def test_requirements(self):
]
)

self.assertTrue(conf_data.requirements.find(config.data.DJANGOCMS_38) > -1)
self.assertTrue(conf_data.requirements.find(config.data.DJANGOCMS_39) > -1)
self.assertTrue(conf_data.requirements.find(dj_match) > -1)
self.assertFalse(conf_data.requirements.find("django-reversion") > -1)
self.assertTrue(conf_data.requirements.find("cmsplugin-filer") == -1)
Expand Down Expand Up @@ -709,7 +709,7 @@ def test_requirements(self):
]
)

self.assertTrue(conf_data.requirements.find(config.data.DJANGOCMS_38) > -1)
self.assertTrue(conf_data.requirements.find(config.data.DJANGOCMS_39) > -1)
self.assertTrue(conf_data.requirements.find(dj_match) > -1)

def test_bootstrap(self):
Expand Down Expand Up @@ -953,18 +953,18 @@ def test_parse_config_file(self, *args):
"config-03.ini",
None,
(
("cms_version", "3.8"),
("cms_version", "3.9"),
("i18n", "no"),
("django_version", dj_version),
),
),
("config-04.ini", None, (("cms_version", "3.8"), ("use_timezone", "no"))),
("config-05.ini", None, (("cms_version", "3.8"), ("timezone", "Europe/London"))),
("config-06.ini", None, (("cms_version", "3.8"), ("reversion", "no"))),
("config-04.ini", None, (("cms_version", "3.9"), ("use_timezone", "no"))),
("config-05.ini", None, (("cms_version", "3.9"), ("timezone", "Europe/London"))),
("config-06.ini", None, (("cms_version", "3.9"), ("reversion", "no"))),
(
"config-07.ini",
None,
(("cms_version", "3.8"), ("permissions", "no"), ("django_version", dj_lts_version)),
(("cms_version", "3.9"), ("permissions", "no"), ("django_version", dj_lts_version)),
),
(
"config-08.ini",
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-01.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = yes
permissions = yes
languages =
django-version = stable
cms-version = 3.8
cms-version = 3.9
parent-dir = .
bootstrap = no
templates = no
Expand Down