I'm working within Maya. What i need is to import a custom package and completely reload it inlcuding all subpackages and modules. Mainly because i want Maya autocompletes for me the module path while im writing. For example i have this kind of package structure
root (package)
subpackage1 (package)
__init__.py (module)
a.py (module)
b.py (module)
subpackage2 (package)
c.py (module)
d.py (module)
e.py (module)
What i did on __init__.py files is to import all submodules and one by one to reload them there
ex: root.subpackage1.__init__.py
import a
import b
reload(a)
reload(b)
This is very tedious, and thus i suppose there is a much better way to import and reload all the structure
When i import the package the first time the whole structure is load into memory.
import root
reload(root)
root.subpackage1.a.my_function()
so lets suppose now i update a.py file and add a function named my_test. I need again to reload all package structure to be able to evaluate it like this.
root.subpackage1.a.my_test()
whitout doing this...
from root.subpackage import a
reload(a)
a.my_test()
I wall everything to be reloaded when i import and reload root whats the best practice to do this? Thanks in advance.