-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathtest_setup.py
More file actions
executable file
·115 lines (101 loc) · 2.97 KB
/
test_setup.py
File metadata and controls
executable file
·115 lines (101 loc) · 2.97 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
109
110
111
112
113
114
115
#!/usr/bin/env python3
"""
Test script to validate Emigo setup on Replit.
Since Emigo is an Emacs plugin, this script validates that:
1. All Python dependencies are installed
2. Core modules can be imported
3. Configuration is valid
"""
import sys
import importlib
def test_imports():
"""Test that all required modules can be imported."""
required_modules = [
'epc',
'networkx',
'pygments',
'grep_ast',
'diskcache',
'tiktoken',
'tqdm',
'gitignore_parser',
'scipy',
'litellm',
'orjson',
]
print("Testing Python dependencies...")
print("-" * 50)
failed = []
for module in required_modules:
try:
importlib.import_module(module)
print(f"✓ {module:20s} - OK")
except ImportError as e:
print(f"✗ {module:20s} - FAILED: {e}")
failed.append(module)
print("-" * 50)
if failed:
print(f"\n❌ {len(failed)} module(s) failed to import: {', '.join(failed)}")
return False
else:
print("\n✅ All dependencies imported successfully!")
return True
def test_core_modules():
"""Test that Emigo core modules are valid."""
print("\nTesting Emigo core modules...")
print("-" * 50)
core_modules = [
'config',
'utils',
'session',
'tools',
'tool_definitions',
'agent',
'llm',
'llm_providers',
'llm_worker',
'repomapper',
'emigo',
]
failed = []
for module in core_modules:
try:
# Just compile, don't import (to avoid EPC connection issues)
with open(f"{module}.py", 'r') as f:
compile(f.read(), f"{module}.py", 'exec')
print(f"✓ {module}.py - Syntax OK")
except Exception as e:
print(f"✗ {module}.py - FAILED: {e}")
failed.append(module)
print("-" * 50)
if failed:
print(f"\n❌ {len(failed)} module(s) have issues: {', '.join(failed)}")
return False
else:
print("\n✅ All core modules are syntactically valid!")
return True
def main():
print("=" * 50)
print("Emigo Setup Validation Test")
print("=" * 50)
print()
# Test dependencies
deps_ok = test_imports()
# Test core modules
core_ok = test_core_modules()
print("\n" + "=" * 50)
if deps_ok and core_ok:
print("✅ SETUP VALIDATION PASSED")
print("\nEmigo is ready to use from Emacs!")
print("\nNote: This is an Emacs plugin. To use it:")
print("1. Install in Emacs using straight.el")
print("2. Configure API keys (OPENROUTER_API_KEY, etc.)")
print("3. Run M-x emigo in your project")
return 0
else:
print("❌ SETUP VALIDATION FAILED")
print("\nSome components need attention.")
return 1
print("=" * 50)
if __name__ == "__main__":
sys.exit(main())