File size: 1,579 Bytes
94fd4b0
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""
Simple build test for C-3PO TTS API
Tests if all dependencies can be imported
"""

def test_imports():
    """Test if all required packages can be imported"""
    print("πŸ” Testing imports...")
    
    try:
        import fastapi
        print("βœ… FastAPI")
        
        import uvicorn
        print("βœ… Uvicorn")
        
        import torch
        print("βœ… PyTorch")
        
        import torchaudio
        print("βœ… TorchAudio")
        
        import TTS
        print("βœ… Coqui TTS")
        
        import huggingface_hub
        print("βœ… Hugging Face Hub")
        
        import pydantic
        print("βœ… Pydantic")
        
        return True
        
    except ImportError as e:
        print(f"❌ Import failed: {e}")
        return False

def test_api_creation():
    """Test if the API can be created without errors"""
    print("\nπŸš€ Testing API creation...")
    
    try:
        from coqui_api import app
        print("βœ… API created successfully")
        return True
    except Exception as e:
        print(f"❌ API creation failed: {e}")
        return False

def main():
    """Run build tests"""
    print("πŸ§ͺ C-3PO TTS Build Test")
    print("=" * 30)
    
    import_ok = test_imports()
    api_ok = test_api_creation()
    
    print("\n" + "=" * 30)
    
    if import_ok and api_ok:
        print("πŸŽ‰ All tests passed! Ready to deploy.")
        return 0
    else:
        print("❌ Some tests failed. Check dependencies.")
        return 1

if __name__ == "__main__":
    exit(main())