Common build scripts used by AppsCode repositories.
Use libbuild as a git subtree in your project.
# add first time
git subtree add --prefix hack/libbuild https://github.com/appscode/libbuild.git master --squash
# update later
git subtree pull --prefix hack/libbuild https://github.com/appscode/libbuild.git master --squashTo learn about git subtree, check the following articles:
- http://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/
- https://developer.atlassian.com/blog/2015/05/the-power-of-git-subtree/
We recommend using https://github.com/ellisonbg/antipackage to import libbuild.py . First install antipackage using pip:
pip install git+https://github.com/ellisonbg/antipackage.git#egg=antipackageNow, add the following lines into a build script to import libuild.py.
# http://stackoverflow.com/a/14050282
def check_antipackage():
from sys import version_info
sys_version = version_info[:2]
found = True
if sys_version < (3, 0):
# 'python 2'
from pkgutil import find_loader
found = find_loader('antipackage') is not None
elif sys_version <= (3, 3):
# 'python <= 3.3'
from importlib import find_loader
found = find_loader('antipackage') is not None
else:
# 'python >= 3.4'
from importlib import util
found = util.find_spec('antipackage') is not None
if not found:
print('Install missing package "antipackage"')
print('Example: pip install git+https://github.com/ellisonbg/antipackage.git#egg=antipackage')
from sys import exit
exit(1)
check_antipackage()
# ref: https://github.com/ellisonbg/antipackage
import antipackage
from github.appscode.libbuild import libbuildlibbuild is licensed under the Apache 2.0 license. See the LICENSE file for details.