I am looking for an isort config to have one line per import if it's a single import but as soon as you have multiple imports it switches to parenthesis, so it would look like the following
from something import one_thing
from another.thing import (
uno,
due,
tres,
)
Same question: How to make isort always produce multi-line output when there are multiple imports on a line?
See the first comment.
Use
force_grid_wrap = X
where X is the threshold of imports before wrapping them. Note, you should still use themulti_line_output
option to set how you want the wrapped imports to actually look like.For example:
Turns this:
Into this: