'noqa isort in module imports [duplicate]

I'm struggling with isort library which is sorting imports in my project.

To avoid circular dependencies, I need to import packages in following order:

from foo import *
from bar import *
from eggs import *
from spam import *

But instead of that it sort them alphabetically as you may expect.

from bar import *
from eggs import *
from foo import *
from spam import *

I tried to use noqa with some codes for import lines and for whole file, but it didn't help.

How to ignore/noqa orderign for that import?



Solution 1:[1]

Looks like isort:skip is what you are looking. Here are few more examples and options of how to use it:

from foo import *  # isort:skip
from bar import *
from eggs import *
from spam import *

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 wowkin2