#!/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())