Skip to content
This repository has been archived by the owner on Oct 29, 2019. It is now read-only.

Commit

Permalink
Merge eab5354 into 9ff98ce
Browse files Browse the repository at this point in the history
  • Loading branch information
vthaian committed Nov 28, 2018
2 parents 9ff98ce + eab5354 commit a34b3bd
Show file tree
Hide file tree
Showing 18 changed files with 106 additions and 86 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,4 @@ docs/_build/
# PyBuilder
target/
.idea
local.sqlite
41 changes: 34 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,44 @@
language: python

# Use container based infrastructure
sudo: false

env:
- TOX_ENV=pep8
- TOX_ENV=py27-dj11-cms34
- TOX_ENV=py27-dj10-cms34
- TOX_ENV=py27-dj19-cms33
- TOX_ENV=py27-dj18-cms32
matrix:
include:
- python: 3.5
env: TOX_ENV='pep8'
# Django 1.11
- python: 3.6
env: DJANGO='dj111' CMS='cms36'
- python: 3.5
env: DJANGO='dj111' CMS='cms36'
- python: 3.5
env: DJANGO='dj111' CMS='cms35'
- python: 2.7
env: DJANGO='dj111' CMS='cms35'
- python: 3.5
env: DJANGO='dj111' CMS='cms34'
- python: 2.7
env: DJANGO='dj111' CMS='cms34'
# Django 2.0
- python: 3.6
env: DJANGO='dj20' CMS='cms36'
- python: 3.5
env: DJANGO='dj20' CMS='cms36'
- python: 3.4
env: DJANGO='dj20' CMS='cms36'
# Django 2.1
- python: 3.6
env: DJANGO='dj21' CMS='cms36'
- python: 3.5
env: DJANGO='dj21' CMS='cms36'

install:
- pip install tox coveralls
- "if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then export PY_VER=py27; fi"
- "if [[ $TRAVIS_PYTHON_VERSION == '3.4' ]]; then export PY_VER=py34; fi"
- "if [[ $TRAVIS_PYTHON_VERSION == '3.5' ]]; then export PY_VER=py35; fi"
- "if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then export PY_VER=py36; fi"
- "if [[ ${DJANGO}z != 'z' ]]; then export TOX_ENV=$PY_VER-$DJANGO-$CMS; fi"

script:
- tox -e $TOX_ENV
Expand Down
33 changes: 20 additions & 13 deletions HISTORY.rst
Original file line number Diff line number Diff line change
@@ -1,37 +1,44 @@
0.8.0 (unreleased)
------------------

* Added Django 1.11, 2.0 and 2.1 support
* Removed support for Django < 1.11


0.7.5 (2017-02-28)
------------------

* add Django 1.10 support
* Added Django 1.10 support


0.7.4 (2016-01-27)
------------------

* add Django 1.9 support
* Added Django 1.9 support


0.7.3 (2015-10-29)
------------------

* add Django 1.5 support
* Added Django 1.5 support


0.7.2 (2015-08-19)
------------------

* add Django 1.8 support
* Added Django 1.8 support


0.7.1 (2015-06-18)
------------------

* add Django 1.7 support
* Added Django 1.7 support


0.6 (2015-02-02)
----------------

* new folder conventions:
* New folder conventions:
``templates_for_boilerplates/<my-boilerplate>`` is now ``boilerplates/<my-boilerplate>/templates``

``static_for_boilerplates/<my-boilerplate>`` is now ``boilerplates/<my-boilerplate>/static``
Expand All @@ -40,20 +47,20 @@
0.5 (2014-12-28)
----------------

* fix template discovery for apps without a “templates” folder
* more tests
* Fixed template discovery for apps without a “templates” folder
* More tests


0.4 (2014-12-28)
----------------

* more tests
* document how to add support to existing packages
* add djangocms-helper test dependencies
* add tests for loading templates from different boilerplates
* More tests
* Document how to add support to existing packages
* Added djangocms-helper test dependencies
* Added tests for loading templates from different boilerplates


0.3 (2014-12-16)
----------------

Initial Release
* Initial Release
3 changes: 2 additions & 1 deletion aldryn_boilerplates/apps.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from __future__ import absolute_import, unicode_literals

from django.apps import AppConfig


Expand Down
3 changes: 2 additions & 1 deletion aldryn_boilerplates/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# -*- coding: utf-8 -*-
from django.conf import settings
from appconf import AppConf

from django.conf import settings


class AldrynBoilerplatesAppConf(AppConf):
pass
Expand Down
1 change: 0 additions & 1 deletion aldryn_boilerplates/context_processors.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,5 @@
def boilerplate(request):
"""
Adds boilerplate-related context variables to the context.
"""
return {'ALDRYN_BOILERPLATE_NAME': settings.ALDRYN_BOILERPLATE_NAME}
9 changes: 3 additions & 6 deletions aldryn_boilerplates/staticfile_finders.py
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# -*- coding: utf-8 -*-
import django.contrib.staticfiles.finders
import django.contrib.staticfiles.storage
from .conf import settings
from django.core.files.storage import FileSystemStorage as BaseStorage

try:
from collections import OrderedDict
except ImportError:
from ordereddict import OrderedDict
from collections import OrderedDict

from django.core.files.storage import FileSystemStorage as BaseStorage
from .conf import settings


def _get_boilerplate_source_dir(boilerplate_name):
Expand Down
32 changes: 16 additions & 16 deletions aldryn_boilerplates/template_loaders.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
# -*- coding: utf-8 -*-
from .conf import settings
import os
import sys
from importlib import import_module
from distutils.version import LooseVersion

