-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathuv_setup.py
48 lines (33 loc) · 1.39 KB
/
uv_setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# Sets up Penguin using UV package manager
# Create virtual environment with Python 3.10
import os
import subprocess
import sys
def run_command(description, command):
print(f"\n🐧 {description}")
print(f"Running command: {' '.join(command)}")
# Run command without capturing output to show real-time progress
result = subprocess.run(command, capture_output=False, text=True)
if result.returncode != 0:
print(f"\n❌ Error during {description.lower()}")
sys.exit(1)
print(f"✅ {description} complete!")
def main():
print("\n🐧 Setting up Penguin Development Environment\n")
# Debug: Show current working directory
print(f"Current working directory: {os.getcwd()}")
print(f"Requirements file exists: {os.path.exists('requirements.txt')}")
# Create virtual environment with Python 3.10
run_command("Creating virtual environment", ["uv", "venv", "--python", "3.10"])
# Install requirements
run_command(
"Installing dependencies", ["uv", "pip", "install", "-r", "requirements.txt"]
)
print("\n✨ Setup complete! Happy coding! 🐧")
# Ask if user wants to launch Penguin
launch = input("\nWould you like to launch Penguin now? (y/N): ").lower().strip()
if launch == "y":
print("\n🚀 Launching Penguin...\n")
subprocess.run(["uv", "run", "main.py"])
if __name__ == "__main__":
main()