isort icon indicating copy to clipboard operation
isort copied to clipboard

isort confuses directory for Python package

Open gncs opened this issue 1 year ago • 0 comments

isort seems to interpret a directory (containing no __init__.py) as a package.

Example

.
├── a
│   └── example.py
└── b

example.py

import b
import c

In the root directory, I run isort --diff .:

@@ -1,2 +1,3 @@
+import c
+
 import b
-import c

I would expect b not to be interpreted as a local package as the directory doesn't contain an __init__.py file. Is this the intended behaviour?

gncs avatar Feb 24 '23 10:02 gncs