From bfeaca7fdbe03980497a7316f50334f557cab759 Mon Sep 17 00:00:00 2001 From: duly Date: Sat, 29 Mar 2014 18:32:27 -0400 Subject: [PATCH 01/30] Fix __init.py__ version import error Simple import fix allows segment.io analytics to import on Python 3.3.2 Adding .travis.yml to root to allow automated builds to check compatibility with Python 2. ``` >BEFORE< Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import analytics Traceback (most recent call last): File "", line 1, in File "REDACTED\python\3.3.2\lib\site-packages\analytics\__init__.py", line 2, in import version ImportError: No module named 'version' >>> >AFTER< Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:06:53) [MSC v.1600 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import analytics >>> ``` --- analytics/__init__.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/analytics/__init__.py b/analytics/__init__.py index df4306bc..04c8d338 100644 --- a/analytics/__init__.py +++ b/analytics/__init__.py @@ -1,5 +1,4 @@ - -import version +import analytics.version VERSION = version.VERSION __version__ = VERSION From 93d1eff7f804d74b0ad1c8fdacbb8bcda83fee7c Mon Sep 17 00:00:00 2001 From: duly Date: Sat, 29 Mar 2014 18:49:02 -0400 Subject: [PATCH 02/30] Create .travis.yml Initial travis script. --- .travis.yml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..27569568 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,6 @@ +python: + - "2.7" + - "2.6" + - "3.2" +matrix: + fast_finish: true From 47faa123826de0ca317d3a49f2fc03ef02c2236e Mon Sep 17 00:00:00 2001 From: duly Date: Sat, 29 Mar 2014 18:50:25 -0400 Subject: [PATCH 03/30] http://lint.travis-ci.org/duly/analytics-python * missing key language, defaulting to ruby * specified python, but setting is not relevant for ruby --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 27569568..22994dee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,3 +1,4 @@ +language: python python: - "2.7" - "2.6" From c3425215f51796c49ad9a8c83d882a54fe996bb2 Mon Sep 17 00:00:00 2001 From: duly Date: Sat, 29 Mar 2014 18:52:27 -0400 Subject: [PATCH 04/30] Install analytics-python on travis Install analytics-python on travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 22994dee..ff7069ff 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,5 +3,7 @@ python: - "2.7" - "2.6" - "3.2" +install: + - "pip install analytics-python" matrix: fast_finish: true From 5063579a58f188b5eb97e5c6d6d7ce69547cfb48 Mon Sep 17 00:00:00 2001 From: duly Date: Sat, 29 Mar 2014 18:54:27 -0400 Subject: [PATCH 05/30] Run "import analytics" Test analytics import. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index ff7069ff..ca36d85d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,9 @@ python: - "2.7" - "2.6" - "3.2" + - "3.3" install: - "pip install analytics-python" + - python -c "import analytics" matrix: fast_finish: true From ebda4b22fd1212ee013346314447fd34af3e2763 Mon Sep 17 00:00:00 2001 From: duly Date: Sat, 29 Mar 2014 18:57:40 -0400 Subject: [PATCH 06/30] Typo in travis.yml Weblint did not detect this. Not sure if this is causing travis not to build properly. https://travis-ci.org/duly/analytics-python --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ca36d85d..5ed97d80 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ python: - "3.2" - "3.3" install: - - "pip install analytics-python" + - pip install analytics-python - python -c "import analytics" matrix: fast_finish: true From 87ff1e9ca1066814826a6eb71a9cdb7ec4421629 Mon Sep 17 00:00:00 2001 From: duly Date: Sat, 29 Mar 2014 19:04:07 -0400 Subject: [PATCH 07/30] Update .travis.yml to run tests. Please override the script: key in your .travis.yml to run tests. --- .travis.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5ed97d80..3163c32b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,6 +6,8 @@ python: - "3.3" install: - pip install analytics-python - - python -c "import analytics" + +script: python -c "import analytics" + matrix: fast_finish: true From 1c01545ba0ffb762e916eb2ffc6c9086a8abba8e Mon Sep 17 00:00:00 2001 From: duly Date: Sat, 29 Mar 2014 19:10:17 -0400 Subject: [PATCH 08/30] No module named stats in __init__.py ``` $ python -c "import analytics" Traceback (most recent call last): File "", line 1, in File "analytics/__init__.py", line 9, in from stats import Statistics ImportError: No module named stats ``` --- analytics/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/__init__.py b/analytics/__init__.py index 04c8d338..d10a98fb 100644 --- a/analytics/__init__.py +++ b/analytics/__init__.py @@ -6,7 +6,7 @@ import sys this_module = sys.modules[__name__] -from stats import Statistics +from analytics.stats import Statistics stats = Statistics() From d8c8571250d95cd0d54fd435c26a5baaa41466a3 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 01:30:17 -0400 Subject: [PATCH 09/30] analytics.init(...) fails on Python 3.3.2 ``` >>> analytics.init('testsecret', async=False, flush_at=1) Traceback (most recent call last): File "", line 1, in File "C:\REDACTED\analytics\__init__.py", line 33, in init from client import Client ImportError: No module named 'client' ``` --- analytics/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/__init__.py b/analytics/__init__.py index d10a98fb..5580de59 100644 --- a/analytics/__init__.py +++ b/analytics/__init__.py @@ -30,7 +30,7 @@ def init(secret, **kwargs): enable blocking and making the request on the calling thread. """ - from client import Client + from analytics.client import Client # if we have already initialized, no-op if hasattr(this_module, 'default_client'): From 453b26d763f2ca335d2a79b10a4673827798282e Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 01:37:08 -0400 Subject: [PATCH 10/30] Actually run tests on travis.... Relegate python -c "import analytics" to a before_script. Actually run the test.py script in preparation for nose_tests. --- .travis.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 3163c32b..56e7e59e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,8 +6,9 @@ python: - "3.3" install: - pip install analytics-python - -script: python -c "import analytics" + +before_script: python -c "import analytics" +script: python test.py matrix: fast_finish: true From c1778ab96d783c12e4d96dad349987ff85c43389 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 01:45:14 -0400 Subject: [PATCH 11/30] 2to3 upgrade with brackets around print Include brackets around print function for Python 3. There still may be Python 2to3 issues for Python 3 compatibility. --- test.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test.py b/test.py index 7d56d464..7b9a3dc4 100755 --- a/test.py +++ b/test.py @@ -22,11 +22,11 @@ def on_success(data, response): - print 'Success', response + print('Success', response) def on_failure(data, error): - print 'Failure', error + print('Failure', error) class AnalyticsBasicTests(unittest.TestCase): @@ -294,7 +294,7 @@ def test_performance(self): "Song": "Eleanor Rigby" }) - print 'Finished submitting into the queue' + print('Finished submitting into the queue') start = time() while analytics.stats.successful < target: From 4229b2ccf4d2fab0b5c574069ef6da7899c463ed Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 01:52:11 -0400 Subject: [PATCH 12/30] Including six for Python 2 and 3 compatibility ``` File "test.py", line 64 'unicode': u'woo', ^ SyntaxError: invalid syntax ``` --- test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index 7b9a3dc4..67778067 100755 --- a/test.py +++ b/test.py @@ -4,6 +4,8 @@ import unittest import json +import six + from datetime import datetime, timedelta from random import randint @@ -61,7 +63,7 @@ def test_clean(self): 'long': 200000000, 'bool': True, 'str': 'woo', - 'unicode': u'woo', + 'unicode': six.u('woo'), 'decimal': Decimal('0.142857'), 'date': datetime.now(), } From 6a424d0257aa3611c99074acd96087d48ada8cb0 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 01:58:09 -0400 Subject: [PATCH 13/30] Fix ImportError: No module named stats 11 Tests Fail due to the issues on Lines 11-13. >EXAMPLE< ``` Traceback (most recent call last): File "test.py", line 37, in setUp analytics.init(secret, log_level=logging.DEBUG) File "/home/travis/build/duly/analytics-python/analytics/__init__.py", line 33, in init from analytics.client import Client File "/home/travis/build/duly/analytics-python/analytics/client.py", line 11, in from stats import Statistics ImportError: No module named stats ``` --- analytics/client.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/analytics/client.py b/analytics/client.py index 9e791573..ead0c24a 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -8,11 +8,11 @@ from dateutil.tz import tzutc import requests -from stats import Statistics -from errors import ApiError -from utils import guess_timezone, DatetimeSerializer +from analytics.stats import Statistics +from analytics.errors import ApiError +from analytics.utils import guess_timezone, DatetimeSerializer -import options +import analytics.options logging_enabled = True From 33fb27f1b879b14a7c04feef89f25f4f7705c9e4 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:02:39 -0400 Subject: [PATCH 14/30] Fix options import as instead. Python 2.7 and 2.6 fail horribly due to this modification. importing as to avoid naming issues. ``` Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner self.run() File "/home/travis/build/duly/analytics-python/analytics/client.py", line 96, in run self.client._sync_flush() File "/home/travis/build/duly/analytics-python/analytics/client.py", line 484, in _sync_flush url = options.host + options.endpoints['batch'] NameError: global name 'options' is not defined ``` --- analytics/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index ead0c24a..830ab843 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -12,7 +12,7 @@ from analytics.errors import ApiError from analytics.utils import guess_timezone, DatetimeSerializer -import analytics.options +import analytics.options as options logging_enabled = True From 10576fea98d9792ed1bf031471fc3fba0711dcf7 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:11:29 -0400 Subject: [PATCH 15/30] Python 3 does not support unicode type Attempting to provide python 3 compatibility with six. ``` NameError: global name 'unicode' is not defined ``` --- analytics/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index 830ab843..00da9992 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -5,6 +5,8 @@ import numbers import threading +import six + from dateutil.tz import tzutc import requests @@ -192,7 +194,7 @@ def _clean_dict(self, d): return data def _clean(self, item): - if isinstance(item, (str, unicode, int, long, float, bool, + if isinstance(item, (str, six.text_type, int, long, float, bool, numbers.Number, datetime)): return item elif isinstance(item, (set, list, tuple)): From 09e3ac23991c174595ced281fbd01c0139623290 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:13:53 -0400 Subject: [PATCH 16/30] Python 3 does not support long type ``` NameError: global name 'long' is not defined ``` --- analytics/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index 00da9992..de894526 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -194,7 +194,7 @@ def _clean_dict(self, d): return data def _clean(self, item): - if isinstance(item, (str, six.text_type, int, long, float, bool, + if isinstance(item, (str, six.text_type, int, six.integer_types, float, bool, numbers.Number, datetime)): return item elif isinstance(item, (set, list, tuple)): From 218ce8eefb2f0e637ee420464908d9f3a0cfa4e7 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:16:51 -0400 Subject: [PATCH 17/30] Python 3 does not support iteritems(...) ``` AttributeError: 'dict' object has no attribute 'iteritems' ``` --- analytics/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index de894526..c2efa86b 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -184,7 +184,7 @@ def _clean_list(self, l): def _clean_dict(self, d): data = {} - for k, v in d.iteritems(): + for k, v in six.iteritems(d): try: data[k] = self._clean(v) except TypeError: From afeff997cb4a3e7b942a67cc4fc72e270422bbd5 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:24:09 -0400 Subject: [PATCH 18/30] Use dictionary.update(complicated.items()) Similar to: https://github.com/duly/pyjs/commit/311f7c6e706203388c0bc7dea3575cbff060ec92 One (1) test fails in each Python 3.3 and 3.4. ``` Traceback (most recent call last): File "test.py", line 77, in test_clean combined = dict(simple.items() + complicated.items()) TypeError: unsupported operand type(s) for +: 'dict_items' and 'dict_items' ``` --- test.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index 67778067..5402ea40 100755 --- a/test.py +++ b/test.py @@ -74,7 +74,8 @@ def test_clean(self): 'list': [1, 2, 3] } - combined = dict(simple.items() + complicated.items()) + combined = dict(simple.items()) + combined.update(complicated.items()) pre_clean_keys = combined.keys() From ad9e718b40dde1839561e2c4fb9f1e7f741deafe Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:29:08 -0400 Subject: [PATCH 19/30] Python 3 does not support unicode(...) ``` NameError: global name 'unicode' is not defined ``` https://travis-ci.org/duly/analytics-python/jobs/21861913#L1198 http://pythonhosted.org//six/#six.u --- analytics/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index c2efa86b..1eac6212 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -177,7 +177,7 @@ def _check_for_secret(self): 'identify or track.') def _coerce_unicode(self, cmplx): - return unicode(cmplx) + return six.u(cmplx) def _clean_list(self, l): return [self._clean(item) for item in l] From c0ba011ff42686357dcd9f8e5ef4a4db1e0f4a75 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:40:16 -0400 Subject: [PATCH 20/30] decode instead of unicode() for unicode handling http://docs.python.org/2/howto/unicode.html http://docs.python.org/release/3.0.1/howto/unicode.html ``` Traceback (most recent call last): File "test.py", line 82, in test_clean analytics.default_client._clean(combined) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 203, in _clean return self._clean_dict(item) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 189, in _clean_dict data[k] = self._clean(v) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 205, in _clean return self._coerce_unicode(item) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 180, in _coerce_unicode return six.u(cmplx) File "/home/travis/virtualenv/python2.7/local/lib/python2.7/site-packages/six.py", line 528, in u return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") AttributeError: 'exceptions.Exception' object has no attribute 'replace' ``` --- analytics/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index 1eac6212..71fa3307 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -177,7 +177,7 @@ def _check_for_secret(self): 'identify or track.') def _coerce_unicode(self, cmplx): - return six.u(cmplx) + return cmplx.decode("utf-8", "strict") def _clean_list(self, l): return [self._clean(item) for item in l] From f7b4b6eec8ad7b77f8f8de1b3fc13ac66519fd6b Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:44:10 -0400 Subject: [PATCH 21/30] decode is throwing an attribute error Determine what is causing the exception by encapsulating cmplx in a try-except block. ``` Traceback (most recent call last): File "test.py", line 82, in test_clean analytics.default_client._clean(combined) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 203, in _clean return self._clean_dict(item) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 189, in _clean_dict data[k] = self._clean(v) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 205, in _clean return self._coerce_unicode(item) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 180, in _coerce_unicode return cmplx.decode("utf-8", "strict") AttributeError: 'exceptions.Exception' object has no attribute 'decode' ``` --- analytics/client.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index 71fa3307..ad54ed7a 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -177,7 +177,11 @@ def _check_for_secret(self): 'identify or track.') def _coerce_unicode(self, cmplx): - return cmplx.decode("utf-8", "strict") + try: + item = cmplx.decode("utf-8", "strict") + except: + raise + return item def _clean_list(self, l): return [self._clean(item) for item in l] From da24d3f9797a317c7af85f33e8df4499fe6e6426 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 02:52:51 -0400 Subject: [PATCH 22/30] Run decode on an Exception's args Since the key is exception and the value is an Exception. Run decode on the Exception arguments as opposed to the Exception itself which does not contain a 'decode' attribute. ``` python/analytics/client.py", line 209, in _clean return self._coerce_unicode(item) File "/home/travis/build/duly/analytics-python/analytics/client.py", line 181, in _coerce_unicode item = cmplx.decode("utf-8", "strict") AttributeError: 'exceptions.Exception' object has no attribute 'decode' ``` --- analytics/client.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/analytics/client.py b/analytics/client.py index ad54ed7a..2b4c67f2 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -179,6 +179,8 @@ def _check_for_secret(self): def _coerce_unicode(self, cmplx): try: item = cmplx.decode("utf-8", "strict") + except AttributeError as exception: + item = exception.args.decode("utf-8", "strict") except: raise return item From f14d33b97134cd202b0a4cfd57ac4ffed2fb138e Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 03:00:47 -0400 Subject: [PATCH 23/30] Use joins for tuple http://stackoverflow.com/questions/5099551/error-in-python-replace-attributeerror-tuple-object-has-no-attribute-repla ``` line 183, in _coerce_unicode item = exception.args.decode("utf-8", "strict") AttributeError: 'tuple' object has no attribute 'decode' ``` --- analytics/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index 2b4c67f2..343c5abc 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -180,7 +180,8 @@ def _coerce_unicode(self, cmplx): try: item = cmplx.decode("utf-8", "strict") except AttributeError as exception: - item = exception.args.decode("utf-8", "strict") + item = ":".join(exception.args) + item.decode("utf-8", "strict") except: raise return item From 1d5b77c3aff85e26e48eef4ca8d2e87cbe326b41 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 03:08:03 -0400 Subject: [PATCH 24/30] Prefer exception over exception.args. Python 3.3 and 3.4 throw attribute errors ``` AttributeError: 'str' object has no attribute 'decode' ``` --- analytics/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index 343c5abc..a2d5fd60 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -180,7 +180,7 @@ def _coerce_unicode(self, cmplx): try: item = cmplx.decode("utf-8", "strict") except AttributeError as exception: - item = ":".join(exception.args) + item = ":".join(exception) item.decode("utf-8", "strict") except: raise From 3dd9ce1ccee537e5ec8811bca252dc80ebf487bf Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 03:19:37 -0400 Subject: [PATCH 25/30] Change log('warn',...) to 'warning' alleviate deprecation warning in 3.4. ``` ./home/travis/build/duly/analytics-python/analytics/client.py:27: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead method(*args, **kwargs) ``` --- analytics/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index a2d5fd60..0b03ae0a 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -28,7 +28,7 @@ def log(level, *args, **kwargs): def package_exception(client, data, e): - log('warn', 'Segment.io request error', exc_info=True) + log('warning', 'Segment.io request error', exc_info=True) client._on_failed_flush(data, e) From 747e8732bf6f9b5025ca1eac8067b0f9ccab54c9 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 03:24:48 -0400 Subject: [PATCH 26/30] Change log('warn', ...) to 'warning'. Change log('warn', ...) to 'warning'. ``` ./home/travis/build/duly/analytics-python/analytics/client.py:27: DeprecationWarning: The 'warn' method is deprecated, use 'warning' instead method(*args, **kwargs) ``` --- analytics/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/analytics/client.py b/analytics/client.py index 0b03ae0a..c64fe65f 100644 --- a/analytics/client.py +++ b/analytics/client.py @@ -195,7 +195,7 @@ def _clean_dict(self, d): try: data[k] = self._clean(v) except TypeError: - log('warn', 'Dictionary values must be serializeable to ' + + log('warning', 'Dictionary values must be serializeable to ' + 'JSON "%s" value %s of type %s is unsupported.' % (k, v, type(v))) return data From 6e00ce617fa7e8fe184ded4e66f8db0fa6a9e21f Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 04:40:45 -0400 Subject: [PATCH 27/30] Remove bitdeli badge. http://blog.bitdeli.com/post/77717727361/on-githubs-image-proxy --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index ad6ee7c5..6e463694 100644 --- a/README.md +++ b/README.md @@ -32,6 +32,3 @@ The above copyright notice and this permission notice shall be included in all c THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/segmentio/analytics-python/trend.png)](https://bitdeli.com/free "Bitdeli Badge") - From c479cdb0cee4d557713ebb5623c155490b671456 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 05:06:22 -0400 Subject: [PATCH 28/30] Expand test coverage 2.6 and 3.4 Python 3.4 and 2.6. --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 56e7e59e..e8a31847 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,11 @@ language: python python: + - "2.6" - "2.7" - "2.6" - "3.2" - "3.3" + - "3.4" install: - pip install analytics-python From 8820177b31c8776b31c2c01d3cfaa8381a9edf85 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 05:10:23 -0400 Subject: [PATCH 29/30] Further expansion into Python 2.5 Remove Python 3.4 due to errored job on travis. https://travis-ci.org/duly/analytics-python/jobs/21865893 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e8a31847..299f591e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ language: python python: + - "2.5" - "2.6" - "2.7" - "2.6" - "3.2" - "3.3" - - "3.4" install: - pip install analytics-python From c1d3f2214a30d01fb3555c3e80cf6e3aa6a53e93 Mon Sep 17 00:00:00 2001 From: duly Date: Sun, 30 Mar 2014 05:12:47 -0400 Subject: [PATCH 30/30] Remove duplicate target 2.6 and remove 2.5 2.5 and 3.4 have a lack of support for virtualenv. --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 299f591e..f08bfa89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,7 @@ language: python python: - - "2.5" - "2.6" - "2.7" - - "2.6" - "3.2" - "3.3" install: