| import os |
| import sys |
|
|
| def run_health_check(): |
| required_files = [ |
| 'app.py', 'Dockerfile', 'requirements.txt', |
| 'package.json', 'index.html', 'src/App.tsx' |
| ] |
| |
| print("--- Abyssinia Intelligence: V13 Pre-Flight Check ---") |
| |
| |
| missing = [f for f in required_files if not os.path.exists(f)] |
| if missing: |
| print(f"❌ ERROR: Missing files: {', '.join(missing)}") |
| else: |
| print("✅ All required files present.") |
|
|
| |
| try: |
| import ast |
| with open('app.py', 'r') as f: |
| ast.parse(f.read()) |
| print("✅ app.py syntax is valid.") |
| except Exception as e: |
| print(f"❌ ERROR in app.py syntax: {e}") |
|
|
| |
| with open('app.py', 'r') as f: |
| content = f.read() |
| if "port=7860" in content: |
| print("✅ app.py is correctly listening on port 7860.") |
| else: |
| print("⚠️ WARNING: app.py might not be using port 7860. Hugging Face requires this.") |
|
|
| print("\nIf all checks are green, proceed with: git push origin main") |
|
|
| if __name__ == "__main__": |
| run_health_check() |