peterjc / flake8-black

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

Update black.find_project_root signature for black >= 22.1.0 #43

Closed rsalmaso closed 2 years ago

rsalmaso commented 2 years ago

New black 22.1.0 breaks flake8-black with

BLK999 Unexpected exception: unsupported operand type(s) for /: 'tuple' and 'str'

Because it update find_project_root return values: from Path to Tuple[Path, str] (https://github.com/psf/black/commit/521d1b8129c2d83b4ab49270fe7473802259c2a2)

Natureshadow commented 2 years ago

Very much needed, as for some reason something in our dependency tree already forces black to >=22 and this breaks all builds.

PLBMR commented 2 years ago

+1 on the need for this. All sqlfluff PRs are blocked from merging to main, because this incompatibility makes us fail our linting tests: https://github.com/sqlfluff/sqlfluff/runs/4994690193?check_suite_focus=true . Is there a way we can get a maintainer to review and approve this change quickly?

rsalmaso commented 2 years ago

It's Sunday :smiley_cat: (I wrote this patch on Saturday night - UTC+01), and I don't expect anything at least before Monday (and I don't know the maintainer's timezone).

I can suggest to pin black if possible, otherwise you could install this PR directly with

pip install git+https://github.com/peterjc/flake8-black.git@refs/pull/43/head

(ok, this is the last resort if you need black stable and and a working environment)

peterjc commented 2 years ago

If pinning is impossible for you that’s a shame. I will probably get to this tonight (Sunday evening).

peterjc commented 2 years ago

Are you happy to be thanked by name @rsalmaso ?

Natureshadow commented 2 years ago

If pinning is impossible for you that’s a shame. I will probably get to this tonight (Sunday evening).

If you happen to be able to receive some sort of micro donations somewhere, feel free to share details.

Fixing issues for downstream on a weekend should be appreciated with a gratis coffee at least.

rsalmaso commented 2 years ago

Are you happy to be thanked by name @rsalmaso ?

As you wish, it is fine for me. Thanks

cthoyt commented 2 years ago

Thank you all for taking care of this so quickly!!!