未验证 提交 63e2a7dd 编写于 作者: S Sing_chan 提交者: GitHub

make paddle build and unit test in python virtual environment. (#43620)

上级 f12cb756
...@@ -92,15 +92,18 @@ rem ------initialize set git config------ ...@@ -92,15 +92,18 @@ rem ------initialize set git config------
git config --global core.longpaths true git config --global core.longpaths true
rem ------initialize the python environment------ rem ------initialize the python environment------
set PYTHON_EXECUTABLE=%PYTHON_ROOT%\python.exe set PYTHON_VENV_ROOT=%cache_dir%\python_venv
set PATH=%PYTHON_ROOT%\Scripts;%PYTHON_ROOT%;%PATH% set PYTHON_EXECUTABLE=!PYTHON_VENV_ROOT!\Scripts\python.exe
%PYTHON_ROOT%\python.exe -m venv --clear !PYTHON_VENV_ROOT!
call !PYTHON_VENV_ROOT!\Scripts\activate.bat
if "%WITH_PYTHON%" == "ON" ( if "%WITH_PYTHON%" == "ON" (
where python where python
where pip where pip
pip install wheel --user pip install wheel
pip install pyyaml --user pip install pyyaml
pip install wget --user pip install wget
pip install -r %work_dir%\python\requirements.txt --user pip install -r %work_dir%\python\requirements.txt
if !ERRORLEVEL! NEQ 0 ( if !ERRORLEVEL! NEQ 0 (
echo pip install requirements.txt failed! echo pip install requirements.txt failed!
exit /b 5 exit /b 5
...@@ -632,7 +635,7 @@ set /p PADDLE_WHL_FILE_WIN=< whl_file.txt ...@@ -632,7 +635,7 @@ set /p PADDLE_WHL_FILE_WIN=< whl_file.txt
@ECHO ON @ECHO ON
pip uninstall -y paddlepaddle pip uninstall -y paddlepaddle
pip uninstall -y paddlepaddle-gpu pip uninstall -y paddlepaddle-gpu
pip install %PADDLE_WHL_FILE_WIN% --user pip install %PADDLE_WHL_FILE_WIN%
if %ERRORLEVEL% NEQ 0 ( if %ERRORLEVEL% NEQ 0 (
call paddle_winci\Scripts\deactivate.bat 2>NUL call paddle_winci\Scripts\deactivate.bat 2>NUL
echo pip install whl package failed! echo pip install whl package failed!
...@@ -659,7 +662,7 @@ echo ======================================== ...@@ -659,7 +662,7 @@ echo ========================================
: set CI_SKIP_CPP_TEST if only *.py changed : set CI_SKIP_CPP_TEST if only *.py changed
git diff --name-only %BRANCH% | findstr /V "\.py" || set CI_SKIP_CPP_TEST=ON git diff --name-only %BRANCH% | findstr /V "\.py" || set CI_SKIP_CPP_TEST=ON
pip install -r %work_dir%\python\unittest_py\requirements.txt --user pip install -r %work_dir%\python\unittest_py\requirements.txt
if %ERRORLEVEL% NEQ 0 ( if %ERRORLEVEL% NEQ 0 (
echo pip install unittest requirements.txt failed! echo pip install unittest requirements.txt failed!
exit /b 5 exit /b 5
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册