I have a shared object binary module with dynamic typing, however there are certain structures that will typically be available to the developer. I have a "fake" module directory structure similar to:
class A ...
class B ...
When attempting to simply have both the true module (foo.so) and the fake foo directory in site packages, pycharm defaults to reading from the fake foo directory which leaves me with no functionality, but does allow me to have a full set of code completion.
I attempted to rename all .py files in the fake module directory structure to .pyi which has nearly the desired effect except that nested .py definitions are not available,
- ie I have access to foo.bar.A and foo.bar.B, but not foo.buzz.cash or foo.fuzz.banana in code completion, though I still can call the types and run the code since my interpreter still has access to foo.so.
I tried renaming all except the __init__.py files to .pyi which led to an import error (e.g. __init__.py in foo could not import bar because it does not recognize the pyi file extension).
If there is a way to indicate to pycharm to recursively find all stubs in the directory I have not found it, and am open to work-arounds, I was just hoping to avoid having to write something to combine the directory structure into a single stub file.
Thanks for your help and suggestions!