@ -14,7 +14,8 @@ RC = 0
def git_commit ( ) :
def git_commit ( ) :
try :
try :
cmd = [ ' git ' , ' rev-parse ' , ' HEAD ' ]
cmd = [ ' git ' , ' rev-parse ' , ' HEAD ' ]
git_commit = subprocess . Popen ( cmd , stdout = subprocess . PIPE ) . communicate ( ) [ 0 ] . strip ( )
git_commit = subprocess . Popen ( cmd , stdout = subprocess . PIPE ,
cwd = " @PADDLE_SOURCE_DIR@ " ) . communicate ( ) [ 0 ] . strip ( )
except :
except :
git_commit = ' Unknown '
git_commit = ' Unknown '
git_commit = git_commit . decode ( )
git_commit = git_commit . decode ( )
@ -44,7 +45,7 @@ def get_patch():
def is_taged ( ) :
def is_taged ( ) :
try :
try :
cmd = [ ' git ' , ' describe ' , ' --exact-match ' , ' --tags ' , ' HEAD ' , ' 2>/dev/null ' ]
cmd = [ ' git ' , ' describe ' , ' --exact-match ' , ' --tags ' , ' HEAD ' , ' 2>/dev/null ' ]
git_tag = subprocess . Popen ( cmd , stdout = subprocess . PIPE ). communicate ( ) [ 0 ] . strip ( )
git_tag = subprocess . Popen ( cmd , stdout = subprocess . PIPE , cwd = " @PADDLE_SOURCE_DIR@ " ). communicate ( ) [ 0 ] . strip ( )
git_tag = git_tag . decode ( )
git_tag = git_tag . decode ( )
except :
except :
return False
return False
@ -55,8 +56,7 @@ def is_taged():
return False
return False
def write_version_py ( filename = ' paddle/version.py ' ) :
def write_version_py ( filename = ' paddle/version.py ' ) :
cnt = '''
cnt = ''' # THIS FILE IS GENERATED FROM PADDLEPADDLE SETUP.PY
# THIS FILE IS GENERATED FROM PADDLEPADDLE SETUP.PY
#
#
full_version = ' %(major)d . %(minor)d . %(patch)s '
full_version = ' %(major)d . %(minor)d . %(patch)s '
major = ' %(major)d '
major = ' %(major)d '