From 6b843ccd936905bfbc414b0f7cdcb7f6e9f4504c Mon Sep 17 00:00:00 2001 From: Tricster Date: Thu, 6 May 2021 21:36:45 +0800 Subject: [PATCH] fix(mge): macos whl build From GITHUB 168 COPYBARA_INTEGRATE_REVIEW=https://api.github.com/repos/MegEngine/MegEngine/pulls/168 from Tricster 5c775d02dd0b8f20b5acc6b400cf722e92f2e86b Closes #168 GitOrigin-RevId: bceecb401b4bf5f6cfd47bb7f7216ec36ef1cae8 --- scripts/whl/macos/macos_build_whl.sh | 1 + scripts/whl/macos/macos_whl_env_prepare.sh | 12 +++++------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/scripts/whl/macos/macos_build_whl.sh b/scripts/whl/macos/macos_build_whl.sh index 63ff3b0b8..e1bafb744 100755 --- a/scripts/whl/macos/macos_build_whl.sh +++ b/scripts/whl/macos/macos_build_whl.sh @@ -2,6 +2,7 @@ READLINK=readlink OS=$(uname -s) +USER=$(whoami) if [ $OS = "Darwin" ];then READLINK=greadlink diff --git a/scripts/whl/macos/macos_whl_env_prepare.sh b/scripts/whl/macos/macos_whl_env_prepare.sh index 159e0cf3b..dae3613ff 100755 --- a/scripts/whl/macos/macos_whl_env_prepare.sh +++ b/scripts/whl/macos/macos_whl_env_prepare.sh @@ -46,21 +46,19 @@ SRC_DIR=$($READLINK -f "`dirname $0`/../../../") echo ${SRC_DIR} ALL_PYTHON="3.5.9 3.6.10 3.7.7 3.8.3" - +USER=$(whoami) function install_python_package() { for pak in ${ALL_PYTHON} do echo "###### do command: env PYTHON_CONFIGURE_OPTS=\"--enable-shared\" pyenv install ${pak}" - if [ -e /Users/$USER/.pyenv/versions/${pak} ];then - echo "FOUND install /Users/$USER/.pyenv/versions/${pak} strip it..." + if [ -e /Users/${USER}/.pyenv/versions/${pak} ];then + echo "FOUND install /Users/${USER}/.pyenv/versions/${pak} strip it..." else env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install ${pak} fi - echo "###### do command: /Users/${USER}/.pyenv/versions/${pak}/bin/python3 -m pip install numpy wheel requests tqdm tabulate" - /Users/${USER}/.pyenv/versions/${pak}/bin/python3 -m pip install numpy wheel - echo "###### do command: /Users/${USER}/.pyenv/versions/${pak}/bin/python3 -m pip install -r ${SRC_DIR}/python_module/requires-test.txt" - /Users/${USER}/.pyenv/versions/${pak}/bin/python3 -m pip install -r ${SRC_DIR}/python_module/requires-test.txt + echo "###### do command: /Users/$USER/.pyenv/versions/${pak}/bin/python3 -m pip install -r ${SRC_DIR}/imperative/python/requires.txt" + /Users/$USER/.pyenv/versions/${pak}/bin/python3 -m pip install -r ${SRC_DIR}/imperative/python/requires.txt done } -- GitLab