diff --git a/imperative/python/setup.py b/imperative/python/setup.py index 47677f7783636f96119493c32ee44c8f2e491111..99a9e2739a632e5bda3f0bc9da16350ba5643603 100644 --- a/imperative/python/setup.py +++ b/imperative/python/setup.py @@ -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_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: [+] -# 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 = [ diff --git a/scripts/whl/manylinux2014/build_wheel_common.sh b/scripts/whl/manylinux2014/build_wheel_common.sh index 06303852660766edfec5d490ec354b88a9c709c8..bdc0605527e875fe41bcbd0ed973d95d36730269 100755 --- a/scripts/whl/manylinux2014/build_wheel_common.sh +++ b/scripts/whl/manylinux2014/build_wheel_common.sh @@ -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" \