mirror of
https://github.com/MLSysBook/TinyTorch.git
synced 2026-04-28 15:22:39 -05:00
Fix setup command venv recreation logic
When user declined venv recreation, setup was still printing "Setting up virtual environment..." before checking if it existed, making it appear that recreation was proceeding anyway. Changes: - Check for existing venv before printing any messages - Show "✅ Using existing virtual environment" when user declines - Show "🐍 Recreating..." only when actually recreating - Show "🐍 Setting up..." only for new venv creation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -141,16 +141,18 @@ class SetupCommand(BaseCommand):
|
||||
|
||||
def create_virtual_environment(self) -> bool:
|
||||
"""Create a virtual environment for Tiny🔥Torch development."""
|
||||
self.console.print("🐍 Setting up virtual environment...")
|
||||
|
||||
venv_path = self.config.project_root / ".venv"
|
||||
|
||||
|
||||
if venv_path.exists():
|
||||
if not Confirm.ask(f"Virtual environment already exists at {venv_path}. Recreate?"):
|
||||
self.console.print("[green]✅ Using existing virtual environment[/green]")
|
||||
return True
|
||||
|
||||
|
||||
self.console.print("🐍 Recreating virtual environment...")
|
||||
import shutil
|
||||
shutil.rmtree(venv_path)
|
||||
else:
|
||||
self.console.print("🐍 Setting up virtual environment...")
|
||||
|
||||
try:
|
||||
# Detect Apple Silicon and force arm64 if needed
|
||||
|
||||
Reference in New Issue
Block a user