8

Add Django 1.9/1.10 and Wagtail 1.9 to tests and requirements

This commit is contained in:
Tomasz Knapik
2017-07-11 12:52:02 +01:00
committed by Michael van Tellingen
parent 821ee5863e
commit bc91d64770
7 changed files with 52 additions and 19 deletions

View File

@@ -4,6 +4,23 @@ language: python
matrix: matrix:
include: include:
# Django 1.9, Wagtail 1.9
- python: 2.7
env: TOXENV=py27-django19-wagtail19
- python: 3.5
env: TOXENV=py35-django19-wagtail19
- python: 3.6
env: TOXENV=py36-django19-wagtail19
# Django 1.10, Wagtail 1.10
- python: 2.7
env: TOXENV=py27-django110-wagtail110
- python: 3.5
env: TOXENV=py35-django110-wagtail110
- python: 3.6
env: TOXENV=py36-django110-wagtail110
# Django 1.11, Wagtail 1.10
- python: 2.7 - python: 2.7
env: TOXENV=py27-django111-wagtail110 env: TOXENV=py27-django111-wagtail110
- python: 3.5 - python: 3.5

View File

@@ -35,7 +35,7 @@ in the admin interface.
Instructions Instructions
------------ ------------
Wagtail Personalisation requires Wagtail 1.10 and Django 1.11. Wagtail Personalisation requires Wagtail 1.9 or 1.10 and Django 1.9, 1.10 or 1.11.
To install the package with pip:: To install the package with pip::
@@ -70,6 +70,6 @@ Sandbox
To experiment with the package you can use the sandbox provided in To experiment with the package you can use the sandbox provided in
this repository. To install this you will need to create and activate a this repository. To install this you will need to create and activate a
virtualenv and then run ``make sandbox``. This will start a fresh Wagtail virtualenv and then run ``make sandbox``. This will start a fresh Wagtail
install, with the personalisation module enabled, on http://localhost:8000 install, with the personalisation module enabled, on http://localhost:8000
and http://localhost:8000/cms/. The superuser credentials are and http://localhost:8000/cms/. The superuser credentials are
``superuser@example.com`` with the password ``testing``. ``superuser@example.com`` with the password ``testing``.

View File

@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
install_requires = [ install_requires = [
'wagtail>=1.10,<1.11', 'wagtail>=1.9,<1.11',
'user-agents>=1.0.1', 'user-agents>=1.0.1',
'wagtailfontawesome>=1.0.6', 'wagtailfontawesome>=1.0.6',
] ]
@@ -61,6 +61,8 @@ setup(
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.6',
'Framework :: Django', 'Framework :: Django',
'Framework :: Django :: 1.9',
'Framework :: Django :: 1.10',
'Framework :: Django :: 1.11', 'Framework :: Django :: 1.11',
'Topic :: Internet :: WWW/HTTP :: Site Management', 'Topic :: Internet :: WWW/HTTP :: Site Management',
], ],

View File

@@ -1,6 +1,10 @@
from __future__ import absolute_import, unicode_literals from __future__ import absolute_import, unicode_literals
import os import os
from pkg_resources import parse_version as V
import django
DATABASES = { DATABASES = {
'default': { 'default': {
@@ -52,17 +56,24 @@ TEMPLATES = [
}, },
] ]
MIDDLEWARE = ( def get_middleware_settings():
'django.middleware.common.CommonMiddleware', return (
'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.SessionAuthenticationMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware', 'django.contrib.auth.middleware.SessionAuthenticationMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'wagtail.wagtailcore.middleware.SiteMiddleware', 'wagtail.wagtailcore.middleware.SiteMiddleware',
) )
# Django 1.10 started to use "MIDDLEWARE" instead of "MIDDLEWARE_CLASSES".
if V(django.get_version()) < V('1.10'):
MIDDLEWARE_CLASSES = get_middleware_settings()
else:
MIDDLEWARE = get_middleware_settings()
INSTALLED_APPS = ( INSTALLED_APPS = (
'wagtail_personalisation', 'wagtail_personalisation',

View File

@@ -14,7 +14,7 @@ class Migration(migrations.Migration):
initial = True initial = True
dependencies = [ dependencies = [
('wagtailcore', '0033_remove_golive_expiry_help_text'), ('wagtailcore', '0001_initial'),
] ]
operations = [ operations = [

View File

@@ -10,7 +10,7 @@ import wagtail.wagtailcore.fields
class Migration(migrations.Migration): class Migration(migrations.Migration):
dependencies = [ dependencies = [
('wagtailcore', '0033_remove_golive_expiry_help_text'), ('wagtailcore', '0001_initial'),
('pages', '0001_initial'), ('pages', '0001_initial'),
] ]

View File

@@ -1,11 +1,14 @@
[tox] [tox]
envlist = py{27,35,36}-django{111}-wagtail{110},lint envlist = py{27,35,36}-django{19,110,111}-wagtail{19,110},lint
[testenv] [testenv]
commands = coverage run --parallel -m pytest {posargs} commands = coverage run --parallel -m pytest {posargs}
extras = test extras = test
deps = deps =
django19: django>=1.9,<1.10
django110: django>=1.10<1.11
django111: django>=1.11,<1.12 django111: django>=1.11,<1.12
wagtail19: wagtail>=1.9,<1.10
wagtail110: wagtail>=1.10,<1.11 wagtail110: wagtail>=1.10,<1.11
[testenv:coverage-report] [testenv:coverage-report]
@@ -21,6 +24,6 @@ commands =
[testenv:lint] [testenv:lint]
basepython = python3.5 basepython = python3.5
deps = flake8 deps = flake8
commands = commands =
flake8 src tests setup.py flake8 src tests setup.py
isort -q --recursive --diff src/ tests/ isort -q --recursive --diff src/ tests/