From 1cdbd49143ebb2344bdc13c2dd4436da7364947d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20C=2E=20Barrionuevo=20da=20Luz?= Date: Tue, 16 Aug 2016 11:59:04 -0300 Subject: [PATCH 1/8] add django 1.10 to travis-ci test matrix test with django 1.10 --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 1e4b574f..71c2b334 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,7 @@ env: - DJANGO='django>=1.7,<1.8' - DJANGO='django>=1.8,<1.9' - DJANGO='django>=1.9,<1.10' + - DJANGO='django>=1.10,<1.11' python: - 3.5 - 3.4 @@ -23,10 +24,14 @@ matrix: env: DJANGO='django>=1.8,<1.9' - python: 3.2 env: DJANGO='django>=1.9,<1.10' + - python: 3.2 + env: DJANGO='django>=1.10,<1.11' - python: 3.3 env: DJANGO='django>=1.8,<1.9' - python: 3.3 env: DJANGO='django>=1.9,<1.10' + - python: 3.3 + env: DJANGO='django>=1.10,<1.11' - python: 3.4 env: DJANGO='django>=1.4,<1.5' - python: 3.5 @@ -34,4 +39,4 @@ matrix: - python: 3.5 env: DJANGO='django>=1.6,<1.7' - python: 3.5 - env: DJANGO='django>=1.7,<1.8' \ No newline at end of file + env: DJANGO='django>=1.7,<1.8' From dd7185231769ab567c1d6ac056864fd1c29340c0 Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrioneuvo da Luz" Date: Mon, 29 Aug 2016 12:40:13 -0300 Subject: [PATCH 2/8] fix compatibility of test suit with django 1.10 --- tests/compat.py | 20 ++++++++++++++++-- tests/settings.py | 44 +++++++++++++++++++++++++++++++--------- tests/urls.py | 20 ++++++++---------- tests/urls_namespaced.py | 10 ++++----- tox.ini | 3 ++- 5 files changed, 68 insertions(+), 29 deletions(-) diff --git a/tests/compat.py b/tests/compat.py index ed5417df..a44e4d9e 100644 --- a/tests/compat.py +++ b/tests/compat.py @@ -9,6 +9,22 @@ from django.utils import simplejson as json try: - from django.conf.urls import patterns, url, include + from django.conf.urls import url, include except ImportError: - from django.conf.urls.defaults import patterns, url, include + from django.conf.urls.defaults import url, include + + +def patterns_compat(urlpatterns): + try: + from django.conf.urls import patterns + except ImportError: + try: + from django.conf.urls.defaults import patterns + except ImportError: + patterns = False + if patterns: + return patterns( + '', *urlpatterns + ) + else: + return urlpatterns diff --git a/tests/settings.py b/tests/settings.py index 90da66f4..dc3743fc 100644 --- a/tests/settings.py +++ b/tests/settings.py @@ -29,16 +29,6 @@ 'django.middleware.clickjacking.XFrameOptionsMiddleware', ] -TEMPLATE_CONTEXT_PROCESSORS = [ - 'django.contrib.auth.context_processors.auth', - 'django.core.context_processors.i18n', - 'django.core.context_processors.media', - 'django.core.context_processors.static', - 'django.core.context_processors.tz', - 'django.core.context_processors.request', - 'django.contrib.messages.context_processors.messages' -] - STATICFILES_FINDERS = ( 'django.contrib.staticfiles.finders.FileSystemFinder', 'django.contrib.staticfiles.finders.AppDirectoriesFinder', @@ -60,6 +50,40 @@ ) import django + +if django.VERSION >= (1, 10): + TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [], + 'APP_DIRS': True, + 'OPTIONS': { + 'context_processors': [ + 'django.template.context_processors.debug', + 'django.template.context_processors.request', + 'django.contrib.auth.context_processors.auth', + 'django.template.context_processors.i18n', + 'django.template.context_processors.media', + 'django.template.context_processors.static', + 'django.template.context_processors.tz', + 'django.contrib.messages.context_processors.messages', + ], + }, + }, + ] + AUTH_PASSWORD_VALIDATORS = [] + +else: + TEMPLATE_CONTEXT_PROCESSORS = [ + 'django.contrib.auth.context_processors.auth', + 'django.core.context_processors.i18n', + 'django.core.context_processors.media', + 'django.core.context_processors.static', + 'django.core.context_processors.tz', + 'django.core.context_processors.request', + 'django.contrib.messages.context_processors.messages' + ] + if django.VERSION < (1, 4): TEMPLATE_CONTEXT_PROCESSORS.remove('django.core.context_processors.tz') MIDDLEWARE_CLASSES.remove( diff --git a/tests/urls.py b/tests/urls.py index 8a4b1291..734fe996 100644 --- a/tests/urls.py +++ b/tests/urls.py @@ -1,11 +1,10 @@ from __future__ import absolute_import +from django.contrib.auth.views import login from . import views -from .compat import patterns, include, url +from .compat import include, url, patterns_compat - -urlpatterns = patterns( - '', +urlpatterns = [ # LoginRequiredMixin tests url(r'^login_required/$', views.LoginRequiredView.as_view()), @@ -110,12 +109,11 @@ # RecentLoginRequiredMixin tests url(r'^recent_login/$', views.RecentLoginRequiredView.as_view()), url(r'^outdated_login/$', views.RecentLoginRequiredView.as_view()), -) +] +urlpatterns += [ + url(r'^accounts/login/$', login, {'template_name': 'blank.html'}), + url(r'^auth/login/$', login, {'template_name': 'blank.html'}), +] -urlpatterns += patterns( - 'django.contrib.auth.views', - # login page, required by some tests - url(r'^accounts/login/$', 'login', {'template_name': 'blank.html'}), - url(r'^auth/login/$', 'login', {'template_name': 'blank.html'}), -) +urlpatterns = patterns_compat(urlpatterns) diff --git a/tests/urls_namespaced.py b/tests/urls_namespaced.py index 20920be5..177e0151 100644 --- a/tests/urls_namespaced.py +++ b/tests/urls_namespaced.py @@ -1,13 +1,13 @@ from __future__ import absolute_import from . import views -from .compat import patterns, url +from .compat import url, patterns_compat - -urlpatterns = patterns( - '', +urlpatterns = [ # CanonicalSlugDetailMixin namespace tests url(r'^article/(?P\d+)-(?P[\w-]+)/$', views.CanonicalSlugDetailView.as_view(), name="namespaced_article"), -) +] + +urlpatterns = patterns_compat(urlpatterns) diff --git a/tox.ini b/tox.ini index 41b3356e..4c9968c4 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,32,33,34}-django{15,16,17,18},py{27,34,35}-django{18,19} +envlist = py{27,32,33,34}-django{15,16,17,18},py{27,34,35}-django{18,19,110} install_command = pip install {opts} {packages} [testenv] @@ -27,3 +27,4 @@ deps = django17: Django>=1.7,<1.8 django18: Django>=1.8,<1.9 django19: Django>=1.9,<1.10 + django110: Django>=1.10,<1.11 From d13fe10e8c0223de3261cc4d1e50dc38dd15a408 Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrioneuvo da Luz" Date: Mon, 29 Aug 2016 13:07:25 -0300 Subject: [PATCH 3/8] use tox on travis-ci --- .travis.yml | 89 ++++++++++++++++++++++++++++++----------------------- tox.ini | 5 +-- 2 files changed, 53 insertions(+), 41 deletions(-) diff --git a/.travis.yml b/.travis.yml index 71c2b334..03d50306 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,42 +1,53 @@ language: python services: sqlite -env: - - DJANGO='django>=1.5,<1.6' - - DJANGO='django>=1.6,<1.7' - - DJANGO='django>=1.7,<1.8' - - DJANGO='django>=1.8,<1.9' - - DJANGO='django>=1.9,<1.10' - - DJANGO='django>=1.10,<1.11' -python: - - 3.5 - - 3.4 - - 3.3 - - 3.2 - - 2.7 -install: - - pip install $DJANGO - - python setup.py install - - pip install factory_boy mock pytest-django -script: py.test tests/ +cache: pip matrix: - exclude: - - python: 3.2 - env: DJANGO='django>=1.8,<1.9' - - python: 3.2 - env: DJANGO='django>=1.9,<1.10' - - python: 3.2 - env: DJANGO='django>=1.10,<1.11' - - python: 3.3 - env: DJANGO='django>=1.8,<1.9' - - python: 3.3 - env: DJANGO='django>=1.9,<1.10' - - python: 3.3 - env: DJANGO='django>=1.10,<1.11' - - python: 3.4 - env: DJANGO='django>=1.4,<1.5' - - python: 3.5 - env: DJANGO='django>=1.5,<1.6' - - python: 3.5 - env: DJANGO='django>=1.6,<1.7' - - python: 3.5 - env: DJANGO='django>=1.7,<1.8' + include: + - python: 2.7 + env: TOX_ENV=py27-django15 + - python: 2.7 + env: TOX_ENV=py27-django16 + - python: 2.7 + env: TOX_ENV=py27-django17 + - python: 2.7 + env: TOX_ENV=py27-django18 + - python: 3.2 + env: TOX_ENV=py32-django15 + - python: 3.2 + env: TOX_ENV=py32-django16 + - python: 3.2 + env: TOX_ENV=py32-django17 + - python: 3.2 + env: TOX_ENV=py32-django18 + - python: 3.3 + env: TOX_ENV=py33-django15 + - python: 3.3 + env: TOX_ENV=py33-django16 + - python: 3.3 + env: TOX_ENV=py33-django17 + - python: 3.3 + env: TOX_ENV=py33-django18 + - python: 3.4 + env: TOX_ENV=py34-django15 + - python: 3.4 + env: TOX_ENV=py34-django16 + - 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 + + +script: tox -e $TOX_ENV + +install: + - pip install tox diff --git a/tox.ini b/tox.ini index 4c9968c4..722d76a6 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,32,33,34}-django{15,16,17,18},py{27,34,35}-django{18,19,110} +envlist = py{27,32,33,34}-django{15,16,17,18},py{34,35}-django{18,19,110} install_command = pip install {opts} {packages} [testenv] @@ -17,9 +17,10 @@ commands = deps = mock - pytest-django factory_boy py32: coverage==3.7 + py{27,32,33}: pytest-django==2.9.1 + py{34,35}: pytest-django>2.9.1 py{27,33,34,35}: coverage==4.1 argparse django15: Django>=1.5,<1.6 From e0dc4b65a23318252abe311c63ddf37d9f213670 Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrioneuvo da Luz" Date: Mon, 29 Aug 2016 13:20:09 -0300 Subject: [PATCH 4/8] fix travis-ci pip cache and update travis-ci pip --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 03d50306..b7c3167e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,10 @@ language: python services: sqlite -cache: pip +cache: + directories: + - $HOME/.cache/pip +before_cache: + - rm -f $HOME/.cache/pip/log/debug.log matrix: include: - python: 2.7 @@ -50,4 +54,5 @@ matrix: script: tox -e $TOX_ENV install: + - pip install pip setuptools wheel -U - pip install tox From 8f9765b95c6ac9fc555a65a796ea3a7eda92f51f Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrioneuvo da Luz" Date: Mon, 29 Aug 2016 13:53:19 -0300 Subject: [PATCH 5/8] fix python3.4 build on travis-ci --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 722d76a6..13639c61 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,8 @@ deps = mock factory_boy py32: coverage==3.7 - py{27,32,33}: pytest-django==2.9.1 - py{34,35}: pytest-django>2.9.1 + py{27,32,33,34}: pytest-django==2.9.1 + py{35}: pytest-django>2.9.1 py{27,33,34,35}: coverage==4.1 argparse django15: Django>=1.5,<1.6 From 7d9b3aceb1e5ae58d30c372feec19a6afc6addc0 Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrioneuvo da Luz" Date: Mon, 29 Aug 2016 14:45:31 -0300 Subject: [PATCH 6/8] add django 1.10 trove classifier on setup.py update docs add myself to CONTRIBUTORS.txt --- CONTRIBUTORS.txt | 1 + docs/contributing.rst | 4 ++-- setup.py | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTORS.txt b/CONTRIBUTORS.txt index 9a8a7126..5a1a7dd8 100644 --- a/CONTRIBUTORS.txt +++ b/CONTRIBUTORS.txt @@ -29,6 +29,7 @@ Direct Contributors * Lacey Williams Henschel * Gregory Shikhman * Mike Bryant +* Fabio C. Barrionuevo da Luz Other Contributors ================== diff --git a/docs/contributing.rst b/docs/contributing.rst index 7b35fa80..3d8d4a91 100644 --- a/docs/contributing.rst +++ b/docs/contributing.rst @@ -42,7 +42,7 @@ Tests ----- All code changes should come with test changes. We use -`py.test `_ instead of Python's +`py.test `_ instead of Python's ``unittest``. This seems to only be really important when marking tests for skipping. @@ -50,4 +50,4 @@ We try to keep the project at 100% test coverage but know this isn't something we can achieve forever. So long as your tests cover your contribution 80% or better, we're happy to try and bump up that last bit, or just accept the code. -We currently test Braces against late (usually latest) versions of Python 2.6, 2.7, 3.2, 3.3, and 3.4. We also test against the latest released version of Django from 1.5 to 1.8. +We currently test Braces against late (usually latest) versions of Python 2.7, 3.2, 3.3, 3.4 and 3.5. We also test against the latest released version of Django from 1.5 to 1.10. diff --git a/setup.py b/setup.py index 9a49f6b9..c6ed0b47 100644 --- a/setup.py +++ b/setup.py @@ -32,6 +32,7 @@ "Framework :: Django :: 1.6", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", - "Framework :: Django :: 1.9" + "Framework :: Django :: 1.9", + "Framework :: Django :: 1.10" ], ) From 9998ede387268bcfe60a8dc5bbc230f305de1778 Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrioneuvo da Luz" Date: Tue, 30 Aug 2016 21:34:36 -0300 Subject: [PATCH 7/8] remove python3.2 from test suite --- .travis.yml | 8 -------- tox.ini | 6 ++---- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index b7c3167e..49ab122d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,14 +15,6 @@ matrix: env: TOX_ENV=py27-django17 - python: 2.7 env: TOX_ENV=py27-django18 - - python: 3.2 - env: TOX_ENV=py32-django15 - - python: 3.2 - env: TOX_ENV=py32-django16 - - python: 3.2 - env: TOX_ENV=py32-django17 - - python: 3.2 - env: TOX_ENV=py32-django18 - python: 3.3 env: TOX_ENV=py33-django15 - python: 3.3 diff --git a/tox.ini b/tox.ini index 13639c61..62e63762 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,10 @@ [tox] -envlist = py{27,32,33,34}-django{15,16,17,18},py{34,35}-django{18,19,110} +envlist = py{27,33,34}-django{15,16,17,18},py{34,35}-django{18,19,110} install_command = pip install {opts} {packages} [testenv] basepython = py27: python2.7 - py32: python3.2 py33: python3.3 py34: python3.4 py35: python3.5 @@ -18,8 +17,7 @@ commands = deps = mock factory_boy - py32: coverage==3.7 - py{27,32,33,34}: pytest-django==2.9.1 + py{27,33,34}: pytest-django==2.9.1 py{35}: pytest-django>2.9.1 py{27,33,34,35}: coverage==4.1 argparse From b9630091255a865de68dbf1026c318254295fe3d Mon Sep 17 00:00:00 2001 From: "Fabio C. Barrioneuvo da Luz" Date: Tue, 30 Aug 2016 22:56:47 -0300 Subject: [PATCH 8/8] remove python3.2 trove classifier from setup.py --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index c6ed0b47..215de6da 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,6 @@ "Development Status :: 5 - Production/Stable", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5",