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/lint.sh.in (+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: mp+36502@code.launchpad.net

Description of the change

This branch adds a test for Python 2.5 incompatible code to the bin/lint.sh 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
launchpad-developer-dependencies.

--
Māris Fogels -- https://launchpad.net/~mars
Launchpad.net -- 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 :

Maris,

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/lint.sh

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'buildout-templates/bin/lint.sh.in'
--- buildout-templates/bin/lint.sh.in 2010-07-17 21:42:06 +0000
+++ buildout-templates/bin/lint.sh.in 2010-09-23 20:26:03 +0000
@@ -152,3 +152,32 @@
152152
153echo ""153echo ""
154pocketlint $pocketlint_files 2>&1154pocketlint $pocketlint_files 2>&1
155
156
157# Check the changed files with Python 2.5, if possible
158if [ -e '/usr/bin/python2.5' ]; then
159 pyfiles=$(echo "$files" | grep '.py')
160 if [ "$pyfiles" ]; then
161 echo
162 echo "Checking changed sources for Python 2.5 incompatible code... "
163 problems=$(/usr/bin/python2.5 /usr/bin/pyflakes $pyfiles |& grep -e 'invalid')
164 if [ "$problems" ]; then
165 echo
166 echo $problems
167 echo
168 echo " *********************************************************"
169 echo " *** CRITICAL: Python 2.5 incompatible code was found! ***"
170 echo " *********************************************************"
171 echo
172 echo " You should fix this before committing the code!"
173 echo
174 exit 1
175 fi
176 echo "Done"
177 fi
178else
179 echo
180 echo " Python 2.5 is not installed!"
181 echo " Skipped checking for Python 2.5 incompatible code."
182 echo
183fi