Browse Source

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: 8caa7646d0
tags/v1.3.0
Megvii Engine Team 4 years ago
parent
commit
f0170b9c21
3 changed files with 13 additions and 4 deletions
  1. +11
    -3
      imperative/python/setup.py
  2. +1
    -1
      scripts/whl/BUILD_PYTHON_WHL_README.md
  3. +1
    -0
      scripts/whl/manylinux2014/build_wheel_common.sh

+ 11
- 3
imperative/python/setup.py View File

@@ -47,11 +47,19 @@ with open("megengine/version.py") as fp:
__version__ = v['__version__'] __version__ = v['__version__']


email = 'megengine@megvii.com' 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') sdk_name = os.environ.get('SDK_NAME', 'cpu')
__version__ = '{}+{}'.format(__version__, sdk_name) __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']) packages = find_packages(exclude=['test'])
megengine_data = [ megengine_data = [


+ 1
- 1
scripts/whl/BUILD_PYTHON_WHL_README.md View File

@@ -72,7 +72,7 @@ export TENSORRT_ROOT_DIR=/path/to/tensorrt
ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cu101 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 ```bash
ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cpu ALL_PYTHON="36m" ./scripts/whl/manylinux2014/build_wheel_common.sh -sdk cpu
``` ```


+ 1
- 0
scripts/whl/manylinux2014/build_wheel_common.sh View File

@@ -199,6 +199,7 @@ fi


docker run --rm -it $TMPFS_ARGS \ docker run --rm -it $TMPFS_ARGS \
-e UID=${USERID} \ -e UID=${USERID} \
-e PUBLIC_VERSION_POSTFIX=${PUBLIC_VERSION_POSTFIX} \
-e LOCAL_VERSION=${LOCAL_VERSION} \ -e LOCAL_VERSION=${LOCAL_VERSION} \
-e BUILD_WHL_CPU_ONLY=${BUILD_WHL_CPU_ONLY} \ -e BUILD_WHL_CPU_ONLY=${BUILD_WHL_CPU_ONLY} \
-e ALL_PYTHON="${ALL_PYTHON}" \ -e ALL_PYTHON="${ALL_PYTHON}" \


Loading…
Cancel
Save