提交 33ab2454 编写于 作者: M Megvii Engine Team

fix(whl): support wheel version without sdk info,

which caused by python official PYPI do not support
LOCAL_VERSION; sync lite setup.py

GitOrigin-RevId: 7e35ceb5f17cb8e06174f1e0b976e31f12ee7b25
上级 8163ed15
......@@ -49,17 +49,24 @@ __version__ = v['__version__']
email = 'megengine@megvii.com'
# https://www.python.org/dev/peps/pep-0440
# Public version identifiers: [N!]N(.N)*[{a|b|rc}N][.postN][.devN]
# Local version identifiers: <public version identifier>[+<local version label>]
# PUBLIC_VERSION_POSTFIX use to handle rc or dev info
public_version_postfix = os.environ.get('PUBLIC_VERSION_POSTFIX')
if public_version_postfix:
__version__ = '{}{}'.format(__version__, public_version_postfix)
local_version = []
strip_sdk_info = os.environ.get('STRIP_SDK_INFO', 'False').lower()
sdk_name = os.environ.get('SDK_NAME', 'cpu')
__version__ = '{}+{}'.format(__version__, sdk_name)
# Local version identifiers: <public version identifier>[+<local version label>]
# reserved for special whl package
local_version = os.environ.get('LOCAL_VERSION')
if local_version:
__version__ = '{}.{}'.format(__version__, local_version)
if 'true' == strip_sdk_info:
print('wheel version strip sdk info')
else:
local_version.append(sdk_name)
local_postfix = os.environ.get('LOCAL_VERSION')
if local_postfix:
local_version.append(local_postfix)
if len(local_version):
__version__ = '{}+{}'.format(__version__, '.'.join(local_version))
packages = find_packages(exclude=['test'])
megengine_data = [
......
......@@ -222,6 +222,7 @@ docker run --rm -it $TMPFS_ARGS \
-e UID=${USERID} \
-e PUBLIC_VERSION_POSTFIX=${PUBLIC_VERSION_POSTFIX} \
-e LOCAL_VERSION=${LOCAL_VERSION} \
-e STRIP_SDK_INFO=${STRIP_SDK_INFO} \
-e BUILD_WHL_CPU_ONLY=${BUILD_WHL_CPU_ONLY} \
-e ALL_PYTHON="${ALL_PYTHON}" \
-e EXTRA_CMAKE_FLAG="$EXTRA_CMAKE_FLAG" \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册