From b8aa694d0769cec3a9990c1b3ae1b91353fbac6a Mon Sep 17 00:00:00 2001 From: Eric Amador Date: Sat, 18 Apr 2015 00:22:11 -0400 Subject: [PATCH 1/7] Updating tox file for python 3.3 and 3.4. Removing unused targets. --- tox.ini | 62 ++++++++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/tox.ini b/tox.ini index 60765da..fd5e4e0 100644 --- a/tox.ini +++ b/tox.ini @@ -2,47 +2,35 @@ envlist = py2.6-django1.4,py2.6-django1.5,py2.6-django1.6, py2.7-django1.4,py2.7-django1.5,py2.7-django1.6, - py2.7-django1.7 + py2.7-django1.7, + py3.3-django1.4,py3.3-django1.5,py3.3-django1.6, + py3.3-django1.7, + py3.4-django1.4,py3.4-django1.5,py3.4-django1.6, + py3.4-django1.7, [testenv] commands = python -Wall setup.py test -[testenv:py2.6-django1.2] -basepython = python2.6 -deps = Django>=1.2,<1.3 - -[testenv:py2.6-django1.3] -basepython = python2.6 -deps = Django>=1.3,<1.4 - [testenv:py2.6-django1.4] basepython = python2.6 deps = Django>=1.4,<1.5 -[testenv:py2.7-django1.2] -basepython = python2.7 -deps = Django>=1.2,<1.3 - -[testenv:py2.7-django1.3] -basepython = python2.7 -deps = Django>=1.3,<1.4 - -[testenv:py2.7-django1.4] -basepython = python2.7 -deps = Django>=1.4,<1.5 - [testenv:py2.6-django1.5] basepython = python2.6 deps = Django>=1.5,<1.6 -[testenv:py2.7-django1.5] -basepython = python2.7 -deps = Django>=1.5,<1.6 - [testenv:py2.6-django1.6] basepython = python2.6 deps = Django>=1.6,<1.7 +[testenv:py2.7-django1.4] +basepython = python2.7 +deps = Django>=1.4,<1.5 + +[testenv:py2.7-django1.5] +basepython = python2.7 +deps = Django>=1.5,<1.6 + [testenv:py2.7-django1.6] basepython = python2.7 deps = Django>=1.6,<1.7 @@ -50,3 +38,27 @@ deps = Django>=1.6,<1.7 [testenv:py2.7-django1.7] basepython = python2.7 deps = Django>=1.7,<1.8 + +[testenv:py3.3-django1.5] +basepython = python3.3 +deps = Django>=1.7,<1.8 + +[testenv:py3.3-django1.6] +basepython = python3.3 +deps = Django>=1.6,<1.7 + +[testenv:py3.3-django1.7] +basepython = python3.3 +deps = Django>=1.7,<1.8 + +[testenv:py3.4-django1.5] +basepython = python3.4 +deps = Django>=1.7,<1.8 + +[testenv:py3.4-django1.6] +basepython = python3.4 +deps = Django>=1.6,<1.7 + +[testenv:py3.4-django1.7] +basepython = python3.4 +deps = Django>=1.7,<1.8 From dc031d9e01550a81ed272513c3740735e12abe4b Mon Sep 17 00:00:00 2001 From: Eric Amador Date: Sat, 18 Apr 2015 00:22:38 -0400 Subject: [PATCH 2/7] Make exception handling python 3 compatible. --- analytical/templatetags/analytical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytical/templatetags/analytical.py b/analytical/templatetags/analytical.py index e04ec16..9f710f2 100644 --- a/analytical/templatetags/analytical.py +++ b/analytical/templatetags/analytical.py @@ -75,7 +75,7 @@ def _load_template_nodes(): module = _import_tag_module(path) try: module.contribute_to_analytical(add_node_cls) - except AnalyticalException, e: + except AnalyticalException as e: logger.debug("not loading tags from '%s': %s", path, e) for location in TAG_LOCATIONS: template_nodes[location] = sum((template_nodes[location][p] From dcf51bc6ca3d214578d30c8113bbfb82473d72ff Mon Sep 17 00:00:00 2001 From: Eric Amador Date: Sat, 18 Apr 2015 00:33:56 -0400 Subject: [PATCH 3/7] assertEqual was deprecated in python 3.2 --- analytical/tests/test_tag_intercom.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytical/tests/test_tag_intercom.py b/analytical/tests/test_tag_intercom.py index 876880e..78b9f50 100644 --- a/analytical/tests/test_tag_intercom.py +++ b/analytical/tests/test_tag_intercom.py @@ -34,7 +34,7 @@ class IntercomTagTestCase(TagTestCase): date_joined=now) })) # Because the json isn't predictably ordered, we can't just test the whole thing verbatim. - self.assertEquals(""" + self.assertEqual(""" From 67f29fdb2b614925bd3e067d15e929595aee89ec Mon Sep 17 00:00:00 2001 From: Eric Amador Date: Sat, 18 Apr 2015 00:42:54 -0400 Subject: [PATCH 4/7] Use assertRaisesRegex when available. --- analytical/tests/test_utils.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/analytical/tests/test_utils.py b/analytical/tests/test_utils.py index 53f59d5..5f6b3e6 100644 --- a/analytical/tests/test_utils.py +++ b/analytical/tests/test_utils.py @@ -19,8 +19,13 @@ class SettingDeletedTestCase(TestCase): """ Make sure using get_required_setting fails in the right place. """ - # only available in python >= 2.7 - if hasattr(self, 'assertRaisesRegexp'): + + # available in python >= 3.2 + if hasattr(self, 'assertRaisesRegex'): + with self.assertRaisesRegex(AnalyticalException, "^USER_ID setting is set to None$"): + user_id = get_required_setting("USER_ID", "\d+", "invalid USER_ID") + # available in python >= 2.7, deprecated in 3.2 + elif hasattr(self, 'assertRaisesRegexp'): with self.assertRaisesRegexp(AnalyticalException, "^USER_ID setting is set to None$"): user_id = get_required_setting("USER_ID", "\d+", "invalid USER_ID") else: From ff25a20ab784207dfab7c74f5fc775b85543dde2 Mon Sep 17 00:00:00 2001 From: Eric Amador Date: Sat, 18 Apr 2015 00:58:42 -0400 Subject: [PATCH 5/7] Adding python 3.3 and 3.4 to Travis. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index e049309..2ecc0fe 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,8 @@ language: python python: - "2.6" - "2.7" +- "3.3" +- "3.4" env: - DJANGO="Django>=1.4,<1.5" - DJANGO="Django>=1.5,<1.6" From 5855a1693a8c61080d5edfe2a15d5dbf0aca0d5b Mon Sep 17 00:00:00 2001 From: Eric Amador Date: Sat, 18 Apr 2015 01:11:43 -0400 Subject: [PATCH 6/7] django 1.4 doesn't have python 3.x support. --- tox.ini | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tox.ini b/tox.ini index fd5e4e0..bb082ea 100644 --- a/tox.ini +++ b/tox.ini @@ -3,10 +3,8 @@ envlist = py2.6-django1.4,py2.6-django1.5,py2.6-django1.6, py2.7-django1.4,py2.7-django1.5,py2.7-django1.6, py2.7-django1.7, - py3.3-django1.4,py3.3-django1.5,py3.3-django1.6, - py3.3-django1.7, - py3.4-django1.4,py3.4-django1.5,py3.4-django1.6, - py3.4-django1.7, + py3.3-django1.5,py3.3-django1.6,py3.3-django1.7, + py3.4-django1.5,py3.4-django1.6,py3.4-django1.7, [testenv] commands = python -Wall setup.py test From e5f88b543f00c8ea52b5b064fd943bf8f1448b17 Mon Sep 17 00:00:00 2001 From: Eric Amador Date: Sat, 18 Apr 2015 01:13:36 -0400 Subject: [PATCH 7/7] django 1.4 doesn't have python 3.x support. --- .travis.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.travis.yml b/.travis.yml index 2ecc0fe..794786d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,6 +13,10 @@ matrix: exclude: - python: "2.6" env: DJANGO="Django>=1.7,<1.8" + - python: "3.3" + env: DJANGO="Django>=1.4,<1.5" + - python: "3.4" + env: DJANGO="Django>=1.4,<1.5" install: - pip install $DJANGO script: