Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky committed Nov 30, 2014
2 parents dd6a4c8 + 0ec8b09 commit 01c74e7
Show file tree
Hide file tree
Showing 26 changed files with 527 additions and 173 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
language: python

python:
- 3.4
- 3.3
- 2.7
- 2.6
Expand All @@ -12,7 +13,6 @@ install:
- pip install -r requirements.txt
- pip install coveralls coverage
- "if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi"
- "if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then pip install -U https://github.com/pypa/pip/archive/develop.zip; fi"

# command to run tests, e.g. python setup.py test
script: USE_SHM="yes" coverage run setup.py test
Expand All @@ -22,3 +22,4 @@ after_success: coveralls
matrix:
allow_failures:
- python: 3.3
- python: 3.4
9 changes: 6 additions & 3 deletions AUTHORS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,12 @@ Development Lead
Contributors
------------

* Carlo Ascani <[email protected]>
* Aaron Boman
* Henning Sprang <[email protected]>
* Nick Moore <[email protected]>
* Carlo Ascani <[email protected]>
* Claudio Luck
* Enkel Mitrushi
* growlf
* Henning Sprang <[email protected]>
* Jonas Obrist <[email protected]>
* Nick Moore <[email protected]>
* pipsqueaker
4 changes: 2 additions & 2 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ Ready to contribute? Here's how to set up `djangocms-installer` for local develo
$ mkvirtualenv djangocms-installer
$ cd djangocms-installer/
$ python setup.py develop
$ pip install requirements_dev.txt
$ pip install -r requirements_dev.txt

the last one is to get the requirements including testing and development
tools installed.
Expand All @@ -82,7 +82,7 @@ Now you can make your changes locally.
tests, including testing other Python versions with tox::

$ flake8 djangocms-installer tests
$ python setup.py test
$ python setup.py test
$ tox

6. Commit your changes and push your branch to GitHub::
Expand Down
11 changes: 10 additions & 1 deletion HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,20 @@
History
-------

0.6.0 (2014-11-30)
++++++++++++++++++

* Add support for installing aldryn-boilerplate
* Force installing all packages (-I) when creating the project virtualenv
* Fix multiplatform support bugs
* Update supported Django / django CMS versions
* Add preliminary support for django CMS develop (3.1)

0.5.4 (2014-08-14)
++++++++++++++++++

* Fix reversion version selection for older Django versions
* Berter project name validation
* Better project name validation

0.5.3 (2014-07-23)
++++++++++++++++++
Expand Down
20 changes: 20 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,25 @@ Documentation

See http://djangocms-installer.readthedocs.org

Supported versions
------------------

The current supported version matrix is the following:

+----------------+-------------+-------------+-------------+-------------+
| | Django 1.4 | Django 1.5 | Django 1.6 | Django 1.7 |
+----------------+-------------+-------------+-------------+-------------+
| django CMS 2.4 | Supported | Supported | Unsupported | Unsupported |
+----------------+-------------+-------------+-------------+-------------+
| django CMS 3.0 | Supported | Supported | Supported | WiP |
+----------------+-------------+-------------+-------------+-------------+

Any beta and develop version of Django and django CMS, by its very nature,
it's not supported, while it still may work.

``djangocms-installer`` tries to support beta versions of django CMS when they
will be considered sufficiently stable by the upstream project.

Caveats
-------

Expand All @@ -64,6 +83,7 @@ Libraries you would want to check:
* zlib (for PNG support in ``Pillow``)
* postgresql (for ``psycopg``)
* libmysqlclient (for ``Mysql-Python``)
* python-dev (for compilation and linking)

For additional information, check http://djangocms-installer.readthedocs.org/en/latest/libraries.html

Expand Down
2 changes: 1 addition & 1 deletion djangocms_installer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
# -*- coding: utf-8 -*-
__author__ = 'Iacopo Spalletti'
__email__ = '[email protected]'
__version__ = '0.5.4'
__version__ = '0.6.b1'
1 change: 1 addition & 0 deletions djangocms_installer/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import sys

from .main import execute

if __name__ == '__main__':
Expand Down
59 changes: 48 additions & 11 deletions djangocms_installer/config/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import os.path
import six
import sys
import warnings

from .. import compat, utils
from . import data
from djangocms_installer.config.internal import DbAction, validate_project
from djangocms_installer.utils import less_than_version, supported_versions
from .internal import DbAction, validate_project
from .. import compat, utils
from ..utils import less_than_version, supported_versions


