Files
spark/tools/ensure_venv.cmd
T
2022-09-29 14:42:34 -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