isort confuses directory for Python package
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7k
- Forks
- 687
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 2
Description
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?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report using the shown directory tree and example.py, then run isort --diff . from the root directory. Trace how isort decides whether b is a local package when it lacks __init__.py. Done means the behavior is clarified or corrected so the reported import ordering matches the expected result.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100