[dev] Upgrading flake8 to support f-strings

Thierry Carrez thierry at openstack.org
Thu Nov 21 17:13:02 UTC 2019

Hi everyone,

TL;DR: is it time for us to update flake8 and break the world?

Long version:
Ussuri-supported Python runtimes will be python 3.6 and 3.7, which opens 
the marvelous world of f-strings to us.

For those not familiar with f-strings, I recommend reading:

In a recent project[1] I tried to use them, only to get pep8 job 
failures[2]. The old flake8 version we are using in hacking is exploding 
trying to parse f-strings, with a cryptic "AttributeError: 
'FlakesChecker' object has no attribute 'JOINEDSTR'" error.

Of course that was long-fixed in pyflakes (>=1.4.0) but that version is 
only used starting in flake8>=3.3.0, and hacking is capping flake8<2.7.0.

We do cap those aggressively for a reason: bumping that cap triggers 
pep8 job failures everywhere as flake8 decides to pay attention to 
slightly different things, and we lose a lot of time collectively 
chasing down those syntax glitches everywhere.

Which is why we haven't really bumped those since 2016... But proper 
support of f-strings might be a good reason to update?


[1] https://review.opendev.org/#/c/695457/1

Thierry Carrez (ttx)

More information about the openstack-discuss mailing list