Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.38 KB

README.md

File metadata and controls

41 lines (32 loc) · 1.38 KB

gitmodules_example_b

This is the second example for the gitmodules project. However it is just a part of a complex construction with root at gitmodules_example_a.

Dependencies

This project is assumed to be used with the gitmodules dependency

pip install gitmodules

And the gitmodules_example_c should be updated as well

git submodule update --recursive --init

Description

gitmodules_example_c can be executed as a main script but if you will try to import it in any other project as a git submodule you will be forced to append its path to the sys.path:

# in b.py from gitmodules_example_b
import sys
sys.path.append("gitmodules_example_c")
from gitmodules_example_c import c

Or you can simply use gitmodules instead:

# in b.py from gitmodules_example_b
import gitmodules
from gitmodules_example_c import c

This method allows you to import git submodule as an ordinary module or as a standard library. So that if you will decide to upload your git submodules to PyPi you will not be forced to change your scripts.