osuAkatsuki / bancho.py

An osu! server for the generic public, optimized for maintainability in modern python
https://akatsuki.gg
MIT License
201 stars 125 forks source link

chore: replace `reorder-python-imports` with `isort` to address `black` incompatibility #571

Closed NiceAesth closed 4 months ago

NiceAesth commented 5 months ago

Describe your changes

Can unlock black version with this

Related Issues / Projects

Checklist

NiceAesth commented 5 months ago

We can disable adding the __future__ import annotations import now via comments. Did so on __init__ files

Can ignore failing test, fixed by #570

cmyui commented 4 months ago

What's your motivation to switch to isort? My choice of reorder-python-imports was in the vein of minimizing merge conflicts. Also tool quality i guess -- i highly regard/trust asottile haha

NiceAesth commented 4 months ago

The fact it completely breaks black and neither maintainer wants to support the other tool out of stubbornness

This also does pretty much the same import style anyway just with a couple behaviour changes

the other alternatives are switching to ruff or forking the tool to make it compatible and i view neither of these as necessary personally. isort seemed to be the lowest lift solution for resolving the incompatibility

NiceAesth commented 4 months ago

Forgot to link to this issue in the original post

https://github.com/psf/black/issues/4175

cmyui commented 4 months ago

The fact it completely breaks black and neither maintainer wants to support the other tool out of stubbornness

This also does pretty much the same import style anyway just with a couple behaviour changes

  • Will sort imports in stuff like TYPE_CHECKING blocks
  • Has support for disabling certain features per-file via comments e.g. disabling adding imports (i think reorder-python-imports also had this but on a simpler level)
  • Has configs for sort behaviour (so we can use it with black)

the other alternatives are switching to ruff or forking the tool to make it compatible and i view neither of these as necessary personally. isort seemed to be the lowest lift solution for resolving the incompatibility

Interesting okay -- damn that's unfortunate indeed, but understood. I see this PR aligns with choices made by many other familiar faces in the py ecosystem, and I'm aligned with the change.

+1 👍🏻