[dev] Upgrading flake8 to support f-strings
thierry at openstack.org
Thu Nov 21 17:13:02 UTC 2019
TL;DR: is it time for us to update flake8 and break the world?
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 I tried to use them, only to get pep8 job
failures. 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?
Thierry Carrez (ttx)
More information about the openstack-discuss