From 313801b08c6c98b6535f733039241ceb285360eb Mon Sep 17 00:00:00 2001 From: Furqan-14 Date: Wed, 27 May 2026 12:47:38 +0530 Subject: [PATCH] fix: gateway script issue --- scripts/start_gateway.ps1 | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/scripts/start_gateway.ps1 b/scripts/start_gateway.ps1 index 611f2b2..d8c5a0d 100644 --- a/scripts/start_gateway.ps1 +++ b/scripts/start_gateway.ps1 @@ -17,7 +17,33 @@ if ($Port -le 0) { Write-Host "Starting FastAPI Gateway local dev server on port $Port..." -ForegroundColor Cyan Push-Location $gatewayDir try { + # Check if virtual environment exists, if not, bootstrap it + if (-not (Test-Path ".venv")) { + Write-Host "Python virtual environment not found. Bootstrapping gateway environment..." -ForegroundColor Yellow + + # Verify Python is installed + if (-not (Get-Command python -ErrorAction SilentlyContinue)) { + Write-Error "Python was not found on your PATH. Please install Python 3.11+ and try again." + return + } + + Write-Host "Creating virtual environment in $gatewayDir\.venv..." -ForegroundColor Yellow + & python -m venv .venv + if ($LASTEXITCODE -ne 0 -or -not (Test-Path ".venv")) { + Write-Error "Failed to create Python virtual environment." + return + } + + Write-Host "Installing gateway dependencies (pip install -e '.[dev]')..." -ForegroundColor Yellow + & .venv\Scripts\pip install -e ".[dev]" + if ($LASTEXITCODE -ne 0) { + Write-Error "Failed to install gateway dependencies." + return + } + Write-Host "Bootstrap complete!" -ForegroundColor Green + } + & .venv\Scripts\uvicorn app.main:app --reload --port $Port } finally { Pop-Location -} +} \ No newline at end of file