[openstack-dev] flake8 magic you should all know

Monty Taylor mordred at inaugust.com
Sun May 19 03:13:15 UTC 2013



On 05/18/2013 11:09 AM, Melanie Witt wrote:
> Hi Monty,
> 
> Thanks for sending this out.
> 
> I picked up this update and had a couple of minor issues.

Which project?

> 1. It broke run_tests.sh, which I know there's been talk of not
> supporting going forward but just to let you know. I was able to run
> tox instead with success.

The ones where it broke run_tests.sh are bugs. I think that should be
fixed across the board now - but if it's still broken, please let me know.

It's also an easy patch to run_tests.sh - take the contents of
run_pep8() function in the script and simply replace it with ${wrapper}
flake8  - because it'll pull the config in.

> 2. If I don't have python2.7 installed, I need to add importlib to
> tools/test-requires to get it installed in the venv.

That seems like a bug in general in the test-requires (or the pip
requires- OR - oh, are you saying that flake8 itself on python2.6 is
missing importlib? I think you are. Ok. I think I can fix that in
hacking - thanks!)

> Melanie
> 
> On May 16, 2013, at 7:29 PM, "Monty Taylor" <mordred at inaugust.com>
> wrote:
> 
>> Hey all!
>> 
>> As you have all probably noticed, we're moving to using flake8 to
>> run pep8/pyflakes/hacking checks. It's awesome and fills the worlds
>> with magical ponies and flying cars. BUT - I realized that it's
>> possible that perhaps people don't read all of the documentation
>> for everything. So I wanted to share a quick trick.
>> 
>> flake8, in a fit of amazingness normally not found in python
>> utilities, knows how to read other people's config files. So - it
>> actually reads the config section in tox.ini even when it's not in
>> a venv. That means that, if your project has migrated to flake8
>> (that's most of you now) just running:
>> 
>> flake8
>> 
>> Will get you a flake8 run with all the right options and includes
>> and excludes and everything. No wrapper scripts, no fake meat -
>> only pure bacon. (you have to have flake8 installed, natch)
>> 
>> Your friendly infra guy...
>> 
>> Monty
>> 
>> _______________________________________________ OpenStack-dev
>> mailing list OpenStack-dev at lists.openstack.org 
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 
> _______________________________________________ OpenStack-dev mailing
> list OpenStack-dev at lists.openstack.org 
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
> 



More information about the OpenStack-dev mailing list