Skip to content

Commit

Permalink
Merge pull request #287 from nephila/feature/pre_release
Browse files Browse the repository at this point in the history
Final changes before release
  • Loading branch information
yakky authored Sep 15, 2016
2 parents 0e79773 + 06d8c59 commit 0851bee
Show file tree
Hide file tree
Showing 25 changed files with 113 additions and 89 deletions.
25 changes: 8 additions & 17 deletions djangocms_installer/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ def parse(args):

if args.cms_version in ('rc', 'develop'):
requirements.extend(data.REQUIREMENTS['cms-master'])
# elif cms_version >= 3.4:
# requirements.extend(data.REQUIREMENTS['cms-3.4'])
elif cms_version >= 3.4:
requirements.extend(data.REQUIREMENTS['cms-3.4'])
elif cms_version >= 3.3:
requirements.extend(data.REQUIREMENTS['cms-3.3'])
elif cms_version >= 3.2:
Expand All @@ -262,24 +262,15 @@ def parse(args):
if not args.no_db_driver:
requirements.append(args.db_driver)
if not args.no_plugins:
if args.filer:
if args.cms_version in ('rc', 'develop'):
requirements.extend(data.REQUIREMENTS['plugins-common-master'])
requirements.extend(data.REQUIREMENTS['filer'])
else:
requirements.extend(data.REQUIREMENTS['plugins-common'])
requirements.extend(data.REQUIREMENTS['filer'])
# else:
# requirements.extend(data.REQUIREMENTS['plugins-common'])
# requirements.extend(data.REQUIREMENTS['plugins-basic'])
if args.cms_version in ('rc', 'develop'):
requirements.extend(data.REQUIREMENTS['ckeditor-master'])
# elif cms_version >= 3.4:
# requirements.extend(data.REQUIREMENTS['ckeditor-3.4'])
requirements.extend(data.REQUIREMENTS['plugins-master'])
elif cms_version >= 3.4:
requirements.extend(data.REQUIREMENTS['plugins-3.4'])
elif cms_version >= 3.3:
requirements.extend(data.REQUIREMENTS['ckeditor-3.3'])
requirements.extend(data.REQUIREMENTS['plugins-3.3'])
else:
requirements.extend(data.REQUIREMENTS['ckeditor-3.2'])
requirements.extend(data.REQUIREMENTS['plugins-3.2'])
requirements.extend(data.REQUIREMENTS['filer'])

if args.aldryn: # pragma: no cover
requirements.extend(data.REQUIREMENTS['aldryn'])
Expand Down
80 changes: 47 additions & 33 deletions djangocms_installer/config/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,20 @@
'--permissions', '--bootstrap', '--templates',
'--starting-page']

DJANGOCMS_DEVELOP = 'https://github.com/divio/django-cms/archive/develop.zip?{bust}'.format(**bust)
DJANGOCMS_RC = 'https://github.com/divio/django-cms/archive/develop.zip?{bust}'.format(**bust)
DJANGOCMS_DEVELOP = 'https://github.com/divio/django-cms/archive/develop.zip?{bust}'.format(
**bust
)
DJANGOCMS_RC = 'https://github.com/divio/django-cms/archive/release/3.4.x.zip?{bust}'.format(
**bust
)
DJANGOCMS_BETA = 'https://github.com/divio/django-cms/archive/3.0.0.beta3.zip'

if sys.version_info >= (3, 5):
DJANGOCMS_SUPPORTED = ('3.2', '3.3', 'stable', 'rc', 'develop')
DJANGOCMS_STABLE = 3.3
DJANGOCMS_SUPPORTED = ('3.2', '3.3', '3.4', 'stable', 'develop')
DJANGOCMS_STABLE = 3.4
else:
DJANGOCMS_SUPPORTED = ('3.2', '3.3', 'stable', 'rc', 'develop')
DJANGOCMS_STABLE = 3.3
DJANGOCMS_SUPPORTED = ('3.2', '3.3', '3.4', 'stable', 'develop')
DJANGOCMS_STABLE = 3.4

DJANGO_DEVELOP = 'https://github.com/django/django/archive/master.zip?{bust}'.format(**bust)
DJANGO_BETA = 'https://github.com/django/django/archive/master.zip?{bust}'.format(**bust)
Expand All @@ -39,9 +43,9 @@

