Commits

Carl Meyer  committed ca44782

Update tox.ini, setup.py, tests, and docs for Python 3.3 and Django 1.6+.

  • Participants
  • Parent commits ec19cf7

Comments (0)

Files changed (6)

 Carl Meyer <carl@dirtcircle.com>
 Rob Hudson <rob@cogit8.org>
 Aron Griffis <aron@arongriffis.com>
+chmodas
 tip (unreleased)
 ----------------
 
+- Add Python 3.3 compatibility. Thanks chmodas! (Merge of GH-5.)
+
 0.3.1 (2013.06.25)
 ------------------
 
 Dependencies
 ------------
 
-``django-form-utils`` is tested on `Django`_ 1.4 and later and `Python`_ 2.6
-and later.
+``django-form-utils`` is tested on `Django`_ 1.4 and later and `Python`_ 2.6,
+2.7, and 3.3. It is known to be incompatible with Python 3.0, 3.1, and 3.2.
 
 `ImageWidget`_ requires the `Python Imaging Library`_.
 `sorl-thumbnail`_ or `easy-thumbnails`_ is optional, but without it
 .. _Python: http://www.python.org/
 .. _sorl-thumbnail: http://pypi.python.org/pypi/sorl-thumbnail
 .. _easy-thumbnails: http://pypi.python.org/pypi/easy-thumbnails
-.. _Python Imaging Library: http://www.pythonware.com/products/pil/
+.. _Python Imaging Library: http://python-imaging.github.io/
 .. _jQuery: http://www.jquery.com/
 
 Usage
                              stdout=subprocess.PIPE, stderr=subprocess.PIPE)
         if not p.returncode:
             fh = open('HGREV', 'w')
-            fh.write(p.communicate()[0].splitlines()[0])
+            fh.write(str(p.communicate()[0].splitlines()[0]))
             fh.close()
 except (OSError, IndexError):
     pass
     description='Form utilities for Django',
     long_description=long_description,
     author='Carl Meyer',
-    author_email='carl@dirtcircle.com',
+    author_email='carl@oddbird.net',
     url='http://bitbucket.org/carljm/django-form-utils/',
     packages=['form_utils', 'form_utils.templatetags'],
     classifiers=[
         'License :: OSI Approved :: BSD License',
         'Operating System :: OS Independent',
         'Programming Language :: Python',
+        'Programming Language :: Python :: 2',
+        'Programming Language :: Python :: 2.6',
+        'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: 3',
+        'Programming Language :: Python :: 3.3',
         'Framework :: Django',
     ],
     zip_safe=False,

File tests/tests.py

         self.assertEqual(ExcludePartialPersonForm._meta.fields, None)
 
 
+number_field_type = 'number' if django.VERSION > (1, 6, 0) else 'text'
+label_suffix = ':' if django.VERSION > (1, 6, 0) else ''
+
+
 class BoringForm(forms.Form):
     boredom = forms.IntegerField()
     excitement = forms.IntegerField()
         u'<fieldset class="fieldset_main">'
         u'<ul>'
         u'<li>'
-        u'<label for="id_boredom">Boredom</label>'
+        u'<label for="id_boredom">Boredom%(suffix)s</label>'
         u'<input type="%(type)s" name="boredom" id="id_boredom" />'
         u'</li>'
         u'<li>'
-        u'<label for="id_excitement">Excitement</label>'
+        u'<label for="id_excitement">Excitement%(suffix)s</label>'
         u'<input type="%(type)s" name="excitement" id="id_excitement" />'
         u'</li>'
         u'</ul>'
         u'</fieldset>'
-        ) % {'type': 'number' if django.VERSION > (1, 6, 0) else 'text'}
+        ) % {'type': number_field_type, 'suffix': label_suffix}
 
     def test_render_form(self):
         """
         u'<fieldset class="">'
         u'<ul>'
         u'<li class="required">'
-        u'<label for="id_name">Name</label>'
+        u'<label for="id_name">Name%(suffix)s</label>'
         u'<input type="text" name="name" id="id_name" />'
         u'</li>'
         u'<li class="required">'
-        u'<label for="id_position">Position</label>'
+        u'<label for="id_position">Position%(suffix)s</label>'
         u'<input type="text" name="position" id="id_position" />'
         u'</li>'
         u'</ul>'
         u'<legend>Optional</legend>'
         u'<ul>'
         u'<li class="optional">'
-        u'<label for="id_reference">Reference</label>'
+        u'<label for="id_reference">Reference%(suffix)s</label>'
         u'<input type="text" name="reference" id="id_reference" />'
         u'</li>'
         u'</ul>'
         u'</fieldset>'
-        )
+        ) % {'suffix': label_suffix}
 
     def test_render_betterform(self):
         """
 [tox]
-envlist=py26-1.4,py26,py26-trunk,py27-1.4,py27,py27-trunk
+envlist=
+  py26-1.4,py26-1.5,py26-1.6,
+  py27-1.4,py27-1.5,py27-1.6,py27-trunk,
+           py33-1.5,py33-1.6,py33-trunk
+
+[base]
+deps=
+  South==0.8.2
+  Pillow==2.1.0
+  mock==1.0.1
 
 [testenv]
-deps=
-  Django==1.5.1
-  South==0.8.1
-  PIL==1.1.7
-  mock==1.0.1
 commands=python setup.py test
 
 [testenv:py26-1.4]
 basepython=python2.6
 deps=
-  Django==1.4.5
-  South==0.8.1
-  PIL==1.1.7
-  mock==1.0.1
+  Django==1.4.6
+  {[base]deps}
 
-[testenv:py26-trunk]
+[testenv:py26-1.5]
 basepython=python2.6
 deps=
-  https://github.com/django/django/tarball/master
-  South==0.8.1
-  PIL==1.1.7
-  mock==1.0.1
+  Django==1.5.2
+  {[base]deps}
+
+[testenv:py26-1.6]
+basepython=python2.6
+deps=
+  https://github.com/django/django/tarball/stable/1.6.x
+  {[base]deps}
 
 [testenv:py27-1.4]
 basepython=python2.7
 deps=
-  Django==1.4.5
-  South==0.8.1
-  PIL==1.1.7
-  mock==1.0.1
+  Django==1.4.6
+  {[base]deps}
+
+[testenv:py27-1.5]
+basepython=python2.7
+deps=
+  Django==1.5.2
+  {[base]deps}
+
+[testenv:py27-1.6]
+basepython=python2.7
+deps=
+  https://github.com/django/django/tarball/stable/1.6.x
+  {[base]deps}
 
 [testenv:py27-trunk]
 basepython=python2.7
 deps=
   https://github.com/django/django/tarball/master
-  PIL==1.1.7
-  South==0.8.1
-  mock==1.0.1
+  {[base]deps}
+
+[testenv:py33-1.5]
+basepython=python3.3
+deps=
+  Django==1.5.2
+  {[base]deps}
+
+[testenv:py33-1.6]
+basepython=python3.3
+deps=
+  https://github.com/django/django/tarball/stable/1.6.x
+  {[base]deps}
+
+[testenv:py33-trunk]
+basepython=python3.3
+deps=
+  https://github.com/django/django/tarball/master
+  {[base]deps}