[openstack-dev] New python dependency - extras-0.0.1

Sean Dague sdague at linux.vnet.ibm.com
Mon Nov 26 13:02:41 UTC 2012


On 11/23/2012 02:43 AM, Monty Taylor wrote:
>
>
> On 11/22/2012 11:29 PM, Mark McLoughlin wrote:
>> Hey,
>>
>> A new Oslo dependency is proposed here:
>>
>>    https://review.openstack.org/16789
>>
>> The library is called 'extras' and released its first version nearly a
>> month ago:
>>
>>    http://pypi.python.org/pypi/extras/0.0.1
>>    https://github.com/testing-cabal/extras
>
> As a follow up to that, it actually started off life inside of the
> testtools project which has been around for a while, and I got Robert to
> split some of the elements which were generally useful outside of
> testing context - so don't let the month-ago part scare you off. :)
>
>> I don't forsee any objections apart from perhaps 'is a separate library
>> for just try_import() really worth it?'
>>
>> I'm inclined to approve it, just want to give folks a chance to express
>> an opinion.
>
> Over on the CI python projects, we've been using pyflakes instead of
> pylint quite successfully recently. It's got a much higher signal to
> noise ratio, and regularly finds actual bugs for me (including a couple
> I found in pyflakes-cleaning oslo-incubator the other day) There are two
> things done in the general openstack projects that prevent pyflakes from
> being on the table for consideration - one is the try: import foo
> except: foo = None pattern, which confuses the "you're redefined this
> variable" detection. The other is the way we use gettext - for which we
> don't have a great solution.

For what it's worth, I've got a pyflakes wrapper that handles the 
gettext issue (found it somewhere via google), that has seemed to work 
fine so far in my emacs/flymake integration:

#!/usr/bin/python

import os, __builtin__

names = os.environ.get('PYFLAKES_BUILTINS', '_')
names = [x.strip() for x in names.split(',')]
for x in names:
     if not hasattr(__builtin__, x):
         setattr(__builtin__, x, True)

del names, os, __builtin__

import sys
from pyflakes.scripts.pyflakes import main
sys.exit(main(sys.argv[1:]))


	-Sean


-- 
Sean Dague
IBM Linux Technology Center
email: sdague at linux.vnet.ibm.com
alt-email: sldague at us.ibm.com




More information about the OpenStack-dev mailing list