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

fix(whl): opt whl version

example:
1:export PUBLIC_VERSION_POSTFIX=rc1 for create a rc1 version
2:export PUBLIC_VERSION_POSTFIX=dev20210225 for create daily version
3:export PUBLIC_VERSION_POSTFIX=rc1.dev20210225 and export LOCAL_VERSION=mc40 for create special version
GitOrigin-RevId: 8caa7646d0ca6f6d7b91081b2a68a21a75ccab9e
上级 47db29aa
......@@ -47,11 +47,19 @@ with open("megengine/version.py") as fp:
__version__ = v['__version__']
email = 'megengine@megvii.com'
local_version = os.environ.get('LOCAL_VERSION')
if local_version:
__version__ = '{}{}'.format(__version__, local_version)
# https://www.python.org/dev/peps/pep-0440
# Public version identifiers: [N!]N(.N)*[{a|b|rc}N][.postN][.devN]
# 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)
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)
packages = find_packages(exclude=['test'])
megengine_data = [
......
......@@ -72,7 +72,7 @@ export TENSORRT_ROOT_DIR=/path/to/tensorrt
ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cu101
```
* If you just want to build with cpu only version, you can set `BUILD_WHL_CPU_ONLY` environment 'ON'. eg:
* If you just want to build with cpu only version, you can set `-sdk` environment 'cpu'. eg:
```bash
ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cpu
```
......
......@@ -199,6 +199,7 @@ fi
docker run --rm -it $TMPFS_ARGS \
-e UID=${USERID} \
-e PUBLIC_VERSION_POSTFIX=${PUBLIC_VERSION_POSTFIX} \
-e LOCAL_VERSION=${LOCAL_VERSION} \
-e BUILD_WHL_CPU_ONLY=${BUILD_WHL_CPU_ONLY} \
-e ALL_PYTHON="${ALL_PYTHON}" \
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册