Merge lp:~mars/launchpad/add-py25-lint into lp:launchpad

Proposed by Māris Fogels
Status: Rejected
Rejected by: Māris Fogels
Proposed branch: lp:~mars/launchpad/add-py25-lint
Merge into: lp:launchpad
Diff against target: 36 lines (+29/-0)
1 file modified
buildout-templates/bin/ (+29/-0)
To merge this branch: bzr merge lp:~mars/launchpad/add-py25-lint
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email:

Description of the change

This branch adds a test for Python 2.5 incompatible code to the bin/ script.

I manually tested all of the execution paths in this patch. Python2.5 is not a
Launchpad development dependency, so a branch was included to make this check
conditional. pyflakes is used for the check, and pyflakes is in

Māris Fogels -- -- cross-project collaboration and hosting

To post a comment you must log in.
Revision history for this message
Robert Collins (lifeless) wrote :

Seems useful if we have two things:
 - python 2.5 on the lucid builders
 - it hooked into make check.

In the absence of both these things, I wouldn't bother.

Revision history for this message
Brad Crittenden (bac) wrote :


I think the check you've added is good and will be useful if developers actually use 'make lint', but we know that not everyone does all of the time.

Robert's suggestions are good and you agreed on IRC that the needed steps are:

I would a) make it a stand-alone script; call that script from lint; call that script from 'make check'; add Py2.5 to the lucid builders.

What you have ready to land now does add value, so I'd *not* defer landing it until the additional changes are made. So, please add an XXX comment to make the agreed changes but go ahead and land what you have.

Thanks for coming up with a solution to an issue that has bitten us recently.

review: Approve (code)
Revision history for this message
Māris Fogels (mars) wrote :

I am taking this proposal off the table as we are "Almost there" for a complete Python2.6 conversion, and because the best type of code is code that does not exist.

Unmerged revisions

11620. By Māris Fogels

Added a check for Python 2.5 incompatible code to bin/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'buildout-templates/bin/'
2--- buildout-templates/bin/ 2010-07-17 21:42:06 +0000
3+++ buildout-templates/bin/ 2010-09-23 20:26:03 +0000
4@@ -152,3 +152,32 @@
6 echo ""
7 pocketlint $pocketlint_files 2>&1
10+# Check the changed files with Python 2.5, if possible
11+if [ -e '/usr/bin/python2.5' ]; then
12+ pyfiles=$(echo "$files" | grep '.py')
13+ if [ "$pyfiles" ]; then
14+ echo
15+ echo "Checking changed sources for Python 2.5 incompatible code... "
16+ problems=$(/usr/bin/python2.5 /usr/bin/pyflakes $pyfiles |& grep -e 'invalid')
17+ if [ "$problems" ]; then
18+ echo
19+ echo $problems
20+ echo
21+ echo " *********************************************************"
22+ echo " *** CRITICAL: Python 2.5 incompatible code was found! ***"
23+ echo " *********************************************************"
24+ echo
25+ echo " You should fix this before committing the code!"
26+ echo
27+ exit 1
28+ fi
29+ echo "Done"
30+ fi
32+ echo
33+ echo " Python 2.5 is not installed!"
34+ echo " Skipped checking for Python 2.5 incompatible code."
35+ echo