Skip to content

KuYaki/gitmodules_example_b

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

This is the second example for the gitmodules project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages