Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleDetection
提交
c843e64c
P
PaddleDetection
项目概览
PaddlePaddle
/
PaddleDetection
大约 1 年 前同步成功
通知
695
Star
11112
Fork
2696
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
184
列表
看板
标记
里程碑
合并请求
40
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleDetection
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
184
Issue
184
列表
看板
标记
里程碑
合并请求
40
合并请求
40
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
c843e64c
编写于
5月 13, 2019
作者:
J
Jiabin Yang
提交者:
GitHub
5月 13, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Revert "rename the default version from '0.0.0' to 'latest' (#17304)" (#17356)
This reverts commit
f456c8be
.
上级
8bae8590
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
14 addition
and
12 deletion
+14
-12
cmake/version.cmake
cmake/version.cmake
+7
-9
python/paddle/fluid/tests/unittests/test_version.py
python/paddle/fluid/tests/unittests/test_version.py
+7
-3
未找到文件。
cmake/version.cmake
浏览文件 @
c843e64c
...
@@ -3,8 +3,6 @@ set(PADDLE_VERSION $ENV{PADDLE_VERSION})
...
@@ -3,8 +3,6 @@ set(PADDLE_VERSION $ENV{PADDLE_VERSION})
set
(
tmp_version
"HEAD"
)
set
(
tmp_version
"HEAD"
)
set
(
TAG_VERSION_REGEX
"[0-9]+
\\
.[0-9]+
\\
.[0-9]+(
\\
.(a|b|rc)
\\
.[0-9]+)?"
)
set
(
TAG_VERSION_REGEX
"[0-9]+
\\
.[0-9]+
\\
.[0-9]+(
\\
.(a|b|rc)
\\
.[0-9]+)?"
)
set
(
COMMIT_VERSION_REGEX
"[0-9a-f]+[0-9a-f]+[0-9a-f]+[0-9a-f]+[0-9a-f]+"
)
set
(
COMMIT_VERSION_REGEX
"[0-9a-f]+[0-9a-f]+[0-9a-f]+[0-9a-f]+[0-9a-f]+"
)
set
(
LATEST_PADDLE_VERSION
"latest"
)
while
(
"
${
PADDLE_VERSION
}
"
STREQUAL
""
)
while
(
"
${
PADDLE_VERSION
}
"
STREQUAL
""
)
# Check current branch name
# Check current branch name
execute_process
(
execute_process
(
...
@@ -25,8 +23,8 @@ while ("${PADDLE_VERSION}" STREQUAL "")
...
@@ -25,8 +23,8 @@ while ("${PADDLE_VERSION}" STREQUAL "")
if
(
${
GIT_BRANCH_NAME
}
MATCHES
"release/
${
TAG_VERSION_REGEX
}
"
)
if
(
${
GIT_BRANCH_NAME
}
MATCHES
"release/
${
TAG_VERSION_REGEX
}
"
)
# Check the tag is a correct version
# Check the tag is a correct version
if
(
${
GIT_TAG_NAME
}
MATCHES
"
${
COMMIT_VERSION_REGEX
}
"
)
if
(
${
GIT_TAG_NAME
}
MATCHES
"
${
COMMIT_VERSION_REGEX
}
"
)
# if no tag was found, set PADDLE_VERSION to
"latest"
# if no tag was found, set PADDLE_VERSION to
0.0.0 to represent latest
set
(
PADDLE_VERSION
"
${
LATEST_PADDLE_VERSION
}
"
)
set
(
PADDLE_VERSION
"
0.0.0
"
)
elseif
(
${
GIT_TAG_NAME
}
MATCHES
"v
${
TAG_VERSION_REGEX
}
"
)
elseif
(
${
GIT_TAG_NAME
}
MATCHES
"v
${
TAG_VERSION_REGEX
}
"
)
string
(
REPLACE
"v"
""
PADDLE_VERSION
${
GIT_TAG_NAME
}
)
string
(
REPLACE
"v"
""
PADDLE_VERSION
${
GIT_TAG_NAME
}
)
else
()
# otherwise, get the previous git tag name.
else
()
# otherwise, get the previous git tag name.
...
@@ -44,19 +42,19 @@ while ("${PADDLE_VERSION}" STREQUAL "")
...
@@ -44,19 +42,19 @@ while ("${PADDLE_VERSION}" STREQUAL "")
if
(
${
GIT_EXACT_TAG_NAME
}
MATCHES
"v
${
TAG_VERSION_REGEX
}
"
)
if
(
${
GIT_EXACT_TAG_NAME
}
MATCHES
"v
${
TAG_VERSION_REGEX
}
"
)
string
(
REPLACE
"v"
""
PADDLE_VERSION
${
GIT_EXACT_TAG_NAME
}
)
string
(
REPLACE
"v"
""
PADDLE_VERSION
${
GIT_EXACT_TAG_NAME
}
)
else
()
else
()
set
(
PADDLE_VERSION
"
${
LATEST_PADDLE_VERSION
}
"
)
set
(
PADDLE_VERSION
"
0.0.0
"
)
endif
()
endif
()
else
()
else
()
# otherwise, we always set PADDLE_VERSION to
"latest"
# otherwise, we always set PADDLE_VERSION to
0.0.0 to represent latest
set
(
PADDLE_VERSION
"
${
LATEST_PADDLE_VERSION
}
"
)
set
(
PADDLE_VERSION
"
0.0.0
"
)
endif
()
endif
()
endif
()
endif
()
else
()
else
()
set
(
PADDLE_VERSION
"
${
LATEST_PADDLE_VERSION
}
"
)
set
(
PADDLE_VERSION
"
0.0.0
"
)
message
(
WARNING
"Cannot add paddle version from git tag"
)
message
(
WARNING
"Cannot add paddle version from git tag"
)
endif
()
endif
()
else
()
else
()
set
(
PADDLE_VERSION
"
${
LATEST_PADDLE_VERSION
}
"
)
set
(
PADDLE_VERSION
"
0.0.0
"
)
message
(
WARNING
"Cannot add paddle version for wrong git branch result"
)
message
(
WARNING
"Cannot add paddle version for wrong git branch result"
)
endif
()
endif
()
endwhile
()
endwhile
()
...
...
python/paddle/fluid/tests/unittests/test_version.py
浏览文件 @
c843e64c
...
@@ -30,14 +30,18 @@ class VersionTest(unittest.TestCase):
...
@@ -30,14 +30,18 @@ class VersionTest(unittest.TestCase):
self
.
_commit_regex
=
"[0-9a-f]{5,49}"
self
.
_commit_regex
=
"[0-9a-f]{5,49}"
def
test_check_output
(
self
):
def
test_check_output
(
self
):
# check commit format
self
.
assertTrue
(
re
.
match
(
self
.
_commit_regex
,
fluid_version
.
commit
))
self
.
assertTrue
(
isinstance
(
fluid_version
.
istaged
,
bool
))
self
.
assertTrue
(
isinstance
(
fluid_version
.
istaged
,
bool
))
# check version format
# check version format
if
fluid_version
.
istaged
:
if
fluid_version
.
istaged
:
self
.
assertEqual
(
fluid_version
.
full_version
,
"latest"
)
self
.
assertEqual
(
fluid_version
.
major
,
0
)
self
.
assertEqual
(
fluid_version
.
minor
,
0
)
self
.
assertEqual
(
fluid_version
.
patch
,
"0"
)
self
.
assertEqual
(
fluid_version
.
rc
,
0
)
self
.
assertEqual
(
fluid_version
.
full_version
,
"0.0.0"
)
else
:
else
:
# check commit format
self
.
assertTrue
(
re
.
match
(
self
.
_commit_regex
,
fluid_version
.
commit
))
self
.
assertTrue
(
re
.
match
(
self
.
_major_regex
,
fluid_version
.
major
))
self
.
assertTrue
(
re
.
match
(
self
.
_major_regex
,
fluid_version
.
major
))
self
.
assertTrue
(
re
.
match
(
self
.
_minor_regex
,
fluid_version
.
minor
))
self
.
assertTrue
(
re
.
match
(
self
.
_minor_regex
,
fluid_version
.
minor
))
self
.
assertTrue
(
re
.
match
(
self
.
_patch_regex
,
fluid_version
.
patch
))
self
.
assertTrue
(
re
.
match
(
self
.
_patch_regex
,
fluid_version
.
patch
))
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录