From ab1bd3c0cb01148518887760e4fc290c622b0518 Mon Sep 17 00:00:00 2001 From: steve Date: Sun, 26 Jan 2014 13:29:41 -0500 Subject: [PATCH] Remove six dependency So, six turned out to be a bad choice. It was originally brought in to add support for python 3. That transition was abandoned, as the differences between python2 and python3 unicode handling are too different to do this simply. However, I thought leaving six in would be harmless, as eventually I'd like to support python3, if the demand presents itself. This turned out to be a bad idea because six has at least two nasty dependencies - TKinter and winreg/_winreg. The former was fixed by installing the distrubtion package python-tk. This was frustrating, because when I tested six on machines that *happened* to have python-tk, I didn't realize this dependency existed. I gave up after trying to solve the winreg dependency. It's bad enough to install a gui library for a webapp running on a server, but an OS dependency (winreg adds MS windows registry manipulation to python) is even worse. Maybe I'm doing something wrong here, but for now, six has to go. --- djqscsv/djqscsv.py | 4 +--- setup.py | 3 +-- test_app/djqscsv_tests/tests.py | 8 +------- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/djqscsv/djqscsv.py b/djqscsv/djqscsv.py index 32f30cd..caa3d50 100644 --- a/djqscsv/djqscsv.py +++ b/djqscsv/djqscsv.py @@ -13,8 +13,6 @@ from django.db.models.query import ValuesQuerySet -import six - """ A simple python package for turning django models into csvs """ @@ -129,7 +127,7 @@ def _sanitize_value(value): return localize(value) obj = {} - for key, val in six.iteritems(record): + for key, val in record.items(): if val: obj[_sanitize_value(key)] = _sanitize_value(val) diff --git a/setup.py b/setup.py index ab51faf..c981187 100644 --- a/setup.py +++ b/setup.py @@ -17,6 +17,5 @@ "Framework :: Django", "License :: OSI Approved :: GNU General Public License (GPL)" ], - install_requires=['django>=1.5', - 'six==1.5'], + install_requires=['django>=1.5'], ) diff --git a/test_app/djqscsv_tests/tests.py b/test_app/djqscsv_tests/tests.py index 6e65d38..0caab1f 100644 --- a/test_app/djqscsv_tests/tests.py +++ b/test_app/djqscsv_tests/tests.py @@ -11,13 +11,7 @@ from .util import create_people_and_get_queryset -import six - -if six.PY3: - from functools import filter - from io import StringIO -else: - from StringIO import StringIO +from StringIO import StringIO class ValidateCleanFilenameTests(TestCase):