Files
spark/tools/ensure_venv.cmd
T
2023-07-18 23:40:18 -04:00

27 lines
505 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 END
)
)
echo Creating python virtual environment
@call python -m venv %venv_dir%
@call %venv_dir%\Scripts\activate.bat
@call %venv_dir%\Scripts\python -m pip install --upgrade pip
@call %venv_dir%\Scripts\pip install -r %~dp0..\requirements.txt
@call deactivate
:END
EXIT /B %ERRORLEVEL%
:ERROR
EXIT /B 1