Skip to content

Commit 0fc59a6

Browse files
committed
Update tox.ini, setup.py, tests, and docs for Python 3.3 and Django 1.6+.
1 parent 77a71fe commit 0fc59a6

File tree

6 files changed

+77
-33
lines changed

6 files changed

+77
-33
lines changed

AUTHORS.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
Carl Meyer <[email protected]>
22
Rob Hudson <[email protected]>
33
Aron Griffis <[email protected]>
4+
chmodas

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ CHANGES
44
tip (unreleased)
55
----------------
66

7+
- Add Python 3.3 compatibility. Thanks chmodas! (Merge of GH-5.)
8+
79
0.3.1 (2013.06.25)
810
------------------
911

README.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ and ``templates/form_utils/form.html``.
4848
Dependencies
4949
------------
5050

51-
``django-form-utils`` is tested on `Django`_ 1.4 and later and `Python`_ 2.6
52-
and later.
51+
``django-form-utils`` is tested on `Django`_ 1.4 and later and `Python`_ 2.6,
52+
2.7, and 3.3. It is known to be incompatible with Python 3.0, 3.1, and 3.2.
5353

5454
`ImageWidget`_ requires the `Python Imaging Library`_.
5555
`sorl-thumbnail`_ or `easy-thumbnails`_ is optional, but without it
@@ -63,7 +63,7 @@ Google-served version; see `JQUERY_URL`_).
6363
.. _Python: http://www.python.org/
6464
.. _sorl-thumbnail: http://pypi.python.org/pypi/sorl-thumbnail
6565
.. _easy-thumbnails: http://pypi.python.org/pypi/easy-thumbnails
66-
.. _Python Imaging Library: http://www.pythonware.com/products/pil/
66+
.. _Python Imaging Library: http://python-imaging.github.io/
6767
.. _jQuery: http://www.jquery.com/
6868

6969
Usage

setup.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
1111
if not p.returncode:
1212
fh = open('HGREV', 'w')
13-
fh.write(p.communicate()[0].splitlines()[0])
13+
fh.write(str(p.communicate()[0].splitlines()[0]))
1414
fh.close()
1515
except (OSError, IndexError):
1616
pass
@@ -28,7 +28,7 @@
2828
description='Form utilities for Django',
2929
long_description=long_description,
3030
author='Carl Meyer',
31-
author_email='carl@dirtcircle.com',
31+
author_email='carl@oddbird.net',
3232
url='http://bitbucket.org/carljm/django-form-utils/',
3333
packages=['form_utils', 'form_utils.templatetags'],
3434
classifiers=[
@@ -38,6 +38,11 @@
3838
'License :: OSI Approved :: BSD License',
3939
'Operating System :: OS Independent',
4040
'Programming Language :: Python',
41+
'Programming Language :: Python :: 2',
42+
'Programming Language :: Python :: 2.6',
43+
'Programming Language :: Python :: 2.7',
44+
'Programming Language :: Python :: 3',
45+
'Programming Language :: Python :: 3.3',
4146
'Framework :: Django',
4247
],
4348
zip_safe=False,

tests/tests.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,10 @@ def test_modelform_fields_exclude(self):
392392
self.assertEqual(ExcludePartialPersonForm._meta.fields, None)
393393

394394

395+
number_field_type = 'number' if django.VERSION > (1, 6, 0) else 'text'
396+
label_suffix = ':' if django.VERSION > (1, 6, 0) else ''
397+
398+
395399
class BoringForm(forms.Form):
396400
boredom = forms.IntegerField()
397401
excitement = forms.IntegerField()
@@ -401,16 +405,16 @@ class TemplatetagTests(TestCase):
401405
u'<fieldset class="fieldset_main">'
402406
u'<ul>'
403407
u'<li>'
404-
u'<label for="id_boredom">Boredom</label>'
408+
u'<label for="id_boredom">Boredom%(suffix)s</label>'
405409
u'<input type="%(type)s" name="boredom" id="id_boredom" />'
406410
u'</li>'
407411
u'<li>'
408-
u'<label for="id_excitement">Excitement</label>'
412+
u'<label for="id_excitement">Excitement%(suffix)s</label>'
409413
u'<input type="%(type)s" name="excitement" id="id_excitement" />'
410414
u'</li>'
411415
u'</ul>'
412416
u'</fieldset>'
413-
) % {'type': 'number' if django.VERSION > (1, 6, 0) else 'text'}
417+
) % {'type': number_field_type, 'suffix': label_suffix}
414418

