Third-party incorrectly identify as First-party depending on the name of the root directory
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7k
- Forks
- 687
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 2
Description
Third-party packages are incorrectly identify as First-party depending on the name of the root directory. I can't find a setting to override this behaviour. Example:
tree:
some_name
|-package_name
|--__init__.py
|--file1.py
|-tests
|-docs
|-pyproject.toml
What isort thinks it should be:
import datetime
import third_party
from package_name.file1 import xyz
from some_name import xyz
What it should be:
import datetime
import third_party
from some_name import xyz
from package_name.file1 import xyz
If I rename the root directory (some_name -> some_other_name), but this means for the CI run I have to also rename the repository.
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 classification using the shown package tree, including pyproject.toml, package_name/init.py, and file1.py, while changing only the root directory name. Trace the import classification entry point and verify that package_name remains third-party and some_name remains first-party regardless of the root directory name.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100