Files
spark/tools/ensure_venv.cmd
T
John Colvin 1d7fcf5d18 build: Move ':create_venv' fn to its own cmd script
So jenkins scripts can reference it as well as buildspark.cmd
2022-09-19 17:50:40 -05:00

26 lines
473 B
Batchfile

@echo off
setlocal
set venv_dir=%~dp0..\.venv
if exist %venv_dir% (
if "%1"=="--force" (
echo Removing python virtual environment
rmdir /S /Q %venv_dir%
) else (
GOTO ERROR
)
)
echo Creating python virtual environment
@call python -m venv %venv_dir%
@call %venv_dir%\Scripts\activate.bat
@call pip install --upgrade pip
@call %venv_dir%\Scripts\pip install -r %~dp0..\requirements.txt
@call deactivate
EXIT /B %ERRORLEVEL%
:ERROR
EXIT /B 1