Skip to content
46 changes: 40 additions & 6 deletions scripts/setup.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,38 @@ if (-not (Test-Command cmake)) {
Write-Host "CMake is already installed. Version: $(cmake --version)" -ForegroundColor Green
}

# --------------------------------------------------
# Miniconda
# --------------------------------------------------
$condaRoot = "$env:USERPROFILE\miniconda3"
$condaExe = "$condaRoot\Scripts\conda.exe"

if (-not (Test-Path $condaExe)) {
Write-Host "Installing Miniconda..." -ForegroundColor Yellow
$installer = "$env:TEMP\miniconda.exe"
Invoke-WebRequest `
-Uri "https://repo.anaconda.com/miniconda/Miniconda3-latest-Windows-x86_64.exe" `
-OutFile $installer

Start-Process -Wait -FilePath $installer -ArgumentList `
"/InstallationType=JustMe",
"/AddToPath=0",
"/RegisterPython=0",
"/S",
"/D=$condaRoot"

Remove-Item $installer
}

# --------------------------------------------------
# Initialize Conda (THIS WAS MISSING BEFORE)
# --------------------------------------------------
$env:Path = "$condaRoot;$condaRoot\Scripts;$condaRoot\condabin;$env:Path"

$condaBase = & $condaExe info --base
& "$condaBase\shell\condabin\conda-hook.ps1"


# ---- Set up the frontend ----
Write-Host "Setting up frontend..." -ForegroundColor Yellow
try {
Expand All @@ -134,13 +166,14 @@ try {
Set-Location .\backend\

# Create virtual environment
python -m venv .env
conda remove -n backend_env --all -y 2>$null
conda create -n backend_env python=3.12 -y
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Command should match the manual setup guide

The environment names and flags should be the same.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok


# Activate virtual environment and install dependencies
.\.env\Scripts\Activate.ps1
conda activate backend_env
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
deactivate
conda deactivate

Set-Location ..

Expand All @@ -156,13 +189,14 @@ try {
Set-Location .\sync-microservice\

# Create virtual environment
python -m venv .sync-env
conda remove -n sync_env --all -y 2>$null
conda create -n sync_env python=3.12 -y

# Activate virtual environment and install dependencies
.\.sync-env\Scripts\Activate.ps1
conda activate sync_env
python -m pip install --upgrade pip
python -m pip install -r requirements.txt
deactivate
conda deactivate

Set-Location ..

Expand Down