Initial commit.
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
import sys
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def run_command(command, check=True):
|
||||
print(f"Running: {command}")
|
||||
result = subprocess.run(command, shell=True, check=check)
|
||||
return result.returncode == 0
|
||||
|
||||
|
||||
def install_pyr():
|
||||
print("🚀 Installing PYR - Python R Vibe Tool")
|
||||
print("=" * 50)
|
||||
|
||||
project_root = Path(__file__).parent.parent
|
||||
os.chdir(project_root)
|
||||
|
||||
print("📦 Installing dependencies...")
|
||||
if not run_command("pip install -e ."):
|
||||
print("❌ Failed to install dependencies")
|
||||
return False
|
||||
|
||||
print("🔧 Installing development dependencies...")
|
||||
if not run_command("pip install -e .[dev]"):
|
||||
print("⚠️ Failed to install development dependencies (continuing...)")
|
||||
|
||||
print("📋 Creating default configuration...")
|
||||
env_example = project_root / ".env.example"
|
||||
env_file = project_root / ".env"
|
||||
|
||||
if not env_file.exists() and env_example.exists():
|
||||
env_file.write_text(env_example.read_text())
|
||||
print(f"✅ Created {env_file}")
|
||||
|
||||
print("🧪 Running tests...")
|
||||
if not run_command("python -m pytest tests/ -v", check=False):
|
||||
print("⚠️ Some tests failed (continuing...)")
|
||||
|
||||
print("✅ PYR installation completed!")
|
||||
print("\n📖 Quick Start:")
|
||||
print(" pyr --help")
|
||||
print(" pyr 'Hello, how can you help me?'")
|
||||
print(" pyr # Start interactive REPL")
|
||||
|
||||
return True
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
if install_pyr():
|
||||
sys.exit(0)
|
||||
else:
|
||||
sys.exit(1)
|
||||
except KeyboardInterrupt:
|
||||
print("\n❌ Installation cancelled by user")
|
||||
sys.exit(130)
|
||||
Reference in New Issue
Block a user