https://github.com/PyCQA/isort/blob/develop/isort/place.py#L65-L71 only considers the root module name when trying to categorize a package as first party. This causes issues when your project only contains a part of that module (e.g. in case of namespace packages). Setting known_first_party to root.a will mean that root.b will also be categorized as first party even though it's third party:
root
โโโ __init__.py
โโโ a
โ โโโ __init__.py
โโโ b
โโโ __init__.py
Thanks for reporting this issue! This is an embarrassing omission on my part. I had hoped to get a fix for this out in for 5.5.0, but I don't want to rush the change while pushing out some changes needed for improved VSCode integration. Expect to see this fixed in the next minor release (5.6.0)
Thanks!
~Timothy
I think this is happening to us too https://github.com/PyCQA/isort/issues/1467
@timothycrosley any ETA on this?
@gaborbernat the next minor release is scheduled for October 1st, I'll try to make sure the change is in develop soon so that you and others can test the new functionality before it's released to PyPI
This is fixed in develop and, void of issues being discovered before then, will be deployed with the 5.6.0 release of isort tonight.
The solution as coded exposes two new configuration options to tweak the behaviour if needed:
auto_identify_namespace_packages (defaults to True): enables toggling the new automatic namespace package identification.namespace_packages: Enables manually specifying a list of namespace packages.Thanks!
~Timothy
Was this released part of 5.5.5 and just msised from the changelog? ๐ค
@gaborbernat nope! There will be another release tonight, but since it is rather large for a minor release I wanted to make sure that the one major issue in the 5.5.x series was released separately in case any of the changes in 5.6.0 are harder to accommodate by any individual projects
This is now live with release 5.6.0 of isort https://pycqa.github.io/isort/CHANGELOG/#560-october-7-2020.
I apologize for the extended timeline for the release, but hope there are enough good things in it to make up for it!
No worries, much appreciated now it's released

Most helpful comment
Thanks for reporting this issue! This is an embarrassing omission on my part. I had hoped to get a fix for this out in for 5.5.0, but I don't want to rush the change while pushing out some changes needed for improved VSCode integration. Expect to see this fixed in the next minor release (5.6.0)
Thanks!
~Timothy