isort icon indicating copy to clipboard operation
isort copied to clipboard

flask_session recognised as FIRSTPARTY

Open rafrafek opened this issue 3 years ago • 1 comments

from-type place_module for flask_session returned FIRSTPARTY

flask_session module is recognised as FIRSTPARTY because it (by default) creates folder flask_session inside project root directory. But there is no __init__.py file inside this folder, so it is not a Python module. I think it shouldn't be considered FIRSTPARTY only based of existence of the folder. The real module is located in site-packages.

I know I can add:

[tool.isort]
known_third_party = [
    "flask_session",
]

to my ´pyproject.toml´, but maybe there is some way to improve it, so it works without any workaround?

rafrafek avatar Oct 25 '22 09:10 rafrafek

@DanielNoord I recommend closing this issue. isort provides configuration options to accommodate the need.

@rafrafek I think that the solution you've found is the supported way to address this (flask_session isn't the only tool that creates directories like this, and Python namespace packages also don't have __init__.py files in each subdirectory).

kurtmckee avatar Jan 10 '25 15:01 kurtmckee