Repository navigation
Expand file tree
/
Copy pathverify_setup.py
More file actions
executable file
·105 lines (91 loc) · 3.31 KB
/
Copy pathverify_setup.py
File metadata and controls
executable file
·105 lines (91 loc) · 3.31 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
#!/usr/bin/env python3
"""Quick setup verification script."""
import subprocess
import sys
import os
from pathlib import Path
def check_virtual_env():
"""Check if virtual environment exists and has correct packages."""
venv_path = Path("venv")
if not venv_path.exists():
print("❌ Virtual environment not found")
return False
python_path = venv_path / "bin" / "python"
if not python_path.exists():
print("❌ Python executable not found in virtual environment")
return False
# Test import
try:
result = subprocess.run([
str(python_path), "-c", "import ai_arch; import fastapi; import uvicorn"
], capture_output=True, text=True)
if result.returncode == 0:
print("✅ Virtual environment setup correctly")
return True
else:
print(f"❌ Import test failed: {result.stderr}")
return False
except Exception as e:
print(f"❌ Error testing virtual environment: {e}")
return False
def check_makefile_commands():
"""Check if Makefile commands work."""
try:
# Test version command
result = subprocess.run(["make", "version"], capture_output=True, text=True)
if result.returncode == 0 and "AI Arch System v0.1.0" in result.stdout:
print("✅ Make commands use virtual environment correctly")
return True
else:
print(f"❌ Make version command failed: {result.stderr}")
return False
except Exception as e:
print(f"❌ Error testing make commands: {e}")
return False
def check_port_configuration():
"""Check if port is correctly configured to 6545."""
files_to_check = [
("Makefile", "6545"),
("ai_arch/main.py", "6545"),
("demo.py", "6545"),
("README.md", "6545")
]
all_good = True
for file, expected_port in files_to_check:
if Path(file).exists():
content = Path(file).read_text()
if expected_port in content:
print(f"✅ Port {expected_port} configured in {file}")
else:
print(f"❌ Port {expected_port} not found in {file}")
all_good = False
else:
print(f"⚠️ File {file} not found")
return all_good
def main():
"""Main verification function."""
print("🔍 AI Architecture System - Setup Verification")
print("=" * 50)
checks = [
("Virtual Environment", check_virtual_env),
("Makefile Commands", check_makefile_commands),
("Port Configuration", check_port_configuration),
]
all_passed = True
for check_name, check_func in checks:
print(f"\n📋 Checking {check_name}...")
if not check_func():
all_passed = False
print("\n" + "=" * 50)
if all_passed:
print("🎉 All checks passed! System is ready to use.")
print("\n📖 Quick Start:")
print(" make dev # Start development server on port 6545")
print(" make help # See all available commands")
print(" python3 demo.py # Run the demo")
return 0
else:
print("❌ Some checks failed. Please review the issues above.")
return 1
if __name__ == "__main__":
sys.exit(main())