-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalidate_structure.py
More file actions
68 lines (58 loc) · 2.2 KB
/
Copy pathvalidate_structure.py
File metadata and controls
68 lines (58 loc) · 2.2 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
#!/usr/bin/env python3
"""
Validador da estrutura do projeto PenguinTrack
Verifica se todos os módulos podem ser importados corretamente
"""
import sys
import os
import importlib.util
def test_import(module_path, description):
"""Testa importação de um módulo"""
try:
spec = importlib.util.spec_from_file_location("test_module", module_path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
print(f"✅ {description}")
return True
except Exception as e:
print(f"❌ {description}: {e}")
return False
def main():
print("🐧 Validação da Estrutura do PenguinTrack")
print("="*50)
# Adiciona src ao path
project_root = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, project_root)
tests = [
("src/core/config_manager.py", "ConfigManager"),
("src/core/face_tracker.py", "FaceTracker"),
("src/core/filters.py", "FilterManager"),
("src/output/output_manager.py", "OutputManager"),
("src/ui/cube3d.py", "Cube3D"),
("src/ui/avatar3d.py", "Avatar3D"),
("src/utils/udp_receiver.py", "UDP Receiver"),
("main.py", "Aplicação Principal"),
]
success_count = 0
total_tests = len(tests)
for module_path, description in tests:
full_path = os.path.join(project_root, module_path)
if os.path.exists(full_path):
if test_import(full_path, description):
success_count += 1
else:
print(f"❌ {description}: Arquivo não encontrado - {module_path}")
print("="*50)
print(f"Resultado: {success_count}/{total_tests} módulos importados com sucesso")
if success_count == total_tests:
print("🎉 Estrutura do projeto validada com sucesso!")
print("✅ Todos os módulos estão organizados corretamente")
print("🚀 Projeto pronto para publicação no GitHub!")
return True
else:
print("❌ Alguns módulos falharam na importação")
print("🔧 Verifique os erros acima antes de publicar")
return False
if __name__ == "__main__":
success = main()
sys.exit(0 if success else 1)