| #!/usr/bin/env python3 | |
| """NEXUS OS v3.1 Cold Start Installer — Run once, get everything ready.""" | |
| import os | |
| import sys | |
| import subprocess | |
| import json | |
| from pathlib import Path | |
| from datetime import datetime | |
| ROOT = Path(__file__).parent | |
| VENV = ROOT / "venv" | |
| def run(cmd, cwd=None): | |
| result = subprocess.run(cmd, shell=True, capture_output=True, text=True, cwd=cwd or ROOT) | |
| return result.returncode, result.stdout.strip(), result.stderr.strip() | |
| def header(msg): | |
| print(f"\n{'='*65}") | |
| print(f" {msg}") | |
| print('='*65) | |
| def main(): | |
| header("NEXUS OS v3.1 — COLD START INSTALLER") | |
| # Python version check | |
| if sys.version_info < (3, 10): | |
| print("[FAIL] Python 3.10+ required"); sys.exit(1) | |
| print(f"[OK] Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}") | |
| # Create venv if missing | |
| header("VIRTUAL ENVIRONMENT") | |
| if not (VENV / "bin" / "python").exists() and not (VENV / "Scripts" / "python.exe").exists(): | |
| print("[...] Creating virtual environment...") | |
| run(f"{sys.executable} -m venv venv") | |
| pip = str(VENV / "bin" / "pip") if (VENV / "bin").exists() else str(VENV / "Scripts" / "pip.exe") | |
| python = str(VENV / "bin" / "python") if (VENV / "bin").exists() else str(VENV / "Scripts" / "python.exe") | |
| # Install dependencies | |
| header("DEPENDENCIES") | |
| code, _, _ = run(f"{pip} install -e . httpx -q") | |
| print("[OK] Dependencies installed" if code == 0 else "[WARN] Some packages may need attention") | |
| # Run diagnostics | |
| header("SYSTEM DIAGNOSTICS") | |
| run(f"{python} scripts/diagnostic.py") | |
| # Run tests | |
| header("TEST SUITE") | |
| code, out, _ = run(f"{python} -m pytest tests/ -q --tb=line") | |
| if "passed" in out and "failed" not in out: | |
| print("[OK] All tests passed (635+)") | |
| else: | |
| print("[WARN] Some tests need attention") | |
| header("INSTALLATION COMPLETE") | |
| print("Next steps:") | |
| print(" 1. uvicorn nexus_os.api.server:app --host 0.0.0.0 --port 7352") | |
| print(" 2. Read COLDSTART_BOOT.txt") | |
| print(" 3. Check tasks/pending/ for your first assignment") | |
| print(f"\nTimestamp: {datetime.now().isoformat()}") | |
| if __name__ == "__main__": | |
| main() |
Xet Storage Details
- Size:
- 2.21 kB
- Xet hash:
- 2ea84f042378da837b80651d018c4528ac8affc624446d07da82ce21f919077d
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.