Using git submodule to import a python project
You could also add mysubmod
to sys.path
when you starting your myproj
. Then mysubmod/models/hello.py
will find lib.foobar
.
OK the answer is (after many wrong turns)
- add a single top level package mysubmod (eg 'helloworld')
- with mysubmod imported into myprod as a submodule, symbolically link the helloworld package into the myprod root ('ln -s mysubmod/helloworld helloworld')
This way, the package structure is maintained whether you are working with the submod as a submodule or on a standalone basis.