Add option to configure_environment.bat to use global Python environment if desired

This commit is contained in:
Dan Paulat 2025-05-28 23:20:19 -05:00
parent 7748d27b95
commit 3718fc8872

View file

@ -4,11 +4,20 @@
@set venv_path=%script_dir%\..\.venv
:: Assign user-specified Python Virtual Environment
@if not "%~1"=="" set venv_path=%~f1
@if not "%~1"=="" (
if /i "%~1"=="none" (
set venv_path=
) else (
set venv_path=%~f1
)
)
:: Activate Python Virtual Environment
python -m venv %venv_path%
@call %venv_path%\Scripts\activate.bat
@if defined venv_path (
echo Activating Python Virtual Environment: %venv_path%
python -m venv %venv_path%
call %venv_path%\Scripts\activate.bat
)
:: Install Python packages
python -m pip install --upgrade pip
@ -29,6 +38,8 @@ pip install --upgrade -r "%script_dir%\..\requirements.txt"
)
:: Deactivate Python Virtual Environment
@call %venv_path%\Scripts\deactivate.bat
@if defined venv_path (
call %venv_path%\Scripts\deactivate.bat
)
@pause