I have a problem with the PyCharm Editor import assistant. I'm developing a library package with many sub-modules in sub-directories. I often include classes from from low level sub-modules into higher level sub-modules.
The assistant works fine as long I have no top level __init__.py file. The original sub-modules are found and used for the import statement. But when I add "import ..." statements and an "__all__ = [...]" variable to the top-level __init__.py, the original source file is no longer used by the assistant, instead the top level __init__.py is used.
This behavior is fine for consumers of the library, but not for the developer of the library itself. It leads very quickly to "circular import" errors.
Any idea how I can configure PyCharm to use the original source files with import statements when inside a library source file? I have a simple project attached, how it can be found with the ID below. (See src/sample/module_a/ma_first.py for details).
Kind regards, Andi
Upload id: 2021_08_26_JmoShrQH7yAHEF88 (file: pycharm-import-problem-example.zip)