-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.ps1
More file actions
109 lines (89 loc) · 3.77 KB
/
install.ps1
File metadata and controls
109 lines (89 loc) · 3.77 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# Installation Script for Flowfull-Python Client
# License: AGPL-3.0-or-later
Write-Host ""
Write-Host "======================================================================" -ForegroundColor Cyan
Write-Host "Flowfull-Python Client - Installation" -ForegroundColor Cyan
Write-Host "======================================================================" -ForegroundColor Cyan
Write-Host ""
# Check Python installation
Write-Host "Checking Python installation..." -ForegroundColor Yellow
try {
$pythonVersion = python --version 2>&1
Write-Host "✅ Python found: $pythonVersion" -ForegroundColor Green
} catch {
Write-Host "❌ Python not found!" -ForegroundColor Red
Write-Host "Please install Python from https://www.python.org/" -ForegroundColor Yellow
exit 1
}
Write-Host ""
# Ask user about installation type
Write-Host "Choose installation type:" -ForegroundColor Yellow
Write-Host " 1. Global installation (simple, available everywhere)"
Write-Host " 2. Virtual environment (recommended, isolated)"
Write-Host ""
$choice = Read-Host "Enter your choice (1 or 2)"
Write-Host ""
if ($choice -eq "2") {
# Virtual environment installation
Write-Host "Creating virtual environment..." -ForegroundColor Yellow
if (Test-Path "venv") {
Write-Host "⚠️ Virtual environment already exists" -ForegroundColor Yellow
$overwrite = Read-Host "Do you want to recreate it? (y/n)"
if ($overwrite -eq "y" -or $overwrite -eq "yes") {
Remove-Item -Recurse -Force venv
python -m venv venv
Write-Host "✅ Virtual environment recreated" -ForegroundColor Green
}
} else {
python -m venv venv
Write-Host "✅ Virtual environment created" -ForegroundColor Green
}
Write-Host ""
Write-Host "Activating virtual environment..." -ForegroundColor Yellow
# Activate virtual environment
& .\venv\Scripts\Activate.ps1
Write-Host "✅ Virtual environment activated" -ForegroundColor Green
Write-Host ""
}
# Install dependencies
Write-Host "Installing dependencies..." -ForegroundColor Yellow
Write-Host ""
$installResult = pip install -r requirements-dev.txt
if ($LASTEXITCODE -eq 0) {
Write-Host ""
Write-Host "✅ Dependencies installed successfully!" -ForegroundColor Green
} else {
Write-Host ""
Write-Host "❌ Failed to install dependencies!" -ForegroundColor Red
exit 1
}
Write-Host ""
Write-Host "======================================================================" -ForegroundColor Cyan
Write-Host "Installation Complete!" -ForegroundColor Green
Write-Host "======================================================================" -ForegroundColor Cyan
Write-Host ""
# Show next steps
Write-Host "Next steps:" -ForegroundColor Yellow
Write-Host ""
if ($choice -eq "2") {
Write-Host "1. The virtual environment is already activated" -ForegroundColor Cyan
Write-Host " (You'll see 'venv' in your prompt)" -ForegroundColor Gray
Write-Host ""
Write-Host "2. To activate it in the future, run:" -ForegroundColor Cyan
Write-Host " .\venv\Scripts\Activate.ps1" -ForegroundColor Gray
Write-Host ""
Write-Host "3. To deactivate, run:" -ForegroundColor Cyan
Write-Host " deactivate" -ForegroundColor Gray
Write-Host ""
}
Write-Host "Run tests:" -ForegroundColor Cyan
Write-Host " python run_tests.py" -ForegroundColor Gray
Write-Host ""
Write-Host "Run tests with coverage:" -ForegroundColor Cyan
Write-Host " python run_tests.py --cov" -ForegroundColor Gray
Write-Host ""
Write-Host "View coverage report:" -ForegroundColor Cyan
Write-Host " start htmlcov\index.html" -ForegroundColor Gray
Write-Host ""
Write-Host "======================================================================" -ForegroundColor Cyan
Write-Host ""