From 3718fc8872bb32ce06d04ad695d9478a7ba0de21 Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Wed, 28 May 2025 23:20:19 -0500 Subject: [PATCH] Add option to configure_environment.bat to use global Python environment if desired --- tools/configure-environment.bat | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/tools/configure-environment.bat b/tools/configure-environment.bat index e60336bb..d386ecc0 100644 --- a/tools/configure-environment.bat +++ b/tools/configure-environment.bat @@ -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