When running isort locally (e.g. python -m isort .
or poetry run isort .
, isort
seems to sort things different than in CI, so my CI job fails when it checks for good formatting using python -m isort --check-only .
.
import azure
import pytest
from my_package_name.example import Example1, Example2
import azure
import pytest
from my_package_name.example import Example1, Example2
I had an empty folder called pytest
, which tricked isort
into thinking it was a local module.
Therefore, it moved import pytest
together with other local imports.
After deleting this empty folder, isort sorted the imports correctly again.