from django import __version__
import django.template.loaders.app_directories
from django.core.exceptions import ImproperlyConfigured
try:
# Python>=2.7
from importlib import import_module
except ImportError:
# Python==2.6
import warnings
with warnings.catch_warnings():
warnings.simplefilter("ignore", DeprecationWarning)
from django.utils.importlib import import_module
from django.core.exceptions import ImproperlyConfigured, SuspiciousFileOperation
from django.template import Origin
from django.template.loader import get_template
from django.utils import six
from django.utils._os import safe_join

import os
import sys
from .conf import settings

DJANGO_VERSION = __version__
DJANGO_20 = LooseVersion(DJANGO_VERSION) >= LooseVersion('2.0')

_cache = None

Expand Down Expand Up @@ -71,11 +70,12 @@ class AppDirectoriesLoader(django.template.loaders.app_directories.Loader):
def get_template_sources(self, template_name, template_dirs=None):
return super(AppDirectoriesLoader, self).get_template_sources(
template_name,
_get_boilerplate_app_template_dirs(template_dirs),
)

def load_template_source(self, template_name, template_dirs=None):
return super(AppDirectoriesLoader, self).load_template_source(
return super(AppDirectoriesLoader, self).get_template(
template_name,
_get_boilerplate_app_template_dirs(template_dirs),
)

def get_dirs(self, template_dirs=None):
return _get_boilerplate_app_template_dirs(template_dirs)
11 changes: 6 additions & 5 deletions aldryn_boilerplates/tests.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, absolute_import
from django.test import TestCase
from django.test.utils import override_settings
from django.contrib.staticfiles import finders
from django.template.loader import render_to_string
from __future__ import absolute_import, unicode_literals

import sys

from django.contrib.staticfiles import finders
from django.template.loader import render_to_string
from django.test import TestCase
from django.test.utils import override_settings

# Can't get dynamic settings to work, since they seem to be loaded all over the place
# def safe_reload(mod):
Expand Down
1 change: 1 addition & 0 deletions test_requirements/base.txt → requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
coverage
djangocms-admin-style
django-appconf
djangocms-helper
3 changes: 1 addition & 2 deletions runtests.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
import sys
import os

import sys

cmd = 'coverage run `which djangocms-helper` aldryn_boilerplates test --cms --extra-settings=test_settings'

Expand Down
21 changes: 10 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,19 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup, find_packages

import re
import sys

from setuptools import find_packages, setup

module_file = open("aldryn_boilerplates/__init__.py").read()
metadata = dict(re.findall("__([a-z]+)__\s*=\s*'([^']+)'", module_file))
py26 = (2, 7, 0) > sys.version_info >= (2, 6, 0)

REQUIREMENTS = [
'Django>=1.8,<2.0',
'Django>=1.11',
'YURL>=0.13',
'django-appconf',
]

if py26:
REQUIREMENTS += [
'ordereddict',
]


setup(
name='aldryn-boilerplates',
Expand All @@ -40,9 +35,13 @@
'Intended Audience :: Developers',
'License :: OSI Approved :: BSD License',
'Operating System :: OS Independent',
'Programming Language :: Python',
'Topic :: Internet :: WWW/HTTP',
'Programming Language :: Python :: 2.6',
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
)
3 changes: 0 additions & 3 deletions test_requirements/django_1.10.txt

This file was deleted.

3 changes: 0 additions & 3 deletions test_requirements/django_1.11.txt

This file was deleted.

3 changes: 0 additions & 3 deletions test_requirements/django_1.8.txt

This file was deleted.

3 changes: 0 additions & 3 deletions test_requirements/django_1.9.txt

This file was deleted.

2 changes: 1 addition & 1 deletion test_settings.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals


HELPER_SETTINGS = {
'INSTALLED_APPS': [
# We don't need main app in installed apps because djangocms-helper
Expand All @@ -25,5 +24,6 @@ def run():

runner.cms('aldryn_boilerplates', extra_args=['--boilerplate'])


if __name__ == "__main__":
run()
19 changes: 9 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
[tox]
envlist =
pep8
py27-dj11-cms34
py27-dj10-cms34
py27-dj19-cms33
py27-dj18-cms32
py{27,34,35,36}-dj111-cms{34,35,36}
py{34,35,36}-dj20-cms{36}
py{35,36}-dj21-cms{36}

[testenv]
commands =
Expand All @@ -13,13 +12,13 @@ commands =
coverage run test_settings.py
-coverage report
deps =
dj18: -rtest_requirements/django_1.8.txt
dj19: -rtest_requirements/django_1.9.txt
dj10: -rtest_requirements/django_1.10.txt
dj11: -rtest_requirements/django_1.11.txt
cms32: django-cms>=3.2,<3.3
cms33: django-cms>=3.3,<3.4
-r{toxinidir}/requirements.txt
dj111: Django>=1.11,<2.0
dj20: Django>=2.0,<2.1
dj21: Django>=2.1,<2.2
cms34: django-cms>=3.4,<3.5
cms35: django-cms>=3.5,<3.6
cms36: https://github.com/divio/django-cms/archive/release/3.6.x.zip

[testenv:pep8]
commands = pep8 --repeat --show-source --max-line-length=99 --exclude=env,.tox,dist,migrations aldryn_boilerplates setup.py
Expand Down

0 comments on commit a34b3bd

Please sign in to comment.