""" Test script to verify all imports work correctly Run this before deploying to catch any import errors """ import sys from pathlib import Path # Add project root to path PROJECT_ROOT = Path(__file__).parent sys.path.insert(0, str(PROJECT_ROOT)) print("=" * 60) print("Testing Imports for Hybrid Architecture") print("=" * 60) errors = [] # Test backend imports print("\nšŸ“¦ Testing Backend Imports...") try: from backend import app print("āœ… backend.app") except Exception as e: print(f"āŒ backend.app: {e}") errors.append(("backend.app", e)) try: from backend import routes print("āœ… backend.routes") except Exception as e: print(f"āŒ backend.routes: {e}") errors.append(("backend.routes", e)) # Test worker imports print("\nāš™ļø Testing Worker Imports...") try: from worker import celery_app print("āœ… worker.celery_app") except Exception as e: print(f"āŒ worker.celery_app: {e}") errors.append(("worker.celery_app", e)) try: from worker import tasks print("āœ… worker.tasks") except Exception as e: print(f"āŒ worker.tasks: {e}") errors.append(("worker.tasks", e)) # Test existing src imports print("\nšŸ”§ Testing Existing Src Imports...") try: from src.learning_path import LearningPathGenerator print("āœ… src.learning_path.LearningPathGenerator") except Exception as e: print(f"āŒ src.learning_path.LearningPathGenerator: {e}") errors.append(("src.learning_path", e)) try: from src.ml.model_orchestrator import ModelOrchestrator print("āœ… src.ml.model_orchestrator.ModelOrchestrator") except Exception as e: print(f"āŒ src.ml.model_orchestrator: {e}") errors.append(("src.ml.model_orchestrator", e)) # Summary print("\n" + "=" * 60) if not errors: print("šŸŽ‰ All imports successful!") print("\nāœ… Ready for deployment!") else: print(f"āš ļø {len(errors)} import error(s) found:") for module, error in errors: print(f" - {module}: {error}") print("\nāŒ Fix these errors before deploying") print("=" * 60)