415419
def test_render_form(self):
416420
"""
@@ -426,11 +430,11 @@ def test_render_form(self):
426430
u'<fieldset class="">'
427431
u'<ul>'
428432
u'<li class="required">'
429-
u'<label for="id_name">Name</label>'
433+
u'<label for="id_name">Name%(suffix)s</label>'
430434
u'<input type="text" name="name" id="id_name" />'
431435
u'</li>'
432436
u'<li class="required">'
433-
u'<label for="id_position">Position</label>'
437+
u'<label for="id_position">Position%(suffix)s</label>'
434438
u'<input type="text" name="position" id="id_position" />'
435439
u'</li>'
436440
u'</ul>'
@@ -439,12 +443,12 @@ def test_render_form(self):
439443
u'<legend>Optional</legend>'
440444
u'<ul>'
441445
u'<li class="optional">'
442-
u'<label for="id_reference">Reference</label>'
446+
u'<label for="id_reference">Reference%(suffix)s</label>'
443447
u'<input type="text" name="reference" id="id_reference" />'
444448
u'</li>'
445449
u'</ul>'
446450
u'</fieldset>'
447-
)
451+
) % {'suffix': label_suffix}
448452

449453
def test_render_betterform(self):
450454
"""

tox.ini

Lines changed: 53 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,74 @@
11
[tox]
2-
envlist=py26-1.4,py26,py26-trunk,py27-1.4,py27,py27-trunk
2+
envlist=
3+
py26-1.4,py26-1.5,py26-1.6,
4+
py27-1.4,py27-1.5,py27-1.6,py27-trunk,
5+
py33-1.5,py33-1.6,py33-trunk
36

4-
[testenv]
7+
[base]
58
deps=
6-
Django==1.5.1
7-
South==0.8.1
8-
PIL==1.1.7
9+
South==0.8.2
10+
Pillow==2.1.0
911
mock==1.0.1
12+
13+
[testenv]
1014
commands=python setup.py test
1115

1216
[testenv:py26-1.4]
1317
basepython=python2.6
1418
deps=
15-
Django==1.4.5
16-
South==0.8.1
17-
PIL==1.1.7
18-
mock==1.0.1
19+
Django==1.4.6
20+
{[base]deps}
1921

20-
[testenv:py26-trunk]
22+
[testenv:py26-1.5]
2123
basepython=python2.6
2224
deps=
23-
https://github.com/django/django/tarball/master
24-
South==0.8.1
25-
PIL==1.1.7
26-
mock==1.0.1
25+
Django==1.5.2
26+
{[base]deps}
27+
28+
[testenv:py26-1.6]
29+
basepython=python2.6
30+
deps=
31+
https://github.com/django/django/tarball/stable/1.6.x
32+
{[base]deps}
2733

2834
[testenv:py27-1.4]
2935
basepython=python2.7
3036
deps=
31-
Django==1.4.5
32-
South==0.8.1
33-
PIL==1.1.7
34-
mock==1.0.1
37+
Django==1.4.6
38+
{[base]deps}
39+
40+
[testenv:py27-1.5]
41+
basepython=python2.7
42+
deps=
43+
Django==1.5.2
44+
{[base]deps}
45+
46+
[testenv:py27-1.6]
47+
basepython=python2.7
48+
deps=
49+
https://github.com/django/django/tarball/stable/1.6.x
50+
{[base]deps}
3551

3652
[testenv:py27-trunk]
3753
basepython=python2.7
3854
deps=
3955
https://github.com/django/django/tarball/master
40-
PIL==1.1.7
41-
South==0.8.1
42-
mock==1.0.1
56+
{[base]deps}
57+
58+
[testenv:py33-1.5]
59+
basepython=python3.3
60+
deps=
61+
Django==1.5.2
62+
{[base]deps}
63+
64+
[testenv:py33-1.6]
65+
basepython=python3.3
66+
deps=
67+
https://github.com/django/django/tarball/stable/1.6.x
68+
{[base]deps}
69+
70+
[testenv:py33-trunk]
71+
basepython=python3.3
72+
deps=
73+
https://github.com/django/django/tarball/master
74+
{[base]deps}

0 commit comments

Comments
 (0)