Firstparty + `from ... import ...` corner case
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 7k
- Forks
- 687
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 2
Description
👋
I come from pantsbuild land! I'm looking at trying to help world-model in this issue
One attempt was to specify each "known" module that we're going to supply (with -p=...) but ran into an interesting corner case.
Given
import requests
from subdirA import fileA
Running isort -p=subdir.fileA file.py (where subdir.fileA isn't in the sandbox we're running isort in) puts both imports together.
Whereas:
import requests
import subdirA.fileA
doesn't.
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 two import examples with file.py and the -p option, first checking how isort classifies the from-import versus the plain import when the supplied module is absent. Trace the classification path for this corner case and define the expected grouping before adding a focused regression test; done means both equivalent forms receive consistent, documented treatment.
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
- 38/100