namespace package sorts differently when using the `from namespace import x` form
Open
@jhabarsingh is already working on this.
Since Jul 30, 2020.
enhancement
- Dominant language
- Python
- Stars
- 7k
- Forks
- 687
- Avg merge
- 4h 56m
- Merged PRs (30d)
- 2
Description
Given a configuration file like this:
[tool.isort]
import_heading_firstparty="First party"
import_heading_thirdparty="Third party"
known_first_party = ["namespace.mymodule"]
default_section = "THIRDPARTY"
And an input file like this:
import namespace.mymodule
from namespace import mymodule
Installing isort[pyproject] (==4.3.21), I get:
# Third party
from namespace import mymodule
# First party
import namespace.mymodule
Normally this would not be a problem because you can put "namespace" into known_first_party, but when the namespace is backports or some other shared namespace, there are both first- and third-party packages in there. It seems to me that in the case of from x import y, the sorting should be based on x.y, not on x.
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.
Assessment
This issue has not been assessed yet.