CMS_VERSION_MATRIX = {
'stable': DJANGOCMS_STABLE,
'rc': 3.4,
'beta': 3.4,
'develop': 3.4
'rc': 3.5,
'beta': 3.5,
'develop': 3.5
}
DJANGO_VERSION_MATRIX = {
'stable': DJANGO_STABLE,
Expand All @@ -52,7 +56,8 @@
VERSION_MATRIX = {
3.2: (1.8, 1.9),
3.3: (1.8, 1.9),
3.4: (1.8, 1.9),
3.4: (1.8, 1.9, 1.10),
3.5: (1.8, 1.9, 1.10),
}

REQUIREMENTS = {
Expand All @@ -61,6 +66,7 @@
'html5lib>=0.999999,<0.99999999',
'Pillow>=3.0',
'django-sekizai>=0.9',
'django-select2<5.0'
'six',
],
'django-1.8': [
Expand Down Expand Up @@ -89,40 +95,48 @@
'https://github.com/divio/djangocms-admin-style/archive/master.zip?{bust}'.format(**bust),
'django-treebeard>=4.0,<5.0',
],
'ckeditor-3.2': [
'djangocms-text-ckeditor>=2.8.1,<=2.9.3',
],
'ckeditor-3.3': [
'djangocms-text-ckeditor>=3.0,<3.2',
],
'ckeditor-3.4': [
'djangocms-text-ckeditor>=3.2',
],
'ckeditor-master': [
'https://github.com/divio/djangocms-text-ckeditor/archive/master.zip?{bust}'
''.format(**bust),
],
'plugins-common': [
'djangocms-link>=1.8,<1.9',
'djangocms-style>=1.7,<1.8',
'djangocms-googlemap>=0.4,<0.6',
'djangocms-snippet>=1.8,<2',
'plugins-3.2': [
'djangocms-text-ckeditor>=2.8.1,<3.0',
'djangocms-link>=1.8,<2.0',
'djangocms-style>=1.7,<2.0',
'djangocms-googlemap>=0.5,<1.0',
'djangocms-snippet>=1.9,<2.0',
'djangocms-video>=1.1,<2.0',
'djangocms-column>=1.6,<1.7',
],
'plugins-3.3': [
'djangocms-text-ckeditor>=3.2.1',
'djangocms-link>=1.8',
'djangocms-style>=1.7',
'djangocms-googlemap>=0.5',
'djangocms-snippet>=1.9',
'djangocms-video>=2.0',
'djangocms-column>=1.6',
],
'plugins-basic': [
'djangocms-file>=1.0,<1.1',
'djangocms-picture>=0.2.0,<0.3',
'djangocms-teaser>=0.2.0,<0.3',
'plugins-3.4': [
'djangocms-text-ckeditor>=3.2.1',
'djangocms-link>=1.8',
'djangocms-style>=1.7',
'djangocms-googlemap>=0.5',
'djangocms-snippet>=1.9',
'djangocms-video>=2.0',
'djangocms-column>=1.6',
],
'plugins-common-master': [
'plugins-master': [
'https://github.com/divio/djangocms-text-ckeditor/archive/master.zip?{bust}'
''.format(**bust),
'https://github.com/divio/djangocms-link/archive/master.zip?{bust}'.format(**bust),
'https://github.com/divio/djangocms-style/archive/master.zip?{bust}'.format(**bust),
'https://github.com/divio/djangocms-googlemap/archive/master.zip?{bust}'.format(**bust),
'https://github.com/divio/djangocms-snippet/archive/master.zip?{bust}'.format(**bust),
'https://github.com/divio/djangocms-video/archive/master.zip?{bust}'.format(**bust),
'https://github.com/divio/djangocms-column/archive/master.zip?{bust}'.format(**bust),
],
'plugins-basic': [
'djangocms-file>=1.0,<1.1',
'djangocms-picture>=0.2.0,<0.3',
'djangocms-teaser>=0.2.0,<0.3',
],
'plugins-basic-master': [
'https://github.com/divio/djangocms-file/archive/master.zip?{bust}'.format(**bust),
'https://github.com/divio/djangocms-picture/archive/master.zip?{bust}'.format(**bust),
Expand Down
53 changes: 36 additions & 17 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.3)
self.assertEqual(conf_data.cms_version, 3.4)
self.assertEqual(conf_data.django_version, 1.8)
self.assertEqual(conf_data.i18n, 'yes')
self.assertEqual(conf_data.reversion, 'yes')
Expand Down Expand Up @@ -58,7 +58,7 @@ def test_cli_config(self):

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

self.assertEqual(conf_data.cms_version, 3.3)
self.assertEqual(conf_data.cms_version, 3.4)
self.assertEqual(conf_data.django_version, 1.8)
self.assertEqual(conf_data.i18n, 'yes')
self.assertEqual(conf_data.reversion, 'no')
Expand Down Expand Up @@ -294,22 +294,22 @@ def test_latest_version(self):
self.assertEqual(less_than_version('3.0.1'), '3.1.1')

def test_supported_versions(self):
self.assertEqual(supported_versions('stable', 'stable'), (1.8, 3.3))
self.assertEqual(supported_versions('stable', 'stable'), (1.8, 3.4))
self.assertEqual(supported_versions('stable', '3.1.10'), (1.8, None))
self.assertEqual(supported_versions('stable', 'rc'), (1.8, 3.4))
self.assertEqual(supported_versions('stable', 'beta'), (1.8, 3.4))
self.assertEqual(supported_versions('stable', 'develop'), (1.8, 3.4))
self.assertEqual(supported_versions('stable', 'rc'), (1.8, 3.5))
self.assertEqual(supported_versions('stable', 'beta'), (1.8, 3.5))
self.assertEqual(supported_versions('stable', 'develop'), (1.8, 3.5))

with self.assertRaises(RuntimeError):
supported_versions('stable', '2.4'), (1.5, 2.4)
with self.assertRaises(RuntimeError):
supported_versions('1.5', 'stable'), (1.8, 3.1)

self.assertEqual(supported_versions('1.9', 'stable'), (1.9, 3.3))
self.assertEqual(supported_versions('1.8', 'stable'), (1.8, 3.3))
self.assertEqual(supported_versions('1.8.3', 'stable'), (None, 3.3))
self.assertEqual(supported_versions('beta', 'stable'), (1.9, 3.3))
self.assertEqual(supported_versions('develop', 'stable'), (1.9, 3.3))
self.assertEqual(supported_versions('1.9', 'stable'), (1.9, 3.4))
self.assertEqual(supported_versions('1.8', 'stable'), (1.8, 3.4))
self.assertEqual(supported_versions('1.8.3', 'stable'), (None, 3.4))
self.assertEqual(supported_versions('beta', 'stable'), (1.9, 3.4))
self.assertEqual(supported_versions('develop', 'stable'), (1.9, 3.4))

def test_requirements(self):
"""
Expand Down Expand Up @@ -345,10 +345,10 @@ def test_requirements(self):
'-p'+self.project_dir,
'example_prj'])

self.assertTrue(conf_data.requirements.find('django-cms<3.4') > -1)
self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
self.assertTrue(conf_data.requirements.find('django-reversion>=1.10,<1.11') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.0') > -1)
self.assertFalse(conf_data.requirements.find('django-reversion') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.2.1') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-admin-style>=1.2') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-column') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-file') == -1)
Expand Down Expand Up @@ -412,7 +412,7 @@ def test_requirements(self):
'-q',
'--db=postgres://user:pwd@host/dbname',
'--i18n=no',
'--cms-version=rc',
'--cms-version=develop',
'--django-version=stable',
'-f',
'--reversion=yes',
Expand All @@ -434,6 +434,25 @@ def test_requirements(self):

self.assertTrue(conf_data.requirements.find('pytz') > -1)

conf_data = config.parse([
'-q',
'--db=postgres://user:pwd@host/dbname',
'--i18n=no',
'--cms-version=3.4',
'--django-version=stable',
'-f',
'--reversion=yes',
'-z=yes',
'-p'+self.project_dir,
'example_prj'])

self.assertTrue(conf_data.requirements.find('django-cms<3.5') > -1)
self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
self.assertFalse(conf_data.requirements.find('django-reversion') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.2') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1)
self.assertTrue(conf_data.requirements.find('pytz') > -1)

conf_data = config.parse([
'-q',
'--db=postgres://user:pwd@host/dbname',
Expand All @@ -448,8 +467,8 @@ def test_requirements(self):

self.assertTrue(conf_data.requirements.find('django-cms<3.4') > -1)
self.assertTrue(conf_data.requirements.find('Django<1.9') > -1)
self.assertTrue(conf_data.requirements.find('django-reversion>=1.10,<1.11') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.0') > -1)
self.assertTrue(conf_data.requirements.find('django-reversion') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-text-ckeditor>=3.2') > -1)
self.assertTrue(conf_data.requirements.find('djangocms-admin-style') > -1)
self.assertTrue(conf_data.requirements.find('pytz') > -1)

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-08.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = .
bootstrap = no
templates = no
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-11.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = no
templates = no
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-12.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = no
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-13.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-14.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-15.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-16.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-17.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-18.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-19.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-20.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-21.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/configs/config-22.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ reversion = no
permissions = no
languages = en,ru
django-version = stable
cms-version = 3.3
cms-version = 3.4
parent-dir = /test/me
bootstrap = yes
templates = .
Expand Down
Loading

0 comments on commit 0851bee

Please sign in to comment.