-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdev-setup.ps1
More file actions
66 lines (57 loc) · 2.49 KB
/
dev-setup.ps1
File metadata and controls
66 lines (57 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Development setup script for Windows PowerShell
# This script sets up the development environment for document-reader-mcp
Write-Host "========================================" -ForegroundColor Cyan
Write-Host "document-reader-mcp Development Setup" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Check if Python is installed
try {
$pythonVersion = & python --version 2>&1
Write-Host "Found Python: $pythonVersion" -ForegroundColor Green
} catch {
Write-Host "ERROR: Python is not installed or not in PATH" -ForegroundColor Red
Write-Host "Please install Python 3.10 or higher from https://www.python.org/downloads/" -ForegroundColor Yellow
exit 1
}
Write-Host "[1/4] Creating virtual environment..." -ForegroundColor Yellow
if (Test-Path ".venv") {
Write-Host "Virtual environment already exists, skipping creation" -ForegroundColor Gray
} else {
python -m venv .venv
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to create virtual environment" -ForegroundColor Red
exit 1
}
}
Write-Host "[2/4] Activating virtual environment..." -ForegroundColor Yellow
& .\.venv\Scripts\Activate.ps1
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to activate virtual environment" -ForegroundColor Red
Write-Host "You may need to enable script execution:" -ForegroundColor Yellow
Write-Host " Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser" -ForegroundColor Cyan
exit 1
}
Write-Host "[3/4] Installing dependencies..." -ForegroundColor Yellow
python -m pip install --upgrade pip | Out-Null
pip install -r requirements.txt
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to install dependencies" -ForegroundColor Red
exit 1
}
Write-Host "[4/4] Installing package in development mode..." -ForegroundColor Yellow
pip install -e .
if ($LASTEXITCODE -ne 0) {
Write-Host "ERROR: Failed to install package" -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Green
Write-Host "Setup complete!" -ForegroundColor Green
Write-Host "========================================" -ForegroundColor Green
Write-Host ""
Write-Host "To activate the virtual environment in the future:" -ForegroundColor Cyan
Write-Host " .\.venv\Scripts\Activate.ps1" -ForegroundColor White
Write-Host ""
Write-Host "To run the server:" -ForegroundColor Cyan
Write-Host " python -m server.main" -ForegroundColor White
Write-Host ""