From 94c2168af18029570c29571e503110a2c326732a Mon Sep 17 00:00:00 2001 From: Valentin Samir Date: Thu, 25 Aug 2016 13:02:09 +0200 Subject: [PATCH] Add Django 1.10 support --- .travis.yml | 6 ++++++ CHANGELOG.rst | 8 ++++++++ Makefile | 2 +- README.rst | 2 +- cas_server/tests/settings.py | 5 ++++- requirements.txt | 2 +- setup.py | 3 ++- tox.ini | 21 +++++++++++++++++++++ 8 files changed, 44 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 70393e6..4a69d3e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,16 +11,22 @@ matrix: env: TOX_ENV=py27-django18 - python: "2.7" env: TOX_ENV=py27-django19 + - python: "2.7" + env: TOX_ENV=py27-django110 - python: "3.4" env: TOX_ENV=py34-django17 - python: "3.4" env: TOX_ENV=py34-django18 - python: "3.4" env: TOX_ENV=py34-django19 + - python: "3.4" + env: TOX_ENV=py34-django110 - python: "3.5" env: TOX_ENV=py35-django18 - python: "3.5" env: TOX_ENV=py35-django19 + - python: "3.5" + env: TOX_ENV=py35-django110 - python: "2.7" env: TOX_ENV=coverage cache: diff --git a/CHANGELOG.rst b/CHANGELOG.rst index f571cda..047a318 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -6,6 +6,14 @@ All notable changes to this project will be documented in this file. .. contents:: Table of Contents :depth: 2 +Unreleased +========== + +Added +----- +* Add Django 1.10 support + + v0.7.1 - 2016-08-24 =================== diff --git a/Makefile b/Makefile index 08d013f..4912285 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ dist: test_venv/bin/python: virtualenv test_venv - test_venv/bin/pip install -U --requirement requirements-dev.txt 'Django<1.10' + test_venv/bin/pip install -U --requirement requirements-dev.txt 'Django<1.11' test_venv/cas/manage.py: test_venv mkdir -p test_venv/cas diff --git a/README.rst b/README.rst index d67a3e0..b7dd4c5 100644 --- a/README.rst +++ b/README.rst @@ -29,7 +29,7 @@ Dependencies ``django-cas-server`` depends on the following python packages: -* Django >= 1.7.1 < 1.10 +* Django >= 1.7.1 < 1.11 * requests >= 2.4 * requests_futures >= 0.9.5 * lxml >= 3.4 diff --git a/cas_server/tests/settings.py b/cas_server/tests/settings.py index e332688..617f364 100644 --- a/cas_server/tests/settings.py +++ b/cas_server/tests/settings.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/1.9/ref/settings/ """ import os +import django # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) @@ -40,7 +41,7 @@ INSTALLED_APPS = [ 'cas_server', ] -MIDDLEWARE_CLASSES = [ +MIDDLEWARE = [ 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', @@ -50,6 +51,8 @@ MIDDLEWARE_CLASSES = [ 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'django.middleware.locale.LocaleMiddleware', ] +if django.VERSION < (1, 10): + MIDDLEWARE_CLASSES = MIDDLEWARE TEMPLATES = [ { diff --git a/requirements.txt b/requirements.txt index b7518f5..011a59e 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -Django >= 1.7.1,<1.10 +Django >= 1.7.1,<1.11 setuptools>=5.5 requests>=2.4 requests_futures>=0.9.5 diff --git a/setup.py b/setup.py index 89c1a9c..0c0cfaa 100644 --- a/setup.py +++ b/setup.py @@ -34,6 +34,7 @@ if __name__ == '__main__': 'Framework :: Django :: 1.7', 'Framework :: Django :: 1.8', 'Framework :: Django :: 1.9', + 'Framework :: Django :: 1.10', 'Intended Audience :: Developers', 'Intended Audience :: System Administrators', 'License :: OSI Approved :: GNU General Public License v3 (GPLv3)', @@ -58,7 +59,7 @@ if __name__ == '__main__': }, keywords=['django', 'cas', 'cas3', 'server', 'sso', 'single sign-on', 'authentication', 'auth'], install_requires=[ - 'Django >= 1.7,<1.10', 'requests >= 2.4', 'requests_futures >= 0.9.5', + 'Django >= 1.7,<1.11', 'requests >= 2.4', 'requests_futures >= 0.9.5', 'lxml >= 3.4', 'six >= 1' ], url="https://github.com/nitmir/django-cas-server", diff --git a/tox.ini b/tox.ini index 4ab3f52..bf049cd 100644 --- a/tox.ini +++ b/tox.ini @@ -5,11 +5,14 @@ envlist= py27-django17, py27-django18, py27-django19, + py27-django110, py34-django17, py34-django18, py34-django19, + py34-django110, py35-django18, py35-django19, + py35-django110, [flake8] max-line-length=100 @@ -53,6 +56,12 @@ deps = Django>=1.9,<1.10 {[base]deps} +[testenv:py27-django110] +basepython=python2.7 +deps = + Django>=1.10,<1.11 + {[base]deps} + [testenv:py34-django17] basepython=python3.4 deps = @@ -71,6 +80,12 @@ deps = Django>=1.9,<1.10 {[base]deps} +[testenv:py34-django110] +basepython=python3.4 +deps = + Django>=1.10,<1.11 + {[base]deps} + [testenv:py35-django18] basepython=python3.5 deps = @@ -83,6 +98,12 @@ deps = Django>=1.9,<1.10 {[base]deps} +[testenv:py35-django110] +basepython=python3.5 +deps = + Django>=1.10,<1.11 + {[base]deps} + [testenv:flake8] basepython=python