def parse(args):
Expand Down Expand Up @@ -38,10 +39,10 @@ def parse(args):
help='Languages to enable. Option can be provided multiple times, or as a comma separated list. '
'Only language codes supported by Django can be used here')
parser.add_argument('--django-version', dest='django_version', action='store',
choices=('1.4', '1.5', '1.6', 'stable'),
choices=data.DJANGO_SUPPORTED,
default='stable', help='Django version')
parser.add_argument('--cms-version', '-v', dest='cms_version', action='store',
choices=('2.4', '3.0', 'stable', 'develop'),
choices=data.DJANGOCMS_SUPPORTED,
default='stable', help='django CMS version')
parser.add_argument('--parent-dir', '-p', dest='project_directory',
required=True, default='',
Expand All @@ -68,6 +69,8 @@ def parse(args):

# Advanced options. These have a predefined default and are not managed
# by config wizard.
parser.add_argument('--aldryn', '-a', dest='aldryn', action='store_true',
default=False, help="Use Aldryn-boilerplate as project template")
parser.add_argument('--no-input', '-q', dest='noinput', action='store_true',
default=False, help="Don't run the configuration wizard, just use the provided values")
parser.add_argument('--filer', '-f', dest='filer', action='store_true',
Expand All @@ -83,7 +86,7 @@ def parse(args):
parser.add_argument('--no-user', '-u', dest='no_user', action='store_true',
default=False, help="Don't create the admin user")
parser.add_argument('--template', dest='template', action='store',
default=None, help="The path or URL to load the template from")
default=None, help="The path or URL to load the django project template from.")
parser.add_argument('--extra-settings', dest='extra_settings', action='store',
default=None, help="The path to an file that contains extra settings.")

Expand Down Expand Up @@ -158,67 +161,101 @@ def parse(args):
# Convert version to numeric format for easier checking
django_version, cms_version = supported_versions(args.django_version,
args.cms_version)
if django_version is None:
sys.stderr.write("Please provide a Django supported version: %s. Only Major.Minor version selector is accepted\n" % ", ".join(data.DJANGO_SUPPORTED))
sys.exit(6)
if django_version is None:
sys.stderr.write("Please provide a django CMS supported version: %s. Only Major.Minor version selector is accepted\n" % ", ".join(data.DJANGOCMS_SUPPORTED))
sys.exit(6)

if not getattr(args, 'requirements_file'):
requirements = []

# Django cms version check
if args.cms_version == 'develop':
requirements.append(data.DJANGOCMS_DEVELOP)
warnings.warn(data.VERSION_WARNING % ('develop', 'django CMS'))
elif args.cms_version == 'rc':
requirements.append(data.DJANGOCMS_RC)
elif args.cms_version == 'beta':
requirements.append(data.DJANGOCMS_BETA)
warnings.warn(data.VERSION_WARNING % ('beta', 'django CMS'))
else:
if args.cms_version == 'stable':
requirements.append("django-cms<%s" % less_than_version(data.DJANGOCMS_LATEST))
else:
requirements.append("django-cms<%s" % less_than_version(args.cms_version))
if cms_version >= 3:

if cms_version == 3:
requirements.append(data.DJANGOCMS_3_REQUIREMENTS)
elif cms_version >= 3:
requirements.append(data.DJANGOCMS_3_1_REQUIREMENTS)
else:
requirements.append(data.DJANGOCMS_2_REQUIREMENTS)

if not args.no_db_driver:
requirements.append(args.db_driver)
if args.filer:
if cms_version >= 3:
requirements.append(data.FILER_REQUIREMENTS_CMS3)
if django_version < 1.7:
requirements.append(data.PLUGINS_REQUIREMENTS_BASIC)
requirements.append(data.FILER_REQUIREMENTS_CMS3)
else:
requirements.append(data.PLUGINS_REQUIREMENTS_BASIC_DJANGO_17)
requirements.append(data.FILER_REQUIREMENTS_CMS3)
else:
requirements.append(data.FILER_REQUIREMENTS_CMS2)
elif cms_version >= 3:
requirements.append(data.PLUGIN_REQUIREMENTS)
if django_version < 1.7:
requirements.append(data.PLUGINS_REQUIREMENTS_BASIC)
requirements.append(data.PLUGINS_REQUIREMENTS_NON_FILER)
else:
requirements.append(data.PLUGINS_REQUIREMENTS_BASIC_DJANGO_17)
requirements.append(data.PLUGINS_REQUIREMENTS_NON_FILER_DJANGO_17)
if args.aldryn:
requirements.append(data.ALDRYN_REQUIREMENTS)

# Django version check
if args.django_version == 'develop':
requirements.append(data.DJANGO_DEVELOP)
warnings.warn(data.VERSION_WARNING % ('develop', 'Django'))
elif args.django_version == 'beta':
requirements.append(data.DJANGO_BETA)
warnings.warn(data.VERSION_WARNING % ('beta', 'Django'))
else:
if args.django_version == 'stable':
if cms_version < 3:
requirements.append("Django<%s" % less_than_version(data.DJANGO_LATEST))
else:
requirements.append("Django<%s" % less_than_version(data.DJANGO_LATEST_CMS_3))
else:
requirements.append("Django<%s" % less_than_version(args.django_version))
requirements.append("Django<%s" % less_than_version(str(django_version)))

# Timezone support
if args.use_timezone:
requirements.append('pytz')

# Requirements dependendent on django version
if django_version < 1.7:
requirements.append(data.DJANGO_16_REQUIREMENTS)

# Reversion package version depends on django version
if args.reversion:
if django_version < 1.5:
requirements.append(data.DJANGO_14_REVERSION)
elif django_version == 1.5:
requirements.append(data.DJANGO_15_REVERSION)
else:
elif django_version == 1.6:
requirements.append(data.DJANGO_16_REVERSION)
else:
requirements.append(data.DJANGO_17_REVERSION)

requirements.extend([data.DEFAULT_REQUIREMENTS])

setattr(args, "requirements", "\n".join(requirements).strip())
if cms_version < 3 and args.aldryn:
sys.stderr.write("Aldryn Boilerplate is not compatible with django CMS versions < 3\n")
sys.exit(5)

# Convenient shortcuts
setattr(args, "cms_version", cms_version)
Expand Down
53 changes: 46 additions & 7 deletions djangocms_installer/config/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,45 +8,80 @@
DJANGOCMS_RC = 'https://github.com/divio/django-cms/archive/3.0c2.zip'
DJANGOCMS_BETA = 'https://github.com/divio/django-cms/archive/3.0.0.beta3.zip'
DJANGOCMS_LATEST = '3.0'
DJANGOCMS_SUPPORTED = ('2.4', '3.0', 'stable', 'develop')

DJANGO_DEVELOP = 'https://github.com/django/django/archive/master.zip'
# this is not true, but it's the most recent version
# compatible with all the CMS versions
DJANGO_LATEST = '1.5'
DJANGO_LATEST_CMS_3 = '1.6'
DJANGO_SUPPORTED = ('1.4', '1.5', '1.6', '1.7', 'stable')


DEFAULT_REQUIREMENTS = """
django-classy-tags>=0.3.4.1
south>=0.7.2
html5lib
Pillow>=2
django-sekizai>=0.7
six
"""

DJANGO_16_REQUIREMENTS = """
south>=0.7.2
"""

DJANGOCMS_2_REQUIREMENTS = """
django-mptt>=0.5.1,<0.5.3
"""

DJANGOCMS_3_REQUIREMENTS = """
django-mptt>=0.6
djangocms-text-ckeditor>=2.1.4
"""
DJANGOCMS_3_1_REQUIREMENTS = """
django-treebeard==2.0
"""

PLUGINS_REQUIREMENTS_BASIC = """
djangocms-admin-style
djangocms-column
djangocms-style
djangocms-flash
djangocms-googlemap
djangocms-inherit
djangocms-style
djangocms-text-ckeditor>=2.3.0
"""

PLUGIN_REQUIREMENTS = """
PLUGINS_REQUIREMENTS_NON_FILER = """
djangocms-file
djangocms-link
djangocms-picture
djangocms-teaser
djangocms-video
"""

PLUGINS_REQUIREMENTS_BASIC_DJANGO_17 = """
https://github.com/divio/djangocms-admin-style/archive/master.zip
https://github.com/divio/djangocms-column/archive/master.zip
https://github.com/divio/djangocms-flash/archive/master.zip
https://github.com/divio/djangocms-googlemap/archive/master.zip
https://github.com/divio/djangocms-inherit/archive/master.zip
https://github.com/divio/djangocms-style/archive/master.zip
https://github.com/divio/djangocms-text-ckeditor/archive/master.zip
"""

PLUGINS_REQUIREMENTS_NON_FILER_DJANGO_17 = """
https://github.com/divio/djangocms-file/archive/master.zip
https://github.com/divio/djangocms-link/archive/master.zip
https://github.com/divio/djangocms-picture/archive/master.zip
https://github.com/divio/djangocms-teaser/archive/master.zip
https://github.com/divio/djangocms-video/archive/master.zip
"""


DJANGO_17_REVERSION = "django-reversion>=1.8.2"
ALDRYN_REQUIREMENTS = """
django-compressor
"""
DJANGO_16_REVERSION = "django-reversion>=1.8"
DJANGO_15_REVERSION = "django-reversion>=1.7,<1.8"
DJANGO_14_REVERSION = "django-reversion<1.7"
Expand All @@ -64,17 +99,17 @@

PLUGIN_LIST_TEXT = """
djangocms_installer will install and configure the following plugins:
* djangocms-text-ckeditor (Text plugin)
* djangocms_column (Column plugin)
* djangocms-file (File plugin)
* djangocms-flash (Flash plugin)
* djangocms-googlemap (GoogleMap plugin)
* djangocms-inherit (Inherit plugin)
* djangocms-link (Link plugin)
* djangocms-picture (Picture plugin)
* djangocms_style (Style plugin)
* djangocms-teaser (Teaser plugin)
* djangocms-text-ckeditor (Text plugin)
* djangocms-video (Video plugin)
* djangocms_style (Style plugin)
* djangocms_column (Style plugin)
It will optionally install cmsplugin-filer plugins (if requested during
configuration):
Expand Down Expand Up @@ -106,3 +141,7 @@
BASE_DIR = """
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
"""

ALDRYN_BOILERPLATE = 'https://github.com/aldryn/aldryn-boilerplate/archive/master.zip'

VERSION_WARNING = '%s version of %s is not supported and it may not work as expected'
Loading

0 comments on commit 01c74e7

Please sign in to comment.