diff --git a/changes/.directory b/changes/.directory new file mode 100644 index 0000000..e69de29 diff --git a/changes/388.feature b/changes/388.feature new file mode 100644 index 0000000..64820c0 --- /dev/null +++ b/changes/388.feature @@ -0,0 +1 @@ +Add support for django CMS 3.9 diff --git a/djangocms_installer/config/__init__.py b/djangocms_installer/config/__init__.py index e080532..0fda3f3 100644 --- a/djangocms_installer/config/__init__.py +++ b/djangocms_installer/config/__init__.py @@ -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"]) @@ -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"]) @@ -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"]) diff --git a/djangocms_installer/config/data.py b/djangocms_installer/config/data.py index 7a1af16..3a64e3a 100644 --- a/djangocms_installer/config/data.py +++ b/djangocms_installer/config/data.py @@ -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 @@ -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, @@ -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", @@ -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), diff --git a/tests/config.py b/tests/config.py index 6a15294..fce4863 100644 --- a/tests/config.py +++ b/tests/config.py @@ -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") @@ -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): @@ -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) @@ -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): @@ -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", diff --git a/tests/fixtures/configs/config-01.ini b/tests/fixtures/configs/config-01.ini index 6cc3f71..87bf4b9 100644 --- a/tests/fixtures/configs/config-01.ini +++ b/tests/fixtures/configs/config-01.ini @@ -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