thebjorn / pydeps

Python Module Dependency graphs
https://pydeps.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
1.8k stars 114 forks source link

Not creating dependency graphs for modules not having a __init__.py file #230

Closed abhishekbansal1993 closed 4 days ago

abhishekbansal1993 commented 4 days ago

Hi all,

I am trying to create a dependency graph for an open-source project with multiple submodules imported into the main file. Each of these modules, in turn, has several submodules. Since the init.py file is no longer mandatory for Python to recognize a module, I have not included it in any modules.

When I attempt to generate a dependency graph, none of the modules appear. Using the --include-missing flag starts displaying the modules in the graph, but any further imports within those modules do not show up. To verify if the issue was due to the missing init.py file, I added it to one module, and it worked perfectly, showing the module and subsequent imports without needing the --include-missing flag.

Since it is now common for packages not to include an init.py file, we should add support for this scenario. Please advise if I am missing something.

Thank you!

Python version - 3.10.15 pydeps version - 2.0.1

abhishekbansal1993 commented 4 days ago

Closing as found another issue for the same - 19