isort
isort copied to clipboard
Relative path not in sorting order with `--fss`
Hi. I have a similar issue to https://github.com/PyCQA/isort/issues/1236, where my relative imports are ordered weirdly when using force_sort_within_sections=true
, or --force-sort-within-sections
/--fss
.
Expected output:
from .. import A, B
from ..A import A
from ..B import B
from . import A, B
from .A import A
from .B import B
The output I got
from . import A, B
from .. import A, B
from ..A import A
from ..B import B
from .A import A
from .B import B
By removing the config option, the order is as expected, but I'd like to keep the way --fss
mixes straight- and from-style imports.
I'm not sure if this is considered a bug or expected behavior. If it's the latter, is there a workaround to get what I want (i.e., mix straight- and from-style imports, but also keep the relative imports from furthest away to closest within the package hierarchy)?
Thanks for this great tool!