Merge lp:~canonical-isd-hackers/django-preflight/py2.5-support into lp:django-preflight

Proposed by Łukasz Czyżykowski
Status: Merged
Merged at revision: 6
Proposed branch: lp:~canonical-isd-hackers/django-preflight/py2.5-support
Merge into: lp:django-preflight
Diff against target: 176 lines (+74/-29)
6 files modified
README (+10/-0)
doc/install.rst (+12/-0)
preflight/management/commands/preflight.py (+1/-4)
preflight/models.py (+1/-1)
tox (+6/-0)
tox.ini (+44/-24)
To merge this branch: bzr merge lp:~canonical-isd-hackers/django-preflight/py2.5-support
Reviewer Review Type Date Requested Status
Anthony Lenton (community) Approve
Review via email: mp+49220@code.launchpad.net

Description of the change

Add support for Python 2.5, which required small code change.

Additionally added tox script which will bootstrap and execute tests in all environments without any setup necessary.

To post a comment you must log in.
13. By Łukasz Czyżykowski

Fixed overstatement in compatibility note.

Revision history for this message
Anthony Lenton (elachuni) wrote :

Impressive :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2011-02-08 16:23:25 +0000
3+++ README 2011-02-11 10:56:29 +0000
4@@ -23,3 +23,13 @@
5 specific bits of information.
6
7 More information can be found in ``doc/`` directory.
8+
9+
10+Testing
11+=======
12+
13+To run tests just invoke tox_ command. If you don't have it installed
14+you can use supplied ``tox`` script which will pull it automatically
15+and then run the whole test suite.
16+
17+.. _tox: http://codespeak.net/tox/
18
19=== modified file 'doc/install.rst'
20--- doc/install.rst 2011-02-09 16:49:51 +0000
21+++ doc/install.rst 2011-02-11 10:56:29 +0000
22@@ -73,3 +73,15 @@
23 ``preflight.py`` modules in all installed applications. Similar to
24 Django's admin ``admin.autodiscover()`` call. This enables you to
25 just drop such file into your application folder.
26+
27+
28+Compatibility
29+-------------
30+
31+django-preflight is compatible with released Django versions since
32+1.0, as well as with upcoming 1.3. To be sure about this it's tested
33+using tox_ against all of them.
34+
35+Additionally it's tested on Python 2.5, 2.6 and 2.7, all on Ubuntu Linux.
36+
37+.. _tox: http://codespeak.net/tox/
38
39=== modified file 'preflight/management/commands/preflight.py'
40--- preflight/management/commands/preflight.py 2011-02-07 16:06:51 +0000
41+++ preflight/management/commands/preflight.py 2011-02-11 10:56:29 +0000
42@@ -48,8 +48,6 @@
43 self.stdout.write(app_style(application.name) + '\n')
44 self.stdout.write("-" * columns + '\n')
45
46- line_format = "{0:<{width}} {1:^6}\n"
47-
48 for check in application.checks:
49 # Formatting check result line, uses ANSI colors to prettify it
50 if check.passed:
51@@ -57,8 +55,7 @@
52 else:
53 status_name = error_style("ERROR")
54
55- self.stdout.write(line_format.format(
56- check.name, status_name, width=(columns - 7)))
57+ self.stdout.write(check.name.ljust(columns - 7) + status_name + '\n')
58
59 # Report correct return code to the shell
60 sys.exit(not all(a.passed for a in applications))
61
62=== modified file 'preflight/models.py'
63--- preflight/models.py 2011-02-07 16:06:51 +0000
64+++ preflight/models.py 2011-02-11 10:56:29 +0000
65@@ -11,7 +11,7 @@
66 def __init__(self, class_):
67 self.class_ = class_
68 self.checks = []
69- self.name = "{0} checks".format(self._application_name())
70+ self.name = "%s checks" % self._application_name()
71 self._gather_checks()
72
73 def _gather_checks(self):
74
75=== added file 'tox'
76--- tox 1970-01-01 00:00:00 +0000
77+++ tox 2011-02-11 10:56:29 +0000
78@@ -0,0 +1,6 @@
79+#!/usr/bin/env python
80+import urllib
81+url = "https://pytox.googlecode.com/hg/toxbootstrap.py"
82+d = dict(__file__='toxbootstrap.py')
83+exec urllib.urlopen(url).read() in d
84+d['cmdline'](['--recreate'])
85\ No newline at end of file
86
87=== modified file 'tox.ini'
88--- tox.ini 2011-02-09 16:26:04 +0000
89+++ tox.ini 2011-02-11 10:56:29 +0000
90@@ -1,7 +1,8 @@
91 [tox]
92 envlist =
93- py26-django124, py26-django113, py26-django104, py26-django-beta,
94- py27-django124, py27-django113, py27-django104, py27-django-beta,
95+ py2.5-django1.2, py2.5-django1.1, py2.5-django1.0, py2.5-django1.3-beta,
96+ py2.6-django1.2, py2.6-django1.1, py2.6-django1.0, py2.6-django1.3-beta,
97+ py2.7-django1.2, py2.7-django1.1, py2.7-django1.0, py2.7-django1.3-beta,
98 docs
99
100 [testenv]
101@@ -15,34 +16,53 @@
102 sphinx-build -b doctest -d {envtmpdir}/doctrees . {envtmpdir}/doctest
103 sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html
104
105-[testenv:py26-django124]
106-basepython = python2.6
107-deps = http://www.djangoproject.com/download/1.2.4/tarball/
108-
109-[testenv:py26-django113]
110-basepython = python2.6
111-deps = http://www.djangoproject.com/download/1.1.3/tarball/
112-
113-[testenv:py26-django104]
114+# Python 2.5
115+[testenv:py2.5-django1.2]
116+basepython = python2.5
117+deps = django >= 1.2, < 1.3
118+
119+[testenv:py2.5-django1.1]
120+basepython = python2.5
121+deps = django >= 1.1, < 1.2
122+
123+[testenv:py2.5-django1.0]
124+basetpython = python2.5
125+deps = django >= 1.0, < 1.1
126+
127+[testenv:py2.5-django1.3-beta]
128+basepython = python2.5
129+deps = http://www.djangoproject.com/download/1.3-beta-1/tarball/
130+
131+# Python 2.6
132+[testenv:py2.6-django1.2]
133+basepython = python2.6
134+deps = django >= 1.2, < 1.3
135+
136+[testenv:py2.6-django1.1]
137+basepython = python2.6
138+deps = django >= 1.1, < 1.2
139+
140+[testenv:py2.6-django1.0]
141 basetpython = python2.6
142-deps = http://www.djangoproject.com/download/1.0.4/tarball/
143+deps = django >= 1.0, < 1.1
144
145-[testenv:py26-django-beta]
146+[testenv:py2.6-django1.3-beta]
147 basepython = python2.6
148 deps = http://www.djangoproject.com/download/1.3-beta-1/tarball/
149
150-[testenv:py27-django124]
151-basepython = python2.7
152-deps = http://www.djangoproject.com/download/1.2.4/tarball/
153-
154-[testenv:py27-django113]
155-basepython = python2.7
156-deps = http://www.djangoproject.com/download/1.1.3/tarball/
157-
158-[testenv:py27-django104]
159+# Python 2.7
160+[testenv:py2.7-django1.2]
161+basepython = python2.7
162+deps = django >= 1.2, < 1.3
163+
164+[testenv:py2.7-django1.1]
165+basepython = python2.7
166+deps = django >= 1.1, < 1.2
167+
168+[testenv:py2.7-django1.0]
169 basetpython = python2.7
170-deps = http://www.djangoproject.com/download/1.0.4/tarball/
171+deps = django >= 1.0, < 1.1
172
173-[testenv:py27-django-beta]
174+[testenv:py2.7-django1.3-beta]
175 basepython = python2.7
176 deps = http://www.djangoproject.com/download/1.3-beta-1/tarball/

Subscribers

People subscribed via source and target branches

to all changes: