From: crouzet Date: Thu, 13 Oct 2022 14:56:12 +0000 (+0200) Subject: sat #32302 pip option --build obsolète : integration du patch fourni par Nabil X-Git-Tag: V9_10_0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=11c8e6684162cf6c8cd8eb15cb91f327c658a8e4;p=tools%2Fsat.git sat #32302 pip option --build obsolète : integration du patch fourni par Nabil --- diff --git a/commands/compile.py b/commands/compile.py index af2d274..b6da2f3 100644 --- a/commands/compile.py +++ b/commands/compile.py @@ -538,20 +538,35 @@ def compile_product_pip(sat, # here we just print a message if not res_pip_dwl: logger.write("Error in pip download\n", 4, False) - - + try: + pip_version_cmd = 'python -c "import pip;print(pip.__version__)"' + res_pip_version = subprocess.check_output(pip_version_cmd, + shell=True, + cwd=config.LOCAL.workdir, + env=build_environ.environ.environ, + stderr=subprocess.STDOUT).strip() + pip_build_options=res_pip_version.split('.')[0] < 21 + except: + pip_build_options= True # d- install (in python or in separate product directory) if src.appli_test_property(config,"pip_install_dir", "python"): # pip will install product in python directory" - pip_install_cmd+=" --find-links=%s --build %s %s==%s" %\ - (pip_wheels_dir, p_info.build_dir, p_info.name, p_info.version) + if pip_build_options: + pip_install_cmd+=" --find-links=%s --build %s %s==%s" %\ + (pip_wheels_dir, p_info.build_dir, p_info.name, p_info.version) + else: + pip_install_cmd+=" --find-links=%s --cache-dir %s %s==%s" %\ + (pip_wheels_dir, p_info.build_dir, p_info.name, p_info.version) pip_install_in_python=True - else: # pip will install product in product install_dir - pip_install_dir=os.path.join(p_info.install_dir, "lib", "python${PYTHON_VERSION:0:3}", "site-packages") - pip_install_cmd+=" --find-links=%s --build %s --target %s %s==%s" %\ - (pip_wheels_dir, p_info.build_dir, pip_install_dir, p_info.name, p_info.version) + pip_install_dir=os.path.join(p_info.install_dir, "lib", "python${PYTHON}", "site-packages") + if pip_build_options: + pip_install_cmd+=" --find-links=%s --build %s --target %s %s==%s" %\ + (pip_wheels_dir, p_info.build_dir, pip_install_dir, p_info.name, p_info.version) + else: + pip_install_cmd+=" --find-links=%s --cache-dir %s --target %s %s==%s" %\ + (pip_wheels_dir, p_info.build_dir, pip_install_dir, p_info.name, p_info.version) log_step(logger, header, "PIP") logger.write("\n"+pip_install_cmd+"\n", 4) len_end_line = len_end + 3