From 356e88ee0ec96406fa12de404612f04ddd66ef82 Mon Sep 17 00:00:00 2001 From: jianghongbo Date: Sun, 26 Feb 2023 15:15:59 +0800 Subject: [PATCH] =?UTF-8?q?om=E5=B1=8F=E8=94=BDpython=E5=B7=AE=E5=BC=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build.sh | 13 +++---------- script/base_utils/os/net_util.py | 2 +- script/gspylib/common/CheckPythonVersion.py | 8 -------- script/gspylib/common/Common.py | 2 +- 4 files changed, 5 insertions(+), 20 deletions(-) diff --git a/build.sh b/build.sh index dac8050..f1a02a1 100644 --- a/build.sh +++ b/build.sh @@ -81,19 +81,11 @@ declare package_name="${package_pre_name}.tar.gz" declare sha256_name="${package_pre_name}.sha256" if [ ${binarylib_dir} != 'None' ] && [ -d ${binarylib_dir} ]; then - if [[ $(python -V | awk '{print $2}') =~ "3.9" ]]; then - BINARYLIBS_PATH_INSTALL_TOOLS="${binarylib_dir}/install_tools_python39" - else - BINARYLIBS_PATH_INSTALL_TOOLS="${binarylib_dir}/install_tools" - fi + BINARYLIBS_PATH_INSTALL_TOOLS="${binarylib_dir}/install_tools" BINARYLIBS_PATH="${binarylib_dir}/kernel/dependency/" BUILD_TOOLS_PATH="${binarylib_dir}/buildtools/" else - if [[ $(python -V | awk '{print $2}') =~ "3.9" ]]; then - BINARYLIBS_PATH_INSTALL_TOOLS="${ROOT_DIR}/install_tools_python39" - else - BINARYLIBS_PATH_INSTALL_TOOLS="${ROOT_DIR}/install_tools" - fi + BINARYLIBS_PATH_INSTALL_TOOLS="${ROOT_DIR}/install_tools" BINARYLIBS_PATH="${ROOT_DIR}/binarylibs/kernel/dependency/" BUILD_TOOLS_PATH="${ROOT_DIR}/binarylibs/buildtools/" fi @@ -201,6 +193,7 @@ function lib_copy() cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/six.py ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/_cffi_backend.py ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/_cffi_backend.so* ${PKG_TMP_DIR}/lib + cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/_cffi_backend_* ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/paramiko ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/psutil ${PKG_TMP_DIR}/lib cp -rf ${BINARYLIBS_PATH_INSTALL_TOOLS}/netifaces ${PKG_TMP_DIR}/lib diff --git a/script/base_utils/os/net_util.py b/script/base_utils/os/net_util.py index ec4e64f..fca29cb 100644 --- a/script/base_utils/os/net_util.py +++ b/script/base_utils/os/net_util.py @@ -41,7 +41,7 @@ try: import psutil except ImportError as e: # mv psutil mode .so file by python version - pythonVer = sys.version[:3] + pythonVer = str(sys.version_info[0]) + '.' + str(sys.version_info[1]) psutilLinux = os.path.join(localDirPath, "./../../../lib/psutil/_psutil_linux.so") psutilPosix = os.path.join(localDirPath, diff --git a/script/gspylib/common/CheckPythonVersion.py b/script/gspylib/common/CheckPythonVersion.py index 0374db5..7d9f63c 100644 --- a/script/gspylib/common/CheckPythonVersion.py +++ b/script/gspylib/common/CheckPythonVersion.py @@ -28,14 +28,6 @@ def checkPythonVersion(): raise Exception("[GAUSS-52200] : version of python" " is not correct: %s." % distName + " should use Python 3.*") - if re.search("oe1", distName) is not None: - if not pythonVersion == (3, 7): - print("Warnging version of python doesnot meet the expection, maybe third-party libs " - "need to be compiled by yourself") - else: - if not pythonVersion == (3, 6): - print("Warnging version of python doesnot meet the expection, maybe third-party libs " - "need to be compiled by yourself") return True def check_python_compiler_option(): diff --git a/script/gspylib/common/Common.py b/script/gspylib/common/Common.py index 16efff0..8723863 100644 --- a/script/gspylib/common/Common.py +++ b/script/gspylib/common/Common.py @@ -64,7 +64,7 @@ try: import psutil except ImportError as e: # mv psutil mode .so file by python version - pythonVer = sys.version[:3] + pythonVer = str(sys.version_info[0]) + '.' + str(sys.version_info[1]) psutilLinux = os.path.join(localDirPath, "./../../../lib/psutil/_psutil_linux.so") psutilPosix = os.path.join(localDirPath,