peterjc / flake8-black

flake8 plugin to run black for checking Python coding style
MIT License
165 stars 10 forks source link

Version 0.2.5 is breaking compatibility with flake8<4 #49

Closed maciej-lech closed 2 years ago

maciej-lech commented 2 years ago

Hey,

I have noticed that with flake8==3.9.2 the linter is failing with: flake8.exceptions.FailedToLoadPlugin: Flake8 failed to load plugin "BLK" due to __init__() got an unexpected keyword argument 'preview'.

The problem doesn't exist with flake8-black==0.2.3. I haven't tested it with flake8-black==0.2.4 and flake>=4

Best regards, Maciej

peterjc commented 2 years ago

Sigh. Do you happen to have the version of black you are using to hand?

peterjc commented 2 years ago

The change needs 8c22d232b56104376a12d1e68eaf216d04979830 which means only black 22.1.0 (or later), obvious in hindsight.

Do you think this needs a backward compatible workaround in flake8-black, or would insisting on at least black 22.1.0 be OK?

peterjc commented 2 years ago

Or at least I think that's the problem - trying to reproduce this now.

peterjc commented 2 years ago

I've yanked the v0.2.5 release from PyPI (given the nature of this tool that seems wise to pre-empt lots more broken builds).

maciej-lech commented 2 years ago

Thank you for your quick response. I have been using black==21.9b0

peterjc commented 2 years ago

Thanks for confirming - sadly you will have to downgrade flake8-black, or upgrade black.

It was not practical to support both old and new black here.