提交 fe49e469 编写于 作者: M minqiyang

Fix the problem that CMake do not support {} regex

Change patch version to str
上级 1af7d5a2
......@@ -2,7 +2,7 @@
set(PADDLE_VERSION $ENV{PADDLE_VERSION})
set(tmp_version "HEAD")
set(TAG_VERSION_REGEX "[0-9]+\\.[0-9]+\\.[0-9]+(\\.(a|b|rc)\\.[0-9]+)?")
set(COMMIT_VERSION_REGEX "[0-9a-f]+")
set(COMMIT_VERSION_REGEX "[0-9a-f]+[0-9a-f]+[0-9a-f]+[0-9a-f]+[0-9a-f]+")
while ("${PADDLE_VERSION}" STREQUAL "")
execute_process(
COMMAND ${GIT_EXECUTABLE} describe --tags --abbrev=0 --always ${tmp_version}
......
......@@ -32,13 +32,13 @@ def _get_version_detail(idx):
return 0
def get_major():
return _get_version_detail(0)
return int(_get_version_detail(0))
def get_minor():
return _get_version_detail(1)
return int(_get_version_detail(1))
def get_patch():
return _get_version_detail(2)
return str(_get_version_detail(2))
def is_taged():
try:
......@@ -56,10 +56,10 @@ def write_version_py(filename='paddle/version.py'):
cnt = '''
# THIS FILE IS GENERATED FROM PADDLEPADDLE SETUP.PY
#
full_version = '%(major)d.%(minor)d.%(patch)d'
full_version = '%(major)d.%(minor)d.%(patch)s'
major = '%(major)d'
minor = '%(minor)d'
patch = '%(patch)d'
patch = '%(patch)s'
rc = '%(rc)d'
istaged = %(istaged)s
commit = '%(commit)s'
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册